nemar-cli 0.10.39-PR2297.8fed331 → 0.10.39-PR2299.629ae51

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,41 +1,41 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var vS=Object.create;var{getPrototypeOf:$S,defineProperty:Wo,getOwnPropertyNames:bS}=Object;var id=Object.prototype.hasOwnProperty;function wS(e){return this[e]}var ES,SS,vc=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?ES??=new WeakMap:SS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?vS($S(e)):{};let i=t||!e||!e.__esModule||!id.call(e,"default")?Wo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of bS(e))if(!id.call(i,a))Wo(i,a,{get:wS.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 xS=(e)=>e;function RS(e,t){this[e]=xS.bind(null,t)}var O9=(e,t)=>{for(var r in t)Wo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:RS.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 A9=(e,t,r)=>{for(var n in t)Wo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},N9=import.meta.require;function Yo(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($c.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($c.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"&&!kS.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($c.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function bc(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 ad(e,t){if(bc(e,t))throw Error("Cannot use string index")}function cd(e,t,r){if(!yn(e)||typeof t!=="string")return r===void 0?e:r;let n=Yo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if(bc(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 wc(e,t,r){if(!yn(e)||typeof t!=="string")return e;let n=e,s=Yo(t);for(let o=0;o<s.length;o++){let i=s[o];if(ad(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 ud(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Yo(t);for(let n=0;n<r.length;n++){let s=r[n];if(ad(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!yn(e))return!1}}function ld(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Yo(t);if(r.length===0)return!1;for(let n of r){if(!yn(e)||!(n in e)||bc(e,n))return!1;e=e[n]}return!0}var yn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},$c,kS;var dd=F(()=>{$c=new Set(["__proto__","prototype","constructor"]),kS=new Set("0123456789")});import we from"path";import fd from"os";import Ec from"process";function xc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Ec.platform==="darwin")return TS(e);if(Ec.platform==="win32")return OS(e);return AS(e)}var kr,Sc,Dn,TS=(e)=>{let t=we.join(kr,"Library");return{data:we.join(t,"Application Support",e),config:we.join(t,"Preferences",e),cache:we.join(t,"Caches",e),log:we.join(t,"Logs",e),temp:we.join(Sc,e)}},OS=(e)=>{let t=Dn.APPDATA||we.join(kr,"AppData","Roaming"),r=Dn.LOCALAPPDATA||we.join(kr,"AppData","Local");return{data:we.join(r,e,"Data"),config:we.join(t,e,"Config"),cache:we.join(r,e,"Cache"),log:we.join(r,e,"Log"),temp:we.join(Sc,e)}},AS=(e)=>{let t=we.basename(kr);return{data:we.join(Dn.XDG_DATA_HOME||we.join(kr,".local","share"),e),config:we.join(Dn.XDG_CONFIG_HOME||we.join(kr,".config"),e),cache:we.join(Dn.XDG_CACHE_HOME||we.join(kr,".cache"),e),log:we.join(Dn.XDG_STATE_HOME||we.join(kr,".local","state"),e),temp:we.join(Sc,t,e)}};var pd=F(()=>{kr=fd.homedir(),Sc=fd.tmpdir(),{env:Dn}=Ec});var NS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},qt;var hd=F(()=>{qt=NS});var IS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},kt;var md=F(()=>{kt=IS});var gd=250;var yd=()=>{};var PS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=s.interval??gd,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)})}}},Dt;var _d=F(()=>{yd();Dt=PS});var CS=(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}}}},Mt;var vd=F(()=>{Mt=CS});var Rc=F(()=>{hd();md();_d();vd()});var zs,kc;var $d=F(()=>{Tc();zs={isChangeErrorOk:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!bd&&(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}},kc=zs});import wd from"process";var Gs,et,bd,Fe;var Tc=F(()=>{$d();Gs={onError:kc.onChangeError},et={onError:()=>{return}},bd=wd.getuid?!wd.getuid():!1,Fe={isRetriable:kc.isRetriableError}});import ie from"fs";import{promisify as ze}from"util";var jS,De;var Oc=F(()=>{Rc();Rc();Tc();jS={attempt:{chmod:qt(ze(ie.chmod),Gs),chown:qt(ze(ie.chown),Gs),close:qt(ze(ie.close),et),fsync:qt(ze(ie.fsync),et),mkdir:qt(ze(ie.mkdir),et),realpath:qt(ze(ie.realpath),et),stat:qt(ze(ie.stat),et),unlink:qt(ze(ie.unlink),et),chmodSync:kt(ie.chmodSync,Gs),chownSync:kt(ie.chownSync,Gs),closeSync:kt(ie.closeSync,et),existsSync:kt(ie.existsSync,et),fsyncSync:kt(ie.fsync,et),mkdirSync:kt(ie.mkdirSync,et),realpathSync:kt(ie.realpathSync,et),statSync:kt(ie.statSync,et),unlinkSync:kt(ie.unlinkSync,et)},retry:{close:Dt(ze(ie.close),Fe),fsync:Dt(ze(ie.fsync),Fe),open:Dt(ze(ie.open),Fe),readFile:Dt(ze(ie.readFile),Fe),rename:Dt(ze(ie.rename),Fe),stat:Dt(ze(ie.stat),Fe),write:Dt(ze(ie.write),Fe),writeFile:Dt(ze(ie.writeFile),Fe),closeSync:Mt(ie.closeSync,Fe),fsyncSync:Mt(ie.fsyncSync,Fe),openSync:Mt(ie.openSync,Fe),readFileSync:Mt(ie.readFileSync,Fe),renameSync:Mt(ie.renameSync,Fe),statSync:Mt(ie.statSync,Fe),writeSync:Mt(ie.writeSync,Fe),writeFileSync:Mt(ie.writeFileSync,Fe)}},De=jS});import _n from"process";var Ed="utf8",Ac=438,Sd=511,xd,Rd,kd,Td=1000,Od,az,Nc=128;var Ic=F(()=>{xd={},Rd=_n.geteuid?_n.geteuid():-1,kd=_n.getegid?_n.getegid():-1,Od=!!_n.getuid,az=_n.getuid?!_n.getuid():!1});var Ad=(e)=>e instanceof Error&&("code"in e),Pc=(e)=>typeof e==="string",Xo=(e)=>e===void 0;var Nd=()=>{};var Id=()=>{};import Pd from"process";var Cd,Jo;var Cc=F(()=>{Cd=Pd.platform==="linux",Jo=Pd.platform==="win32"});var jc,jd;var qd=F(()=>{Cc();jc=["SIGHUP","SIGINT","SIGTERM"];if(!Jo)jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Cd)jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");jd=jc});import Mn from"process";class Dd{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(Jo&&(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 jd)try{Mn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Md;var Ld=F(()=>{Cc();qd();Md=new Dd});var qS,Ud;var Fd=F(()=>{Ld();qS=Md.register,Ud=qS});import DS from"path";var dt,Ks;var Vd=F(()=>{Oc();Fd();Ic();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=DS.basename(e);if(t.length<=Nc)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Nc;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ud(dt.purgeSyncAll);Ks=dt});import MS from"path";function qc(e,t,r=xd){if(Pc(r))return qc(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=Od&&Xo(r.chown),l=Xo(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=MS.dirname(e);De.attempt.mkdirSync(p,{mode:Sd,recursive:!0})}if(a=De.retry.openSync(s)(i,"w",r.mode||Ac),r.tmpCreated)r.tmpCreated(i);if(Pc(t))De.retry.writeSync(s)(a,t,0,r.encoding||Ed);else if(!Xo(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!==Rd||r.chown.gid!==kd))De.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Ac)De.attempt.chmodSync(i,r.mode);try{De.retry.renameSync(s)(i,e)}catch(p){if(!Ad(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 zd=F(()=>{Oc();Ic();Nd();Id();Vd()});var Bs=g(function(Hd){Object.defineProperty(Hd,"__esModule",{value:!0});Hd.regexpCode=Hd.getEsmExportName=Hd.getProperty=Hd.safeStringify=Hd.stringify=Hd.strConcat=Hd.addCodeArg=Hd.str=Hd._=Hd.nil=Hd._Code=Hd.Name=Hd.IDENTIFIER=Hd._CodeOrName=void 0;class Qo{}Hd._CodeOrName=Qo;Hd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ln extends Qo{constructor(e){super();if(!Hd.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}}}Hd.Name=Ln;class Tt extends Qo{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},{})}}Hd._Code=Tt;Hd.nil=new Tt("");function Gd(e,...t){let r=[e[0]],n=0;while(n<t.length)Mc(r,t[n]),r.push(e[++n]);return new Tt(r)}Hd._=Gd;var Dc=new Tt("+");function Kd(e,...t){let r=[Hs(e[0])],n=0;while(n<t.length)r.push(Dc),Mc(r,t[n]),r.push(Dc,Hs(e[++n]));return LS(r),new Tt(r)}Hd.str=Kd;function Mc(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof Ln)e.push(t);else e.push(VS(t))}Hd.addCodeArg=Mc;function LS(e){let t=1;while(t<e.length-1){if(e[t]===Dc){let r=US(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function US(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 FS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kd`${e}${t}`}Hd.strConcat=FS;function VS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Hs(Array.isArray(e)?e.join(","):e)}function zS(e){return new Tt(Hs(e))}Hd.stringify=zS;function Hs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Hd.safeStringify=Hs;function GS(e){return typeof e=="string"&&Hd.IDENTIFIER.test(e)?new Tt(`.${e}`):Gd`[${e}]`}Hd.getProperty=GS;function KS(e){if(typeof e=="string"&&Hd.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Hd.getEsmExportName=KS;function HS(e){return new Tt(e.toString())}Hd.regexpCode=HS});var Vc=g(function(Xd){Object.defineProperty(Xd,"__esModule",{value:!0});Xd.ValueScope=Xd.ValueScopeName=Xd.Scope=Xd.varKinds=Xd.UsedValueState=void 0;var pe=Bs();class Wd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ei;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ei||(Xd.UsedValueState=ei={}));Xd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Uc{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}}}Xd.Scope=Uc;class Fc 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}]`}}Xd.ValueScopeName=Fc;var ox=pe._`\n`;class Yd extends Uc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ox:pe.nil}}get(){return this._scope}name(e){return new Fc(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,ei.Started);let u=t(c);if(u){let d=this.opts.es5?Xd.varKinds.var:Xd.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 Wd(c);a.set(c,ei.Completed)})}return s}}Xd.ValueScope=Yd});var Y=g(function(tt){Object.defineProperty(tt,"__esModule",{value:!0});tt.or=tt.and=tt.not=tt.CodeGen=tt.operators=tt.varKinds=tt.ValueScopeName=tt.ValueScope=tt.Scope=tt.Name=tt.regexpCode=tt.stringify=tt.getProperty=tt.nil=tt.strConcat=tt.str=tt._=void 0;var A=Bs(),xe=Vc(),Tr=Bs();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(tt,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(tt,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(tt,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Tr.Name}});var ii=Vc();Object.defineProperty(tt,"Scope",{enumerable:!0,get:function(){return ii.Scope}});Object.defineProperty(tt,"ValueScope",{enumerable:!0,get:function(){return ii.ValueScope}});Object.defineProperty(tt,"ValueScopeName",{enumerable:!0,get:function(){return ii.ValueScopeName}});Object.defineProperty(tt,"varKinds",{enumerable:!0,get:function(){return ii.varKinds}});tt.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 Or{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Qd extends Or{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 Kc extends Or{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 oi(e,this.rhs)}}class Zd extends Kc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ef extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class tf extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class rf extends Or{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class nf extends Or{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 ai extends Or{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;ux(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 Ar extends ai{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class sf extends ai{}class Ws extends Ar{}Ws.kind="else";class gr extends Ar{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 gr?t:t.nodes;if(this.nodes.length)return this;return new gr(lf(e),t instanceof gr?[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(oi(e,this.condition),this.else)vn(e,this.else.names);return e}}gr.kind="if";class Un extends Ar{}Un.kind="for";class of 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 af 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=oi(super.names,this.from);return oi(e,this.to)}}class zc 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 ti extends Ar{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)}}ti.kind="func";class ri extends ai{render(e){return"return "+super.render(e)}}ri.kind="return";class cf extends Ar{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 ni extends Ar{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ni.kind="catch";class si extends Ar{render(e){return"finally"+super.render(e)}}si.kind="finally";class uf{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 sf]}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 Qd(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 Kc(e,t,r))}add(e,t){return this._leafNode(new Zd(e,tt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==A.nil)this._leafNode(new nf(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 gr(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 gr(e))}else(){return this._elseNode(new Ws)}endIf(){return this._endBlockNode(gr,Ws)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new of(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 af(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 zc("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 zc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(Un)}label(e){return this._leafNode(new ef(e))}break(e){return this._leafNode(new tf(e))}return(e){let t=new ri;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ri)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new cf;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new ni(s),t(s)}if(r)this._currNode=n.finally=new si,this.code(r);return this._endBlockNode(ni,si)}throw(e){return this._leafNode(new rf(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 ti(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ti)}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 gr))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}}tt.CodeGen=uf;function vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function oi(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 ux(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:A._`!${Gc(e)}`}tt.not=lf;var lx=df(tt.operators.AND);function dx(...e){return e.reduce(lx)}tt.and=dx;var fx=df(tt.operators.OR);function px(...e){return e.reduce(fx)}tt.or=px;function df(e){return(t,r)=>t===A.nil?r:r===A.nil?t:A._`${Gc(t)} ${e} ${Gc(r)}`}function Gc(e){return e instanceof A.Name?e:A._`(${e})`}});var te=g(function(bf){Object.defineProperty(bf,"__esModule",{value:!0});bf.checkStrictMode=bf.getErrorPath=bf.Type=bf.useFunc=bf.setEvaluated=bf.evaluatedPropsToName=bf.mergeEvaluated=bf.eachItem=bf.unescapeJsonPointer=bf.escapeJsonPointer=bf.escapeFragment=bf.unescapeFragment=bf.schemaRefOrVal=bf.schemaHasRulesButRef=bf.schemaHasRules=bf.checkUnknownRules=bf.alwaysValidSchema=bf.toHash=void 0;var L=Y(),mf=Bs();function yx(e){let t={};for(let r of e)t[r]=!0;return t}bf.toHash=yx;function _x(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return gf(e,t),!yf(t,e.self.RULES.all)}bf.alwaysValidSchema=_x;function gf(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])$f(e,`unknown keyword: "${o}"`)}bf.checkUnknownRules=gf;function yf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}bf.schemaHasRules=yf;function vx(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}bf.schemaHasRulesButRef=vx;function $x({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)}`}bf.schemaRefOrVal=$x;function bx(e){return _f(decodeURIComponent(e))}bf.unescapeFragment=bx;function wx(e){return encodeURIComponent(Bc(e))}bf.escapeFragment=wx;function Bc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}bf.escapeJsonPointer=Bc;function _f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}bf.unescapeJsonPointer=_f;function Ex(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}bf.eachItem=Ex;function pf({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}}bf.mergeEvaluated={props:pf({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} || {}`),Wc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vf}),items:pf({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 vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",L._`{}`);if(t!==void 0)Wc(e,r,t);return r}bf.evaluatedPropsToName=vf;function Wc(e,t,r){Object.keys(r).forEach((n)=>e.assign(L._`${t}${L.getProperty(n)}`,!0))}bf.setEvaluated=Wc;var hf={};function Sx(e,t){return e.scopeValue("func",{ref:t,code:hf[t.code]||(hf[t.code]=new mf._Code(t.code))})}bf.useFunc=Sx;var Hc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Hc||(bf.Type=Hc={}));function xx(e,t,r){if(e instanceof L.Name){let n=t===Hc.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():"/"+Bc(e)}bf.getErrorPath=xx;function $f(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}bf.checkStrictMode=$f});var ht=g(function(Ef){Object.defineProperty(Ef,"__esModule",{value:!0});var ce=Y(),zx={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")};Ef.default=zx});var Ys=g(function(kf){Object.defineProperty(kf,"__esModule",{value:!0});kf.extendErrors=kf.resetErrorsCount=kf.reportExtraError=kf.reportError=kf.keyword$DataError=kf.keywordError=void 0;var P=Y(),Nr=te(),We=ht();kf.keywordError={message:({keyword:e})=>P.str`must pass "${e}" keyword validation`};kf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?P.str`"${e}" keyword must be ${t} ($data)`:P.str`"${e}" keyword is invalid ($data)`};function Kx(e,t=kf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Rf(e,t,r);if(n!==null&&n!==void 0?n:i||a)Sf(o,c);else xf(s,P._`[${c}]`)}kf.reportError=Kx;function Hx(e,t=kf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Rf(e,t,r);if(Sf(s,a),!(o||i))xf(n,We.default.vErrors)}kf.reportExtraError=Hx;function Bx(e,t){e.assign(We.default.errors,t),e.if(P._`${We.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(P._`${We.default.vErrors}.length`,t),()=>e.assign(We.default.vErrors,null)))}kf.resetErrorsCount=Bx;function Wx({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,P._`${We.default.vErrors}[${a}]`),e.if(P._`${i}.instancePath === undefined`,()=>e.assign(P._`${i}.instancePath`,P.strConcat(We.default.instancePath,o.errorPath))),e.assign(P._`${i}.schemaPath`,P.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(P._`${i}.schema`,r),e.assign(P._`${i}.data`,n)})}kf.extendErrors=Wx;function Sf(e,t){let r=e.const("err",t);e.if(P._`${We.default.vErrors} === null`,()=>e.assign(We.default.vErrors,P._`[${r}]`),P._`${We.default.vErrors}.push(${r})`),e.code(P._`${We.default.errors}++`)}function xf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(P._`new ${e.ValidationError}(${t})`);else r.assign(P._`${n}.errors`,t),r.return(!1)}var $n={keyword:new P.Name("keyword"),schemaPath:new P.Name("schemaPath"),params:new P.Name("params"),propertyName:new P.Name("propertyName"),message:new P.Name("message"),schema:new P.Name("schema"),parentSchema:new P.Name("parentSchema")};function Rf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return P._`{}`;return Yx(e,t,r)}function Yx(e,t,r={}){let{gen:n,it:s}=e,o=[Xx(s,r),Jx(e,r)];return Qx(e,t,o),n.object(...o)}function Xx({errorPath:e},{instancePath:t}){let r=t?P.str`${e}${Nr.getErrorPath(t,Nr.Type.Str)}`:e;return[We.default.instancePath,P.strConcat(We.default.instancePath,r)]}function Jx({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:P.str`${t}/${e}`;if(r)s=P.str`${s}${Nr.getErrorPath(r,Nr.Type.Str)}`;return[$n.schemaPath,s]}function Qx(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||P._`{}`]),c.messages)n.push([$n.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([$n.schema,i],[$n.parentSchema,P._`${d}${l}`],[We.default.data,o]);if(u)n.push([$n.propertyName,u])}});var Cf=g(function(If){Object.defineProperty(If,"__esModule",{value:!0});If.boolOrEmptySchema=If.topBoolOrEmptySchema=void 0;var Of=Ys(),Af=Y(),nR=ht(),sR={message:"boolean schema is false"};function oR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Nf(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(nR.default.data);else t.assign(Af._`${n}.errors`,null),t.return(!0)}If.topBoolOrEmptySchema=oR;function iR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Nf(e);else r.var(t,!0)}If.boolOrEmptySchema=iR;function Nf(e,t){let{gen:r,data:n}=e;Of.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},sR,void 0,t)}});var Xc=g(function(jf){Object.defineProperty(jf,"__esModule",{value:!0});jf.getRules=jf.isJSONType=void 0;var cR=["string","number","integer","boolean","null","object","array"],uR=new Set(cR);function lR(e){return typeof e=="string"&&uR.has(e)}jf.isJSONType=lR;function dR(){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:{}}}jf.getRules=dR});var Jc=g(function(Lf){Object.defineProperty(Lf,"__esModule",{value:!0});Lf.shouldUseRule=Lf.shouldUseGroup=Lf.schemaHasRulesForType=void 0;function pR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Df(e,n)}Lf.schemaHasRulesForType=pR;function Df(e,t){return t.rules.some((r)=>Mf(e,r))}Lf.shouldUseGroup=Df;function Mf(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))}Lf.shouldUseRule=Mf});var Xs=g(function(Hf){Object.defineProperty(Hf,"__esModule",{value:!0});Hf.reportTypeError=Hf.checkDataTypes=Hf.checkDataType=Hf.coerceAndCheckDataType=Hf.getJSONTypes=Hf.getSchemaTypes=Hf.DataType=void 0;var Ff=Xc(),Vf=Jc(),zf=Ys(),x=Y(),ui=te(),Vn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Vn||(Hf.DataType=Vn={}));function gR(e){let t=Gf(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}Hf.getSchemaTypes=gR;function Gf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Ff.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Hf.getJSONTypes=Gf;function yR(e,t){let{gen:r,data:n,opts:s}=e,o=_R(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Vf.schemaHasRulesForType(e,t[0]));if(i){let a=Zc(t,n,s.strictNumbers,Vn.Wrong);r.if(a,()=>{if(o.length)vR(e,t,o);else eu(e)})}return i}Hf.coerceAndCheckDataType=yR;var Kf=new Set(["string","number","integer","boolean","null"]);function _R(e,t){return t?e.filter((r)=>Kf.has(r)||t==="array"&&r==="array"):[]}function vR(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(Zc(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(x._`${a} !== undefined`);for(let u of r)if(Kf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),eu(e),n.endIf(),n.if(x._`${a} !== undefined`,()=>{n.assign(s,a),$R(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
- || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,x._`+${s}`);return;case"integer":n.elseIf(x._`${i} === "boolean" || ${s} === null
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 $R({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Qc(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)}}Hf.checkDataType=Qc;function Zc(e,t,r,n){if(e.length===1)return Qc(e[0],t,r,n);let s,o=ui.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,Qc(i,t,r,n));return s}Hf.checkDataTypes=Zc;var bR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function eu(e){let t=wR(e);zf.reportError(t,bR)}Hf.reportTypeError=eu;function wR(e){let{gen:t,data:r,schema:n}=e,s=ui.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Qf=g(function(Xf){Object.defineProperty(Xf,"__esModule",{value:!0});Xf.assignDefaults=void 0;var mt=Y(),Yf=te();function OR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Wf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Wf(e,o,s.default))}Xf.assignDefaults=OR;function Wf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=mt._`${o}${mt.getProperty(t)}`;if(s){Yf.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=mt._`${a} === undefined`;if(i.useDefaults==="empty")c=mt._`${c} || ${a} === null || ${a} === ""`;n.if(c,mt._`${a} = ${mt.stringify(r)}`)}});var gt=g(function(rp){Object.defineProperty(rp,"__esModule",{value:!0});rp.validateUnion=rp.validateArray=rp.usePattern=rp.callValidateCode=rp.schemaProperties=rp.allSchemaProperties=rp.noPropertyInData=rp.propertyInData=rp.isOwnProperty=rp.hasPropFunc=rp.reportMissingProp=rp.checkMissingProp=rp.checkReportMissingProp=void 0;var V=Y(),zn=te(),Ir=ht(),Zf=te();function AR(e,t){let{gen:r,data:n,it:s}=e;r.if(ru(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}rp.checkReportMissingProp=AR;function NR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(ru(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}rp.checkMissingProp=NR;function IR(e,t){e.setParams({missingProperty:t},!0),e.error()}rp.reportMissingProp=IR;function ep(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}rp.hasPropFunc=ep;function tu(e,t,r){return V._`${ep(e)}.call(${t}, ${r})`}rp.isOwnProperty=tu;function PR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${tu(e,t,r)}`:s}rp.propertyInData=PR;function ru(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(tu(e,t,r))):s}rp.noPropertyInData=ru;function tp(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}rp.allSchemaProperties=tp;function CR(e,t){return tp(t).filter((r)=>!zn.alwaysValidSchema(e,t[r]))}rp.schemaProperties=CR;function jR({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=[[Ir.default.instancePath,V.strConcat(Ir.default.instancePath,o)],[Ir.default.parentData,i.parentData],[Ir.default.parentDataProperty,i.parentDataProperty],[Ir.default.rootData,Ir.default.rootData]];if(i.opts.dynamicRef)l.push([Ir.default.dynamicAnchors,Ir.default.dynamicAnchors]);let p=V._`${d}, ${r.object(...l)}`;return c!==V.nil?V._`${a}.call(${c}, ${p})`:V._`${a}(${p})`}rp.callValidateCode=jR;var qR=V._`new RegExp`;function DR({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"?qR:Zf.useFunc(e,s)}(${r}, ${n})`})}rp.usePattern=DR;function MR(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)})}}rp.validateArray=MR;function LR(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))}rp.validateUnion=LR});var lp=g(function(cp){Object.defineProperty(cp,"__esModule",{value:!0});cp.validateKeywordUsage=cp.validSchemaType=cp.funcKeywordCode=cp.macroKeywordCode=void 0;var le=Y(),bn=ht(),op=gt(),ip=Ys();function QR(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=ap(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))}cp.macroKeywordCode=QR;function ZR(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;tk(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=ap(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)sp(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)sp(e);y(()=>ek(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?bn.default.this:bn.default.self,k=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,le._`${_}${op.callValidateCode(e,d,O,k)}`,t.modifying)}function y(_){var O;n.if(le.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}cp.funcKeywordCode=ZR;function sp(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,le._`${n.parentData}[${n.parentDataProperty}]`))}function ek(e,t){let{gen:r}=e;r.if(le._`Array.isArray(${t})`,()=>{r.assign(bn.default.vErrors,le._`${bn.default.vErrors} === null ? ${t} : ${bn.default.vErrors}.concat(${t})`).assign(bn.default.errors,le._`${bn.default.vErrors}.length`),ip.extendErrors(e)},()=>e.error())}function tk({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ap(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 rk(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")}cp.validSchemaType=rk;function nk({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)}}}cp.validateKeywordUsage=nk});var pp=g(function(dp){Object.defineProperty(dp,"__esModule",{value:!0});dp.extendSubschemaMode=dp.extendSubschemaData=dp.getSubschema=void 0;var je=Y(),li=te();function ak(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}/${li.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')}dp.getSubschema=ak;function ck(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}${li.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]}}dp.extendSubschemaData=ck;function uk(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}dp.extendSubschemaMode=uk});var Js=g(function(lG,hp){hp.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 nu=g(function(dG,mp){var Pr=mp.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(){};di(t,n,s,e,"",e)};Pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pr.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 di(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 Pr.arrayKeywords)for(var p=0;p<l.length;p++)di(e,t,r,l[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in Pr.propsKeywords){if(l&&typeof l=="object")for(var f in l)di(e,t,r,l[f],s+"/"+d+"/"+fk(f),o,s,d,n,f)}else if(d in Pr.keywords||e.allKeys&&!(d in Pr.skipKeywords))di(e,t,r,l,s+"/"+d,o,s,d,n)}r(n,s,o,i,a,c,u)}}function fk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=g(function($p){Object.defineProperty($p,"__esModule",{value:!0});$p.getSchemaRefs=$p.resolveUrl=$p.normalizeId=$p._getFullPath=$p.getFullPath=$p.inlineRef=void 0;var gp=te(),pk=Js(),hk=nu(),mk=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function gk(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!su(e);if(!t)return!1;return yp(e)<=t}$p.inlineRef=gk;var yk=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function su(e){for(let t in e){if(yk.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(su))return!0;if(typeof r=="object"&&su(r))return!0}return!1}function yp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,mk.has(r))continue;if(typeof e[r]=="object")gp.eachItem(e[r],(n)=>t+=yp(n));if(t===1/0)return 1/0}return t}function _p(e,t="",r){if(r!==!1)t=Gn(t);let n=e.parse(t);return vp(e,n)}$p.getFullPath=_p;function vp(e,t){return e.serialize(t).split("#")[0]+"#"}$p._getFullPath=vp;var _k=/#\/?$/;function Gn(e){return e?e.replace(_k,""):""}$p.normalizeId=Gn;function vk(e,t,r){return r=Gn(r),e.resolve(t,r)}$p.resolveUrl=vk;var $k=/^[a-z_][-a-z0-9._]*$/i;function bk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Gn(e[r]||t),o={"":s},i=_p(n,s,!1),a={},c=new Set;return hk(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 _(k){let M=this.opts.uriResolver.resolve;if(k=Gn(y?M(y,k):k),c.has(k))throw d(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,k);else if(k!==Gn(m))if(k[0]==="#")u(l,a[k],k),a[k]=l;else this.refs[k]=m;return k}function O(k){if(typeof k=="string"){if(!$k.test(k))throw Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),a;function u(l,p,f){if(p!==void 0&&!pk(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}$p.getSchemaRefs=bk});var Zs=g(function(qp){Object.defineProperty(qp,"__esModule",{value:!0});qp.getData=qp.KeywordCxt=qp.validateFunctionCode=void 0;var pi=Cf(),fi=Xs(),Hn=Jc(),Cr=Xs(),xp=Qf(),Ut=lp(),Kn=pp(),b=Y(),H=ht(),Rp=Qs(),Me=te(),Lt=Ys();function kk(e){if(Op(e)){if(Ap(e),Tp(e)){Ak(e);return}}kp(e,()=>pi.topBoolOrEmptySchema(e))}qp.validateFunctionCode=kk;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,b._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(b._`"use strict"; ${wp(r,s)}`),Ok(e,s),e.code(o)});else e.func(t,b._`${H.default.data}, ${Tk(s)}`,n.$async,()=>e.code(wp(r,s)).code(o))}function Tk(e){return b._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?b._`, ${H.default.dynamicAnchors}={}`:b.nil}}={}`}function Ok(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,b._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,b._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,b._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,b._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,b._`""`),e.var(H.default.parentData,b._`undefined`),e.var(H.default.parentDataProperty,b._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`{}`)})}function Ak(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{if(r.$comment&&t.$comment)Ip(e);if(jk(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)Nk(e);Np(e),Mk(e)});return}function Nk(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 wp(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function Ik(e,t){if(Op(e)){if(Ap(e),Tp(e)){Pk(e,t);return}}pi.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 Op(e){return typeof e.schema!="boolean"}function Pk(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Ip(e);qk(e),Dk(e);let o=n.const("_errs",H.default.errors);Np(e,o),n.var(t,b._`${o} === ${H.default.errors}`)}function Ap(e){Me.checkUnknownRules(e),Ck(e)}function Np(e,t){if(e.opts.jtd)return Ep(e,[],!1,t);let r=fi.getSchemaTypes(e.schema),n=fi.coerceAndCheckDataType(e,r);Ep(e,r,!n,t)}function Ck(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 jk(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 qk(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function Dk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Ip({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(b._`${H.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._`${H.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function Mk(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(b._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(b._`new ${s}(${H.default.vErrors})`));else{if(t.assign(b._`${n}.errors`,H.default.vErrors),o.unevaluated)Lk(e);t.return(b._`${H.default.errors} === 0`)}}function Lk({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 Ep(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(()=>Cp(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)Uk(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(Cr.checkDataType(p.type,i,c.strictNumbers)),Sp(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Cr.reportTypeError(e);s.endIf()}else Sp(e,p);if(!a)s.if(b._`${H.default.errors} === ${n||0}`)}}function Sp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)xp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Hn.shouldUseRule(n,o))Cp(e,o.keyword,o.definition,t.type)})}function Uk(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Fk(e,t),!e.opts.allowUnionTypes)Vk(e,t);zk(e,e.dataTypes)}function Fk(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Pp(e.dataTypes,r))ou(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Kk(e,t)}function Vk(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))ou(e,"use allowUnionTypes to allow union type keyword")}function zk(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)=>Gk(t,i)))ou(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Gk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Pp(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Kk(e,t){let r=[];for(let n of e.dataTypes)if(Pp(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function ou(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Me.checkStrictMode(e,t,e.opts.strictTypes)}class iu{constructor(e,t,r){if(Ut.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",jp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Ut.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(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?Lt.reportExtraError:Lt.reportError)(this,this.def.error,t)}$dataError(){Lt.reportError(this,this.def.$dataError||Lt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Lt.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._`${Cr.checkDataTypes(a,t,s.opts.strictNumbers,Cr.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=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 Ik(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,b.Name)),!0}}qp.KeywordCxt=iu;function Cp(e,t,r,n){let s=new iu(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Ut.funcKeywordCode(s,r);else if("macro"in r)Ut.macroKeywordCode(s,r);else if(r.compile||r.validate)Ut.funcKeywordCode(s,r)}var Hk=/^\/(?:[^~]|~0|~1)*$/,Bk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!Hk.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=Bk.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(Me.unescapeJsonPointer(u))}`,i=b._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}qp.getData=jp});var hi=g(function(Lp){Object.defineProperty(Lp,"__esModule",{value:!0});class Mp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Lp.default=Mp});var eo=g(function(Fp){Object.defineProperty(Fp,"__esModule",{value:!0});var Bn=Qs();class Up 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))}}Fp.default=Up});var ro=g(function(Gp){Object.defineProperty(Gp,"__esModule",{value:!0});Gp.resolveSchema=Gp.getCompilingSchema=Gp.resolveRef=Gp.compileSchema=Gp.SchemaEnv=void 0;var Re=Y(),Qk=hi(),wn=ht(),ke=Qs(),mi=te(),Vp=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:ke.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={}}}Gp.SchemaEnv=to;function cu(e){let t=zp.call(this,e);if(t)return t;let r=ke.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:Qk.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),Vp.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)}}Gp.compileSchema=cu;function Zk(e,t,r){var n;r=ke.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=rT.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]=eT.call(this,o)}Gp.resolveRef=Zk;function eT(e){if(ke.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:cu.call(this,e)}function zp(e){for(let t of this._compilations)if(tT(t,e))return t}Gp.getCompilingSchema=zp;function tT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function rT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||gi.call(this,e,t)}function gi(e,t){let r=this.opts.uriResolver.parse(t),n=ke._getFullPath(this.opts.uriResolver,r),s=ke.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return au.call(this,r,e);let o=ke.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=gi.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return au.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)cu.call(this,i);if(o===ke.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=ke.resolveUrl(this.opts.uriResolver,s,u);return new to({schema:a,schemaId:c,root:e,baseId:s})}return au.call(this,r,i)}Gp.resolveSchema=gi;var nT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function au(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[mi.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!nT.has(a)&&u)t=ke.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!mi.schemaHasRulesButRef(r,this.RULES)){let a=ke.resolveUrl(this.opts.uriResolver,t,r.$ref);o=gi.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 Hp=g(function(yG,cT){cT.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 lu=g(function(_G,Xp){var uT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wp=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 uu(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 lT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Bp(e){return e.length=0,!0}function dT(e,t,r){if(e.length){let n=uu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function fT(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=dT;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=Bp}else{s.push(u);continue}}if(s.length)if(a===Bp)r.zone=s.join("");else if(i)n.push(s.join(""));else n.push(uu(s));return r.address=n.join(""),r}function Yp(e){if(pT(e,":")<2)return{host:e,isIPV6:!1};let t=fT(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 pT(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function hT(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 mT(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 gT(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(!Wp(r)){let n=Yp(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}Xp.exports={nonSimpleDomain:lT,recomposeAuthority:gT,normalizeComponentEncoding:mT,removeDotSegments:hT,isIPv4:Wp,isUUID:uT,normalizeIPv6:Yp,stringArrayToHexStripped:uu}});var th=g(function(vG,eh){var{isUUID:yT}=lu(),_T=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,vT=["http","https","ws","wss","urn","urn:uuid"];function $T(e){return vT.indexOf(e)!==-1}function du(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 Jp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Qp(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 bT(e){return e.secure=du(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function wT(e){if(e.port===(du(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 ET(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(_T);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=fu(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 ST(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=fu(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 xT(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!yT(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function RT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Zp={scheme:"http",domainHost:!0,parse:Jp,serialize:Qp},kT={scheme:"https",domainHost:Zp.domainHost,parse:Jp,serialize:Qp},yi={scheme:"ws",domainHost:!0,parse:bT,serialize:wT},TT={scheme:"wss",domainHost:yi.domainHost,parse:yi.parse,serialize:yi.serialize},OT={scheme:"urn",parse:ET,serialize:ST,skipNormalize:!0},AT={scheme:"urn:uuid",parse:xT,serialize:RT,skipNormalize:!0},_i={http:Zp,https:kT,ws:yi,wss:TT,urn:OT,"urn:uuid":AT};Object.setPrototypeOf(_i,null);function fu(e){return e&&(_i[e]||_i[e.toLowerCase()])||void 0}eh.exports={wsIsSecure:du,SCHEMES:_i,isValidSchemeName:$T,getSchemeHandler:fu}});var hu=g(function($G,$i){var{normalizeIPv6:NT,removeDotSegments:no,recomposeAuthority:IT,normalizeComponentEncoding:vi,isIPv4:PT,nonSimpleDomain:CT}=lu(),{SCHEMES:jT,getSchemeHandler:rh}=th();function qT(e,t){if(typeof e==="string")e=Ft(yr(e,t),t);else if(typeof e==="object")e=yr(Ft(e,t),t);return e}function DT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=nh(yr(e,n),yr(t,n),n,!0);return n.skipEscape=!0,Ft(s,n)}function nh(e,t,r,n){let s={};if(!n)e=yr(Ft(e,r),r),t=yr(Ft(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 MT(e,t,r){if(typeof e==="string")e=unescape(e),e=Ft(vi(yr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Ft(vi(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Ft(vi(yr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Ft(vi(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Ft(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=rh(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=IT(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 LT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yr(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(LT);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(PT(n.host)===!1){let c=NT(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=rh(r.scheme||n.scheme);if(!r.unicodeSupport&&(!i||!i.unicodeSupport)){if(n.host&&(r.domainHost||i&&i.domainHost)&&s===!1&&CT(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 pu={SCHEMES:jT,normalize:qT,resolve:DT,resolveComponent:nh,equal:MT,serialize:Ft,parse:yr};$i.exports=pu;$i.exports.default=pu;$i.exports.fastUri=pu});var ih=g(function(oh){Object.defineProperty(oh,"__esModule",{value:!0});var sh=hu();sh.code='require("ajv/dist/runtime/uri").default';oh.default=sh});var gh=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 FT=Zs();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return FT.KeywordCxt}});var Yn=Y();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Yn._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Yn.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Yn.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Yn.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Yn.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Yn.CodeGen}});var VT=hi(),dh=eo(),fh=Xc(),Vt=ro(),ph=Y(),zt=Qs(),jr=Xs(),Wn=te(),ah=Hp(),zT=ih(),hh=(e,t)=>new RegExp(e,t);hh.code="new RegExp";var GT=["removeAdditional","useDefaults","coerceTypes"],KT=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),HT={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."},BT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ch=200;function WT(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,k,M,S,Ee,Se,pt,Rt;let lt=e.strict,jt=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=jt===!0||jt===void 0?1:jt||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hh,_c=(s=e.uriResolver)!==null&&s!==void 0?s:zT.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:lt)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:lt)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:lt)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:lt)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:lt)!==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:ch,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:ch,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(Ee=e.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Se=e.validateFormats)!==null&&Se!==void 0?Se:!0,unicodeRegExp:(pt=e.unicodeRegExp)!==null&&pt!==void 0?pt:!0,int32range:(Rt=e.int32range)!==null&&Rt!==void 0?Rt:!0,uriResolver:_c}}class bi{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...WT(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new ph.ValueScope({scope:{},prefixes:KT,es5:t,lines:r}),this.logger=eO(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=fh.getRules(),uh.call(this,HT,e,"NOT SUPPORTED"),uh.call(this,BT,e,"DEPRECATED","warn"),this._metaOpts=QT.call(this),e.formats)XT.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)JT.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);YT.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=ah;if(r==="id")n={...ah},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 dh.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=lh.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Vt.SchemaEnv({schema:{},schemaId:r});if(t=Vt.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=lh.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(rO.call(this,r,t),!t)return Wn.eachItem(r,(s)=>mu.call(this,s)),this;sO.call(this,t);let n={...t,type:jr.getJSONTypes(t.type),schemaType:jr.getJSONTypes(t.schemaType)};return Wn.eachItem(r,n.type.length===0?(s)=>mu.call(this,s,n):(s)=>n.type.forEach((o)=>mu.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]=mh(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 Vt.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 Vt.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{Vt.compileSchema.call(this,e)}finally{this.opts=t}}}bi.ValidationError=VT.default;bi.MissingRefError=dh.default;_r.default=bi;function uh(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 lh(e){return e=zt.normalizeId(e),this.schemas[e]||this.refs[e]}function YT(){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 XT(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function JT(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 QT(){let e={...this.opts};for(let t of GT)delete e[t];return e}var ZT={log(){},warn(){},error(){}};function eO(e){if(e===!1)return ZT;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 tO=/^[a-z_$][a-z0-9_$:-]*$/i;function rO(e,t){let{RULES:r}=this;if(Wn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!tO.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 mu(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:jr.getJSONTypes(t.type),schemaType:jr.getJSONTypes(t.schemaType)}};if(t.before)nO.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 nO(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 sO(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=mh(t);e.validateSchema=this.compile(t,!0)}var oO={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mh(e){return{anyOf:[e,oO]}}});var _h=g(function(yh){Object.defineProperty(yh,"__esModule",{value:!0});var cO={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yh.default=cO});var xi=g(function($h){Object.defineProperty($h,"__esModule",{value:!0});$h.callRef=$h.getValidate=void 0;var lO=eo(),Ei=gt(),he=Y(),Xn=ht(),Si=ro(),qr=te(),dO={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=Si.resolveRef.call(c,u,s,r);if(d===void 0)throw new lO.default(n.opts.uriResolver,s,r);if(d instanceof Si.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return wi(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return wi(e,he._`${h}.validate`,u,u.$async)}function p(h){let m=vh(e,h);wi(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 vh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):he._`${r.scopeValue("wrapper",{ref:t})}.validate`}$h.getValidate=vh;function wi(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 ${Ei.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(Ei.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=qr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",he._`${h}.evaluated.props`);o.props=qr.mergeEvaluated.props(s,_,o.props,he.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=qr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",he._`${h}.evaluated.items`);o.items=qr.mergeEvaluated.items(s,_,o.items,he.Name)}}}$h.callRef=wi;$h.default=dO});var Eh=g(function(wh){Object.defineProperty(wh,"__esModule",{value:!0});var hO=_h(),mO=xi(),gO=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hO.default,mO.default];wh.default=gO});var xh=g(function(Sh){Object.defineProperty(Sh,"__esModule",{value:!0});var Mr=Y(),Dr=Mr.operators,Ri={maximum:{okStr:"<=",ok:Dr.LTE,fail:Dr.GT},minimum:{okStr:">=",ok:Dr.GTE,fail:Dr.LT},exclusiveMaximum:{okStr:"<",ok:Dr.LT,fail:Dr.GTE},exclusiveMinimum:{okStr:">",ok:Dr.GT,fail:Dr.LTE}},_O={message:({keyword:e,schemaCode:t})=>Mr.str`must be ${Ri[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Mr._`{comparison: ${Ri[e].okStr}, limit: ${t}}`},vO={keyword:Object.keys(Ri),type:"number",schemaType:"number",$data:!0,error:_O,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Mr._`${r} ${Ri[t].fail} ${n} || isNaN(${r})`)}};Sh.default=vO});var kh=g(function(Rh){Object.defineProperty(Rh,"__esModule",{value:!0});var Gt=Y(),bO={message:({schemaCode:e})=>Gt.str`must be multiple of ${e}`,params:({schemaCode:e})=>Gt._`{multipleOf: ${e}}`},wO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:bO,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Gt._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Gt._`${i} !== parseInt(${i})`;e.fail$data(Gt._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Rh.default=wO});var Ah=g(function(Oh){Object.defineProperty(Oh,"__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}Oh.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Ph=g(function(Ih){Object.defineProperty(Ih,"__esModule",{value:!0});var rt=Y(),Nh=te(),xO=Ah(),RO={message({keyword:e,schemaCode:t}){return rt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>rt._`{limit: ${e}}`},kO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RO,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?rt.operators.GT:rt.operators.LT,i=s.opts.unicode===!1?rt._`${r}.length`:rt._`${Nh.useFunc(e.gen,xO.default)}(${r})`;e.fail$data(rt._`${i} ${o} ${n}`)}};Ih.default=kO});var qh=g(function(jh){Object.defineProperty(jh,"__esModule",{value:!0});var Ch=gt(),Lr=Y(),OO={message:({schemaCode:e})=>Lr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Lr._`{pattern: ${e}}`},AO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:OO,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?Lr._`(new RegExp(${s}, ${i}))`:Ch.usePattern(e,n);e.fail$data(Lr._`!${a}.test(${t})`)}};jh.default=AO});var Mh=g(function(Dh){Object.defineProperty(Dh,"__esModule",{value:!0});var Kt=Y(),IO={message({keyword:e,schemaCode:t}){return Kt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Kt._`{limit: ${e}}`},PO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:IO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Kt.operators.GT:Kt.operators.LT;e.fail$data(Kt._`Object.keys(${r}).length ${s} ${n}`)}};Dh.default=PO});var Fh=g(function(Uh){Object.defineProperty(Uh,"__esModule",{value:!0});var Ht=gt(),Bt=Y(),Lh=te(),jO={message:({params:{missingProperty:e}})=>Bt.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Bt._`{missingProperty: ${e}}`},qO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jO,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)`;Lh.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(Bt.nil,l);else for(let f of r)Ht.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(Ht.checkMissingProp(e,r,f)),Ht.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Ht.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,Ht.propertyInData(t,s,f,a.ownProperties)),t.if(Bt.not(h),()=>{e.error(),t.break()})},Bt.nil)}}};Uh.default=qO});var zh=g(function(Vh){Object.defineProperty(Vh,"__esModule",{value:!0});var Wt=Y(),MO={message({keyword:e,schemaCode:t}){return Wt.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Wt._`{limit: ${e}}`},LO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Wt.operators.GT:Wt.operators.LT;e.fail$data(Wt._`${r}.length ${s} ${n}`)}};Vh.default=LO});var ki=g(function(Kh){Object.defineProperty(Kh,"__esModule",{value:!0});var Gh=Js();Gh.code='require("ajv/dist/runtime/equal").default';Kh.default=Gh});var Wh=g(function(Bh){Object.defineProperty(Bh,"__esModule",{value:!0});var Jn=Xs(),se=Y(),Hh=te(),VO=ki(),zO={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}}`},GO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:zO,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=Hh.useFunc(t,VO.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(_)})))}}};Bh.default=GO});var Jh=g(function(Xh){Object.defineProperty(Xh,"__esModule",{value:!0});var Qn=Y(),Yh=te(),HO=ki(),BO={message:"must be equal to constant",params:({schemaCode:e})=>Qn._`{allowedValue: ${e}}`},WO={keyword:"const",$data:!0,error:BO,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(Qn._`!${Yh.useFunc(t,HO.default)}(${r}, ${s})`);else e.fail(Qn._`${o} !== ${r}`)}};Xh.default=WO});var em=g(function(Zh){Object.defineProperty(Zh,"__esModule",{value:!0});var Yt=Y(),Qh=te(),XO=ki(),JO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Yt._`{allowedValues: ${e}}`},QO={keyword:"enum",schemaType:"array",$data:!0,error:JO,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=Qh.useFunc(t,XO.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=Yt.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(Yt._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?Yt._`${u()}(${r}, ${f}[${h}])`:Yt._`${r} === ${m}`}}};Zh.default=QO});var rm=g(function(tm){Object.defineProperty(tm,"__esModule",{value:!0});var eA=xh(),tA=kh(),rA=Ph(),nA=qh(),sA=Mh(),oA=Fh(),iA=zh(),aA=Wh(),cA=Jh(),uA=em(),lA=[eA.default,tA.default,rA.default,nA.default,sA.default,oA.default,iA.default,aA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cA.default,uA.default];tm.default=lA});var gu=g(function(sm){Object.defineProperty(sm,"__esModule",{value:!0});sm.validateAdditionalItems=void 0;var nt=Y(),Zn=te(),fA={message:({params:{len:e}})=>nt.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>nt._`{limit: ${e}}`},pA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fA,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}nm(e,n)}};function nm(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",nt._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(nt._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Zn.alwaysValidSchema(i,n)){let u=r.var("valid",nt._`${a} <= ${t.length}`);r.if(nt.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(nt.not(u),()=>r.break())})}}sm.validateAdditionalItems=nm;sm.default=pA});var yu=g(function(cm){Object.defineProperty(cm,"__esModule",{value:!0});cm.validateTuple=void 0;var Ti=Y(),Ur=te(),im=gt(),mA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return am(e,"additionalItems",t);if(r.items=!0,Ur.alwaysValidSchema(r,t))return;e.ok(im.validateArray(e))}};function am(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=Ur.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",Ti._`${o}.length`);r.forEach((l,p)=>{if(Ur.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}"`;Ur.checkStrictMode(a,y,p.strictTuples)}}}cm.validateTuple=am;cm.default=mA});var fm=g(function(dm){Object.defineProperty(dm,"__esModule",{value:!0});var lm=yu(),yA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>lm.validateTuple(e,"items")};dm.default=yA});var ym=g(function(gm){Object.defineProperty(gm,"__esModule",{value:!0});var Oi=Y(),pm=te(),hm=gt(),mm=gu(),vA={message:({params:{len:e}})=>Oi.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oi._`{limit: ${e}}`},$A={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vA,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,pm.alwaysValidSchema(n,t))return;if(s)mm.validateAdditionalItems(e,s);else e.ok(hm.validateArray(e))}};gm.default=$A});var vm=g(function(_m){Object.defineProperty(_m,"__esModule",{value:!0});var _e=Y(),Fr=te(),wA={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}}`},EA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:wA,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){Fr.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Fr.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Fr.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:Fr.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))}}};_m.default=EA});var Ai=g(function(Em){Object.defineProperty(Em,"__esModule",{value:!0});Em.validateSchemaDeps=Em.validatePropertyDeps=Em.error=void 0;var es=Y(),$m=te(),Xt=gt();Em.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},
3
+ var $S=Object.create;var{getPrototypeOf:ES,defineProperty:Yo,getOwnPropertyNames:SS}=Object;var ad=Object.prototype.hasOwnProperty;function xS(e){return this[e]}var RS,kS,vc=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?RS??=new WeakMap:kS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?$S(ES(e)):{};let a=t||!e||!e.__esModule||!ad.call(e,"default")?Yo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let i of SS(e))if(!ad.call(a,i))Yo(a,i,{get:xS.bind(e,i),enumerable:!0})}if(n)s.set(e,a);return a};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var TS=(e)=>e;function AS(e,t){this[e]=TS.bind(null,t)}var j9=(e,t)=>{for(var r in t)Yo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:AS.bind(t,r)})};var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var q9=(e,t,r)=>{for(var n in t)Yo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},D9=import.meta.require;function Xo(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(bc.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(bc.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"&&!OS.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(bc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function wc(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(wc(e,t))throw Error("Cannot use string index")}function cd(e,t,r){if(!$n(e)||typeof t!=="string")return r===void 0?e:r;let n=Xo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if(wc(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 $c(e,t,r){if(!$n(e)||typeof t!=="string")return e;let n=e,s=Xo(t);for(let o=0;o<s.length;o++){let a=s[o];if(id(e,a),o===s.length-1)e[a]=r;else if(!$n(e[a]))e[a]=typeof s[o+1]==="number"?[]:{};e=e[a]}return n}function ud(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(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],!$n(e))return!1}}function ld(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(t);if(r.length===0)return!1;for(let n of r){if(!$n(e)||!(n in e)||wc(e,n))return!1;e=e[n]}return!0}var $n=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},bc,OS;var dd=L(()=>{bc=new Set(["__proto__","prototype","constructor"]),OS=new Set("0123456789")});import Ee from"path";import fd from"os";import Ec from"process";function xc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Ec.platform==="darwin")return NS(e);if(Ec.platform==="win32")return PS(e);return IS(e)}var Tr,Sc,Un,NS=(e)=>{let t=Ee.join(Tr,"Library");return{data:Ee.join(t,"Application Support",e),config:Ee.join(t,"Preferences",e),cache:Ee.join(t,"Caches",e),log:Ee.join(t,"Logs",e),temp:Ee.join(Sc,e)}},PS=(e)=>{let t=Un.APPDATA||Ee.join(Tr,"AppData","Roaming"),r=Un.LOCALAPPDATA||Ee.join(Tr,"AppData","Local");return{data:Ee.join(r,e,"Data"),config:Ee.join(t,e,"Config"),cache:Ee.join(r,e,"Cache"),log:Ee.join(r,e,"Log"),temp:Ee.join(Sc,e)}},IS=(e)=>{let t=Ee.basename(Tr);return{data:Ee.join(Un.XDG_DATA_HOME||Ee.join(Tr,".local","share"),e),config:Ee.join(Un.XDG_CONFIG_HOME||Ee.join(Tr,".config"),e),cache:Ee.join(Un.XDG_CACHE_HOME||Ee.join(Tr,".cache"),e),log:Ee.join(Un.XDG_STATE_HOME||Ee.join(Tr,".local","state"),e),temp:Ee.join(Sc,t,e)}};var pd=L(()=>{Tr=fd.homedir(),Sc=fd.tmpdir(),{env:Un}=Ec});var CS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},jt;var md=L(()=>{jt=CS});var jS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=L(()=>{Rt=jS});var gd=250;var yd=()=>{};var qS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=s.interval??gd,i=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((l)=>{if(!r(l))throw l;if(Date.now()>=i)throw l;let d=Math.round(a*Math.random());if(d>0)return new Promise((f)=>setTimeout(f,d)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},qt;var _d=L(()=>{yd();qt=qS});var DS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=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()>=a)throw u;continue}}}},Dt;var vd=L(()=>{Dt=DS});var Rc=L(()=>{md();hd();_d();vd()});var Gs,kc;var bd=L(()=>{Tc();Gs={isChangeErrorOk:(e)=>{if(!Gs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!wd&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Gs.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(!Gs.isNodeError(e))throw e;if(Gs.isChangeErrorOk(e))return;throw e}},kc=Gs});import $d from"process";var Ks,tt,wd,ze;var Tc=L(()=>{bd();Ks={onError:kc.onChangeError},tt={onError:()=>{return}},wd=$d.getuid?!$d.getuid():!1,ze={isRetriable:kc.isRetriableError}});import ie from"fs";import{promisify as Ge}from"util";var MS,Me;var Ac=L(()=>{Rc();Rc();Tc();MS={attempt:{chmod:jt(Ge(ie.chmod),Ks),chown:jt(Ge(ie.chown),Ks),close:jt(Ge(ie.close),tt),fsync:jt(Ge(ie.fsync),tt),mkdir:jt(Ge(ie.mkdir),tt),realpath:jt(Ge(ie.realpath),tt),stat:jt(Ge(ie.stat),tt),unlink:jt(Ge(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Ks),chownSync:Rt(ie.chownSync,Ks),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:qt(Ge(ie.close),ze),fsync:qt(Ge(ie.fsync),ze),open:qt(Ge(ie.open),ze),readFile:qt(Ge(ie.readFile),ze),rename:qt(Ge(ie.rename),ze),stat:qt(Ge(ie.stat),ze),write:qt(Ge(ie.write),ze),writeFile:qt(Ge(ie.writeFile),ze),closeSync:Dt(ie.closeSync,ze),fsyncSync:Dt(ie.fsyncSync,ze),openSync:Dt(ie.openSync,ze),readFileSync:Dt(ie.readFileSync,ze),renameSync:Dt(ie.renameSync,ze),statSync:Dt(ie.statSync,ze),writeSync:Dt(ie.writeSync,ze),writeFileSync:Dt(ie.writeFileSync,ze)}},Me=MS});import En from"process";var Ed="utf8",Oc=438,Sd=511,xd,Rd,kd,Td=1000,Ad,pz,Nc=128;var Pc=L(()=>{xd={},Rd=En.geteuid?En.geteuid():-1,kd=En.getegid?En.getegid():-1,Ad=!!En.getuid,pz=En.getuid?!En.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Ic=(e)=>typeof e==="string",Jo=(e)=>e===void 0;var Nd=()=>{};var Pd=()=>{};import Id from"process";var Cd,Qo;var Cc=L(()=>{Cd=Id.platform==="linux",Qo=Id.platform==="win32"});var jc,jd;var qd=L(()=>{Cc();jc=["SIGHUP","SIGINT","SIGTERM"];if(!Qo)jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Cd)jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");jd=jc});import Fn from"process";class Dd{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(Qo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Fn.kill(Fn.pid,"SIGTERM");else Fn.kill(Fn.pid,e)},this.hook=()=>{Fn.once("exit",()=>this.exit());for(let e of jd)try{Fn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Md;var Ld=L(()=>{Cc();qd();Md=new Dd});var LS,Ud;var Fd=L(()=>{Ld();LS=Md.register,Ud=LS});import US from"path";var dt,Hs;var Vd=L(()=>{Ac();Fd();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],Me.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],Me.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=US.basename(e);if(t.length<=Nc)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Nc;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ud(dt.purgeSyncAll);Hs=dt});import FS from"path";function qc(e,t,r=xd){if(Ic(r))return qc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,a=null,i=null;try{let c=Me.attempt.realpathSync(e),u=!!c;e=c||e,[a,o]=Hs.get(e,r.tmpCreate||Hs.create,r.tmpPurge!==!1);let l=Ad&&Jo(r.chown),d=Jo(r.mode);if(u&&(l||d)){let m=Me.attempt.statSync(e);if(m){if(r={...r},l)r.chown={uid:m.uid,gid:m.gid};if(d)r.mode=m.mode}}if(!u){let m=FS.dirname(e);Me.attempt.mkdirSync(m,{mode:Sd,recursive:!0})}if(i=Me.retry.openSync(s)(a,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(a);if(Ic(t))Me.retry.writeSync(s)(i,t,0,r.encoding||Ed);else if(!Jo(t))Me.retry.writeSync(s)(i,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Me.retry.fsyncSync(s)(i);else Me.attempt.fsync(i);if(Me.retry.closeSync(s)(i),i=null,r.chown&&(r.chown.uid!==Rd||r.chown.gid!==kd))Me.attempt.chownSync(a,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)Me.attempt.chmodSync(a,r.mode);try{Me.retry.renameSync(s)(a,e)}catch(m){if(!Od(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Me.retry.renameSync(s)(a,Hs.truncate(e))}o(),a=null}finally{if(i)Me.attempt.closeSync(i);if(a)Hs.purge(a)}}var zd=L(()=>{Ac();Pc();Nd();Pd();Vd()});var Ws=g(function(Hd){Object.defineProperty(Hd,"__esModule",{value:!0});Hd.regexpCode=Hd.getEsmExportName=Hd.getProperty=Hd.safeStringify=Hd.stringify=Hd.strConcat=Hd.addCodeArg=Hd.str=Hd._=Hd.nil=Hd._Code=Hd.Name=Hd.IDENTIFIER=Hd._CodeOrName=void 0;class Zo{}Hd._CodeOrName=Zo;Hd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Vn extends Zo{constructor(e){super();if(!Hd.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}}}Hd.Name=Vn;class kt extends Zo{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 Vn)t[r.str]=(t[r.str]||0)+1;return t},{})}}Hd._Code=kt;Hd.nil=new kt("");function Gd(e,...t){let r=[e[0]],n=0;while(n<t.length)Mc(r,t[n]),r.push(e[++n]);return new kt(r)}Hd._=Gd;var Dc=new kt("+");function Kd(e,...t){let r=[Bs(e[0])],n=0;while(n<t.length)r.push(Dc),Mc(r,t[n]),r.push(Dc,Bs(e[++n]));return VS(r),new kt(r)}Hd.str=Kd;function Mc(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof Vn)e.push(t);else e.push(KS(t))}Hd.addCodeArg=Mc;function VS(e){let t=1;while(t<e.length-1){if(e[t]===Dc){let r=zS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function zS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Vn||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 Vn))return`"${e}${t.slice(1)}`;return}function GS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kd`${e}${t}`}Hd.strConcat=GS;function KS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Bs(Array.isArray(e)?e.join(","):e)}function HS(e){return new kt(Bs(e))}Hd.stringify=HS;function Bs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Hd.safeStringify=Bs;function BS(e){return typeof e=="string"&&Hd.IDENTIFIER.test(e)?new kt(`.${e}`):Gd`[${e}]`}Hd.getProperty=BS;function WS(e){if(typeof e=="string"&&Hd.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Hd.getEsmExportName=WS;function YS(e){return new kt(e.toString())}Hd.regexpCode=YS});var Vc=g(function(Xd){Object.defineProperty(Xd,"__esModule",{value:!0});Xd.ValueScope=Xd.ValueScopeName=Xd.Scope=Xd.varKinds=Xd.UsedValueState=void 0;var pe=Ws();class Wd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ta;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ta||(Xd.UsedValueState=ta={}));Xd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Uc{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}}}Xd.Scope=Uc;class Fc 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}]`}}Xd.ValueScopeName=Fc;var cx=pe._`\n`;class Yd extends Uc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?cx:pe.nil}}get(){return this._scope}name(e){return new Fc(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,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[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 a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,ta.Started);let u=t(c);if(u){let l=this.opts.es5?Xd.varKinds.var:Xd.varKinds.const;s=pe._`${s}${l} ${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 Wd(c);i.set(c,ta.Completed)})}return s}}Xd.ValueScope=Yd});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 O=Ws(),Se=Vc(),Ar=Ws();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Ar._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Ar.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Ar.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Ar.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Ar.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Ar.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Ar.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Ar.Name}});var ia=Vc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return ia.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return ia.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return ia.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return ia.varKinds}});rt.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};class Or{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Qd extends Or{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Se.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=Gn(this.rhs,e,t);return this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}}class Kc extends Or{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 O.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Gn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return aa(e,this.rhs)}}class Zd extends Kc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ef extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class tf extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class rf extends Or{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class nf extends Or{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=Gn(this.code,e,t),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}}class ca extends Or{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;fx(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Sn(e,t.names),{})}}class Nr extends ca{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class sf extends ca{}class Ys extends Nr{}Ys.kind="else";class gr extends Nr{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 Ys(r):r}if(t){if(e===!1)return t instanceof gr?t:t.nodes;if(this.nodes.length)return this;return new gr(lf(e),t instanceof gr?[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=Gn(this.condition,e,t),this}get names(){let e=super.names;if(aa(e,this.condition),this.else)Sn(e,this.else.names);return e}}gr.kind="if";class zn extends Nr{}zn.kind="for";class of extends zn{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=Gn(this.iteration,e,t),this}get names(){return Sn(super.names,this.iteration.names)}}class af extends zn{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Se.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=aa(super.names,this.from);return aa(e,this.to)}}class zc extends zn{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=Gn(this.iterable,e,t),this}get names(){return Sn(super.names,this.iterable.names)}}class ra extends Nr{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)}}ra.kind="func";class na extends ca{render(e){return"return "+super.render(e)}}na.kind="return";class cf extends Nr{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)Sn(e,this.catch.names);if(this.finally)Sn(e,this.finally.names);return e}}class sa extends Nr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}sa.kind="catch";class oa extends Nr{render(e){return"finally"+super.render(e)}}oa.kind="finally";class uf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
4
+ `:""},this._extScope=e,this._scope=new Se.Scope({parent:e}),this._nodes=[new sf]}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 Qd(e,s,r)),s}const(e,t,r){return this._def(Se.varKinds.const,e,t,r)}let(e,t,r){return this._def(Se.varKinds.let,e,t,r)}var(e,t,r){return this._def(Se.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Kc(e,t,r))}add(e,t){return this._leafNode(new Zd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==O.nil)this._leafNode(new nf(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(":"),O.addCodeArg(t,n)}return t.push("}"),new O._Code(t)}if(e,t,r){if(this._blockNode(new gr(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 gr(e))}else(){return this._elseNode(new Ys)}endIf(){return this._endBlockNode(gr,Ys)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new of(e),t)}forRange(e,t,r,n,s=this.opts.es5?Se.varKinds.var:Se.varKinds.let){let o=this._scope.toName(e);return this._for(new af(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Se.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof O.Name?t:this.var("_arr",t);return this.forRange("_i",0,O._`${o}.length`,(a)=>{this.var(s,O._`${o}[${a}]`),r(s)})}return this._for(new zc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Se.varKinds.var:Se.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,O._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new zc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(zn)}label(e){return this._leafNode(new ef(e))}break(e){return this._leafNode(new tf(e))}return(e){let t=new na;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(na)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new cf;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new sa(s),t(s)}if(r)this._currNode=n.finally=new oa,this.code(r);return this._endBlockNode(sa,oa)}throw(e){return this._leafNode(new rf(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=O.nil,r,n){if(this._blockNode(new ra(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ra)}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 gr))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=uf;function Sn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function aa(e,t){return t instanceof O._CodeOrName?Sn(e,t.names):e}function Gn(e,t,r){if(e instanceof O.Name)return n(e);if(!s(e))return e;return new O._Code(e._items.reduce((o,a)=>{if(a instanceof O.Name)a=n(a);if(a instanceof O._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof O._Code&&o._items.some((a)=>a instanceof O.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function fx(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:O._`!${Gc(e)}`}rt.not=lf;var px=df(rt.operators.AND);function mx(...e){return e.reduce(px)}rt.and=mx;var hx=df(rt.operators.OR);function gx(...e){return e.reduce(hx)}rt.or=gx;function df(e){return(t,r)=>t===O.nil?r:r===O.nil?t:O._`${Gc(t)} ${e} ${Gc(r)}`}function Gc(e){return e instanceof O.Name?e:O._`(${e})`}});var re=g(function(wf){Object.defineProperty(wf,"__esModule",{value:!0});wf.checkStrictMode=wf.getErrorPath=wf.Type=wf.useFunc=wf.setEvaluated=wf.evaluatedPropsToName=wf.mergeEvaluated=wf.eachItem=wf.unescapeJsonPointer=wf.escapeJsonPointer=wf.escapeFragment=wf.unescapeFragment=wf.schemaRefOrVal=wf.schemaHasRulesButRef=wf.schemaHasRules=wf.checkUnknownRules=wf.alwaysValidSchema=wf.toHash=void 0;var U=Y(),hf=Ws();function bx(e){let t={};for(let r of e)t[r]=!0;return t}wf.toHash=bx;function wx(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return gf(e,t),!yf(t,e.self.RULES.all)}wf.alwaysValidSchema=wx;function gf(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])bf(e,`unknown keyword: "${o}"`)}wf.checkUnknownRules=gf;function yf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}wf.schemaHasRules=yf;function $x(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}wf.schemaHasRulesButRef=$x;function Ex({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)}`}wf.schemaRefOrVal=Ex;function Sx(e){return _f(decodeURIComponent(e))}wf.unescapeFragment=Sx;function xx(e){return encodeURIComponent(Bc(e))}wf.escapeFragment=xx;function Bc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}wf.escapeJsonPointer=Bc;function _f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}wf.unescapeJsonPointer=_f;function Rx(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}wf.eachItem=Rx;function pf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof U.Name?(o instanceof U.Name?e(s,o,a):t(s,o,a),a):o instanceof U.Name?(t(s,a,o),o):r(o,a);return i===U.Name&&!(c instanceof U.Name)?n(s,c):c}}wf.mergeEvaluated={props:pf({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} || {}`),Wc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vf}),items:pf({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 vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Wc(e,r,t);return r}wf.evaluatedPropsToName=vf;function Wc(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}wf.setEvaluated=Wc;var mf={};function kx(e,t){return e.scopeValue("func",{ref:t,code:mf[t.code]||(mf[t.code]=new hf._Code(t.code))})}wf.useFunc=kx;var Hc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Hc||(wf.Type=Hc={}));function Tx(e,t,r){if(e instanceof U.Name){let n=t===Hc.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():"/"+Bc(e)}wf.getErrorPath=Tx;function bf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}wf.checkStrictMode=bf});var pt=g(function(Ef){Object.defineProperty(Ef,"__esModule",{value:!0});var ue=Y(),Hx={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")};Ef.default=Hx});var Xs=g(function(kf){Object.defineProperty(kf,"__esModule",{value:!0});kf.extendErrors=kf.resetErrorsCount=kf.reportExtraError=kf.reportError=kf.keyword$DataError=kf.keywordError=void 0;var I=Y(),Pr=re(),Xe=pt();kf.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};kf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function Wx(e,t=kf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Rf(e,t,r);if(n!==null&&n!==void 0?n:a||i)Sf(o,c);else xf(s,I._`[${c}]`)}kf.reportError=Wx;function Yx(e,t=kf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Rf(e,t,r);if(Sf(s,i),!(o||a))xf(n,Xe.default.vErrors)}kf.reportExtraError=Yx;function Xx(e,t){e.assign(Xe.default.errors,t),e.if(I._`${Xe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${Xe.default.vErrors}.length`,t),()=>e.assign(Xe.default.vErrors,null)))}kf.resetErrorsCount=Xx;function Jx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Xe.default.errors,(i)=>{if(e.const(a,I._`${Xe.default.vErrors}[${i}]`),e.if(I._`${a}.instancePath === undefined`,()=>e.assign(I._`${a}.instancePath`,I.strConcat(Xe.default.instancePath,o.errorPath))),e.assign(I._`${a}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${a}.schema`,r),e.assign(I._`${a}.data`,n)})}kf.extendErrors=Jx;function Sf(e,t){let r=e.const("err",t);e.if(I._`${Xe.default.vErrors} === null`,()=>e.assign(Xe.default.vErrors,I._`[${r}]`),I._`${Xe.default.vErrors}.push(${r})`),e.code(I._`${Xe.default.errors}++`)}function xf(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 xn={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 Rf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return Qx(e,t,r)}function Qx(e,t,r={}){let{gen:n,it:s}=e,o=[Zx(s,r),eR(e,r)];return tR(e,t,o),n.object(...o)}function Zx({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Pr.getErrorPath(t,Pr.Type.Str)}`:e;return[Xe.default.instancePath,I.strConcat(Xe.default.instancePath,r)]}function eR({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Pr.getErrorPath(r,Pr.Type.Str)}`;return[xn.schemaPath,s]}function tR(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([xn.keyword,s],[xn.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([xn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([xn.schema,a],[xn.parentSchema,I._`${l}${d}`],[Xe.default.data,o]);if(u)n.push([xn.propertyName,u])}});var Cf=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var Af=Xs(),Of=Y(),aR=pt(),iR={message:"boolean schema is false"};function cR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Nf(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(aR.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=cR;function uR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Nf(e);else r.var(t,!0)}Pf.boolOrEmptySchema=uR;function Nf(e,t){let{gen:r,data:n}=e;Af.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},iR,void 0,t)}});var Xc=g(function(jf){Object.defineProperty(jf,"__esModule",{value:!0});jf.getRules=jf.isJSONType=void 0;var dR=["string","number","integer","boolean","null","object","array"],fR=new Set(dR);function pR(e){return typeof e=="string"&&fR.has(e)}jf.isJSONType=pR;function mR(){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:{}}}jf.getRules=mR});var Jc=g(function(Lf){Object.defineProperty(Lf,"__esModule",{value:!0});Lf.shouldUseRule=Lf.shouldUseGroup=Lf.schemaHasRulesForType=void 0;function gR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Df(e,n)}Lf.schemaHasRulesForType=gR;function Df(e,t){return t.rules.some((r)=>Mf(e,r))}Lf.shouldUseGroup=Df;function Mf(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))}Lf.shouldUseRule=Mf});var Js=g(function(Hf){Object.defineProperty(Hf,"__esModule",{value:!0});Hf.reportTypeError=Hf.checkDataTypes=Hf.checkDataType=Hf.coerceAndCheckDataType=Hf.getJSONTypes=Hf.getSchemaTypes=Hf.DataType=void 0;var Ff=Xc(),Vf=Jc(),zf=Xs(),x=Y(),la=re(),Kn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Kn||(Hf.DataType=Kn={}));function vR(e){let t=Gf(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}Hf.getSchemaTypes=vR;function Gf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Ff.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Hf.getJSONTypes=Gf;function bR(e,t){let{gen:r,data:n,opts:s}=e,o=wR(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&Vf.schemaHasRulesForType(e,t[0]));if(a){let i=Zc(t,n,s.strictNumbers,Kn.Wrong);r.if(i,()=>{if(o.length)$R(e,t,o);else eu(e)})}return a}Hf.coerceAndCheckDataType=bR;var Kf=new Set(["string","number","integer","boolean","null"]);function wR(e,t){return t?e.filter((r)=>Kf.has(r)||t==="array"&&r==="array"):[]}function $R(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",x._`typeof ${s}`),i=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(a,x._`typeof ${s}`).if(Zc(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(x._`${i} !== undefined`);for(let u of r)if(Kf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),eu(e),n.endIf(),n.if(x._`${i} !== undefined`,()=>{n.assign(s,i),ER(e,i)});function c(u){switch(u){case"string":n.elseIf(x._`${a} == "number" || ${a} == "boolean"`).assign(i,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(i,x._`""`);return;case"number":n.elseIf(x._`${a} == "boolean" || ${s} === null
5
+ || (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,x._`+${s}`);return;case"integer":n.elseIf(x._`${a} === "boolean" || ${s} === null
6
+ || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,x._`+${s}`);return;case"boolean":n.elseIf(x._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf(x._`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf(x._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf(x._`${a} === "string" || ${a} === "number"
7
+ || ${a} === "boolean" || ${s} === null`).assign(i,x._`[${s}]`)}}}function ER({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Qc(e,t,r,n=Kn.Correct){let s=n===Kn.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=a(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Kn.Correct?o:x.not(o);function a(i=x.nil){return x.and(x._`typeof ${t} == "number"`,i,r?x._`isFinite(${t})`:x.nil)}}Hf.checkDataType=Qc;function Zc(e,t,r,n){if(e.length===1)return Qc(e[0],t,r,n);let s,o=la.toHash(e);if(o.array&&o.object){let a=x._`typeof ${t} != "object"`;s=o.null?a:x._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let a in o)s=x.and(s,Qc(a,t,r,n));return s}Hf.checkDataTypes=Zc;var SR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function eu(e){let t=xR(e);zf.reportError(t,SR)}Hf.reportTypeError=eu;function xR(e){let{gen:t,data:r,schema:n}=e,s=la.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Qf=g(function(Xf){Object.defineProperty(Xf,"__esModule",{value:!0});Xf.assignDefaults=void 0;var mt=Y(),Yf=re();function PR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Wf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Wf(e,o,s.default))}Xf.assignDefaults=PR;function Wf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=mt._`${o}${mt.getProperty(t)}`;if(s){Yf.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=mt._`${i} === undefined`;if(a.useDefaults==="empty")c=mt._`${c} || ${i} === null || ${i} === ""`;n.if(c,mt._`${i} = ${mt.stringify(r)}`)}});var ht=g(function(rp){Object.defineProperty(rp,"__esModule",{value:!0});rp.validateUnion=rp.validateArray=rp.usePattern=rp.callValidateCode=rp.schemaProperties=rp.allSchemaProperties=rp.noPropertyInData=rp.propertyInData=rp.isOwnProperty=rp.hasPropFunc=rp.reportMissingProp=rp.checkMissingProp=rp.checkReportMissingProp=void 0;var V=Y(),Hn=re(),Ir=pt(),Zf=re();function IR(e,t){let{gen:r,data:n,it:s}=e;r.if(ru(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}rp.checkReportMissingProp=IR;function CR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(ru(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}rp.checkMissingProp=CR;function jR(e,t){e.setParams({missingProperty:t},!0),e.error()}rp.reportMissingProp=jR;function ep(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}rp.hasPropFunc=ep;function tu(e,t,r){return V._`${ep(e)}.call(${t}, ${r})`}rp.isOwnProperty=tu;function qR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${tu(e,t,r)}`:s}rp.propertyInData=qR;function ru(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(tu(e,t,r))):s}rp.noPropertyInData=ru;function tp(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}rp.allSchemaProperties=tp;function DR(e,t){return tp(t).filter((r)=>!Hn.alwaysValidSchema(e,t[r]))}rp.schemaProperties=DR;function MR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?V._`${e}, ${t}, ${n}${s}`:t,d=[[Ir.default.instancePath,V.strConcat(Ir.default.instancePath,o)],[Ir.default.parentData,a.parentData],[Ir.default.parentDataProperty,a.parentDataProperty],[Ir.default.rootData,Ir.default.rootData]];if(a.opts.dynamicRef)d.push([Ir.default.dynamicAnchors,Ir.default.dynamicAnchors]);let m=V._`${l}, ${r.object(...d)}`;return c!==V.nil?V._`${i}.call(${c}, ${m})`:V._`${i}(${m})`}rp.callValidateCode=MR;var LR=V._`new RegExp`;function UR({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"?LR:Zf.useFunc(e,s)}(${r}, ${n})`})}rp.usePattern=UR;function FR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:Hn.Type.Num},o),t.if(V.not(o),i)})}}rp.validateArray=FR;function VR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>Hn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,V._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(V.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}rp.validateUnion=VR});var lp=g(function(cp){Object.defineProperty(cp,"__esModule",{value:!0});cp.validateKeywordUsage=cp.validSchemaType=cp.funcKeywordCode=cp.macroKeywordCode=void 0;var de=Y(),Rn=pt(),op=ht(),ap=Xs();function tk(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=ip(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:de.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}cp.macroKeywordCode=tk;function rk(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;sk(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=ip(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)sp(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)sp(e);y(()=>nk(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(de._`await `),(A)=>n.assign(d,!1).if(de._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,de._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=de._`${l}.errors`;return n.assign(v,null),h(de.nil),v}function h(v=t.async?de._`await `:de.nil){let A=c.opts.passContext?Rn.default.this:Rn.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,de._`${v}${op.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(de.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}cp.funcKeywordCode=rk;function sp(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function nk(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(Rn.default.vErrors,de._`${Rn.default.vErrors} === null ? ${t} : ${Rn.default.vErrors}.concat(${t})`).assign(Rn.default.errors,de._`${Rn.default.vErrors}.length`),ap.extendErrors(e)},()=>e.error())}function sk({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:de.stringify(r)})}function ok(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")}cp.validSchemaType=ok;function ak({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 a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.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)}}}cp.validateKeywordUsage=ak});var pp=g(function(dp){Object.defineProperty(dp,"__esModule",{value:!0});dp.extendSubschemaMode=dp.extendSubschemaData=dp.getSubschema=void 0;var qe=Y(),da=re();function lk(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${da.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}dp.getSubschema=lk;function dk(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(m),e.errorPath=qe.str`${u}${da.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}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]}}dp.extendSubschemaData=dk;function fk(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}dp.extendSubschemaMode=fk});var Qs=g(function(g4,mp){mp.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 a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var nu=g(function(y4,hp){var Cr=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(){};fa(t,n,s,e,"",e)};Cr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Cr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Cr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Cr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function fa(e,t,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Cr.arrayKeywords)for(var m=0;m<d.length;m++)fa(e,t,r,d[m],s+"/"+l+"/"+m,o,s,l,n,m)}else if(l in Cr.propsKeywords){if(d&&typeof d=="object")for(var f in d)fa(e,t,r,d[f],s+"/"+l+"/"+hk(f),o,s,l,n,f)}else if(l in Cr.keywords||e.allKeys&&!(l in Cr.skipKeywords))fa(e,t,r,d,s+"/"+l,o,s,l,n)}r(n,s,o,a,i,c,u)}}function hk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Zs=g(function(bp){Object.defineProperty(bp,"__esModule",{value:!0});bp.getSchemaRefs=bp.resolveUrl=bp.normalizeId=bp._getFullPath=bp.getFullPath=bp.inlineRef=void 0;var gp=re(),gk=Qs(),yk=nu(),_k=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vk(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!su(e);if(!t)return!1;return yp(e)<=t}bp.inlineRef=vk;var bk=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function su(e){for(let t in e){if(bk.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(su))return!0;if(typeof r=="object"&&su(r))return!0}return!1}function yp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,_k.has(r))continue;if(typeof e[r]=="object")gp.eachItem(e[r],(n)=>t+=yp(n));if(t===1/0)return 1/0}return t}function _p(e,t="",r){if(r!==!1)t=Bn(t);let n=e.parse(t);return vp(e,n)}bp.getFullPath=_p;function vp(e,t){return e.serialize(t).split("#")[0]+"#"}bp._getFullPath=vp;var wk=/#\/?$/;function Bn(e){return e?e.replace(wk,""):""}bp.normalizeId=Bn;function $k(e,t,r){return r=Bn(r),e.resolve(t,r)}bp.resolveUrl=$k;var Ek=/^[a-z_][-a-z0-9._]*$/i;function Sk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Bn(e[r]||t),o={"":s},a=_p(n,s,!1),i={},c=new Set;return yk(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=Bn(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==Bn(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!Ek.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!gk(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}bp.getSchemaRefs=Sk});var eo=g(function(qp){Object.defineProperty(qp,"__esModule",{value:!0});qp.getData=qp.KeywordCxt=qp.validateFunctionCode=void 0;var ma=Cf(),pa=Js(),Yn=Jc(),jr=Js(),xp=Qf(),Lt=lp(),Wn=pp(),b=Y(),H=pt(),Rp=Zs(),Le=re(),Mt=Xs();function Ok(e){if(Ap(e)){if(Op(e),Tp(e)){Ik(e);return}}kp(e,()=>ma.topBoolOrEmptySchema(e))}qp.validateFunctionCode=Ok;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,b._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(b._`"use strict"; ${$p(r,s)}`),Pk(e,s),e.code(o)});else e.func(t,b._`${H.default.data}, ${Nk(s)}`,n.$async,()=>e.code($p(r,s)).code(o))}function Nk(e){return b._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?b._`, ${H.default.dynamicAnchors}={}`:b.nil}}={}`}function Pk(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,b._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,b._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,b._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,b._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,b._`""`),e.var(H.default.parentData,b._`undefined`),e.var(H.default.parentDataProperty,b._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`{}`)})}function Ik(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(Mk(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)Ck(e);Np(e),Fk(e)});return}function Ck(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 $p(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function jk(e,t){if(Ap(e)){if(Op(e),Tp(e)){qk(e,t);return}}ma.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 Ap(e){return typeof e.schema!="boolean"}function qk(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);Lk(e),Uk(e);let o=n.const("_errs",H.default.errors);Np(e,o),n.var(t,b._`${o} === ${H.default.errors}`)}function Op(e){Le.checkUnknownRules(e),Dk(e)}function Np(e,t){if(e.opts.jtd)return Ep(e,[],!1,t);let r=pa.getSchemaTypes(e.schema),n=pa.coerceAndCheckDataType(e,r);Ep(e,r,!n,t)}function Dk(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 Mk(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 Lk(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function Uk(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(b._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=b.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(b._`${H.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function Fk(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(b._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(b._`new ${s}(${H.default.vErrors})`));else{if(t.assign(b._`${n}.errors`,H.default.vErrors),o.unevaluated)Vk(e);t.return(b._`${H.default.errors} === 0`)}}function Vk({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 Ep(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,l))){s.block(()=>Cp(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)zk(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!Yn.shouldUseGroup(o,m))return;if(m.type){if(s.if(jr.checkDataType(m.type,a,c.strictNumbers)),Sp(e,m),t.length===1&&t[0]===m.type&&r)s.else(),jr.reportTypeError(e);s.endIf()}else Sp(e,m);if(!i)s.if(b._`${H.default.errors} === ${n||0}`)}}function Sp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)xp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Yn.shouldUseRule(n,o))Cp(e,o.keyword,o.definition,t.type)})}function zk(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Gk(e,t),!e.opts.allowUnionTypes)Kk(e,t);Hk(e,e.dataTypes)}function Gk(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Ip(e.dataTypes,r))ou(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Wk(e,t)}function Kk(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))ou(e,"use allowUnionTypes to allow union type keyword")}function Hk(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Yn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>Bk(t,a)))ou(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Bk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Ip(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Wk(e,t){let r=[];for(let n of e.dataTypes)if(Ip(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function ou(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class au{constructor(e,t,r){if(Lt.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",jp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Lt.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(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?Mt.reportExtraError:Mt.reportError)(this,this.def.error,t)}$dataError(){Mt.reportError(this,this.def.$dataError||Mt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Mt.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(),a());function o(){if(r.length){if(!(t instanceof b.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return b._`${jr.checkDataTypes(i,t,s.opts.strictNumbers,jr.DataType.Wrong)}`}return b.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return b._`!${i}(${t})`}return b.nil}}subschema(e,t){let r=Wn.getSubschema(this.it,e);Wn.extendSubschemaData(r,this.it,e),Wn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return jk(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}}qp.KeywordCxt=au;function Cp(e,t,r,n){let s=new au(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Lt.funcKeywordCode(s,r);else if("macro"in r)Lt.macroKeywordCode(s,r);else if(r.compile||r.validate)Lt.funcKeywordCode(s,r)}var Yk=/^\/(?:[^~]|~0|~1)*$/,Xk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!Yk.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=Xk.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=b._`${o}${b.getProperty(Le.unescapeJsonPointer(u))}`,a=b._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}qp.getData=jp});var ha=g(function(Lp){Object.defineProperty(Lp,"__esModule",{value:!0});class Mp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Lp.default=Mp});var to=g(function(Fp){Object.defineProperty(Fp,"__esModule",{value:!0});var Xn=Zs();class Up extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Xn.resolveUrl(e,t,r),this.missingSchema=Xn.normalizeId(Xn.getFullPath(e,this.missingRef))}}Fp.default=Up});var no=g(function(Gp){Object.defineProperty(Gp,"__esModule",{value:!0});Gp.resolveSchema=Gp.getCompilingSchema=Gp.resolveRef=Gp.compileSchema=Gp.SchemaEnv=void 0;var xe=Y(),tT=ha(),kn=pt(),Re=Zs(),ga=re(),Vp=eo();class ro{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:Re.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={}}}Gp.SchemaEnv=ro;function cu(e){let t=zp.call(this,e);if(t)return t;let r=Re.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new xe.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:tT.default,code:xe._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:kn.default.data,parentData:kn.default.parentData,parentDataProperty:kn.default.parentDataProperty,dataNames:[kn.default.data],dataPathArr:[xe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:xe.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:xe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:xe._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),Vp.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(kn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${kn.default.self}`,`${kn.default.scope}`,l)(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:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof xe.Name?void 0:p,items:h instanceof xe.Name?void 0:h,dynamicProps:p instanceof xe.Name,dynamicItems:h instanceof xe.Name},f.source)f.source.evaluated=xe.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}Gp.compileSchema=cu;function rT(e,t,r){var n;r=Re.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=oT.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ro({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=nT.call(this,o)}Gp.resolveRef=rT;function nT(e){if(Re.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:cu.call(this,e)}function zp(e){for(let t of this._compilations)if(sT(t,e))return t}Gp.getCompilingSchema=zp;function sT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function oT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ya.call(this,e,t)}function ya(e,t){let r=this.opts.uriResolver.parse(t),n=Re._getFullPath(this.opts.uriResolver,r),s=Re.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=Re.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ya.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return iu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)cu.call(this,a);if(o===Re.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Re.resolveUrl(this.opts.uriResolver,s,u);return new ro({schema:i,schemaId:c,root:e,baseId:s})}return iu.call(this,r,a)}Gp.resolveSchema=ya;var aT=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 i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ga.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!aT.has(i)&&u)t=Re.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ga.schemaHasRulesButRef(r,this.RULES)){let i=Re.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ya.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ro({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Hp=g(function(E4,dT){dT.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 lu=g(function(S4,Xp){var fT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wp=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 uu(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 pT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Bp(e){return e.length=0,!0}function mT(e,t,r){if(e.length){let n=uu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function hT(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,a=!1,i=mT;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)a=!0;if(!i(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(!i(s,n,r))break;i=Bp}else{s.push(u);continue}}if(s.length)if(i===Bp)r.zone=s.join("");else if(a)n.push(s.join(""));else n.push(uu(s));return r.address=n.join(""),r}function Yp(e){if(gT(e,":")<2)return{host:e,isIPV6:!1};let t=hT(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 gT(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function yT(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 _T(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 vT(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(!Wp(r)){let n=Yp(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}Xp.exports={nonSimpleDomain:pT,recomposeAuthority:vT,normalizeComponentEncoding:_T,removeDotSegments:yT,isIPv4:Wp,isUUID:fT,normalizeIPv6:Yp,stringArrayToHexStripped:uu}});var tm=g(function(x4,em){var{isUUID:bT}=lu(),wT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,$T=["http","https","ws","wss","urn","urn:uuid"];function ET(e){return $T.indexOf(e)!==-1}function du(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 Jp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Qp(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 ST(e){return e.secure=du(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function xT(e){if(e.port===(du(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 RT(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(wT);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=fu(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 kT(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=fu(s);if(o)e=o.serialize(e,t);let a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function TT(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!bT(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function AT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Zp={scheme:"http",domainHost:!0,parse:Jp,serialize:Qp},OT={scheme:"https",domainHost:Zp.domainHost,parse:Jp,serialize:Qp},_a={scheme:"ws",domainHost:!0,parse:ST,serialize:xT},NT={scheme:"wss",domainHost:_a.domainHost,parse:_a.parse,serialize:_a.serialize},PT={scheme:"urn",parse:RT,serialize:kT,skipNormalize:!0},IT={scheme:"urn:uuid",parse:TT,serialize:AT,skipNormalize:!0},va={http:Zp,https:OT,ws:_a,wss:NT,urn:PT,"urn:uuid":IT};Object.setPrototypeOf(va,null);function fu(e){return e&&(va[e]||va[e.toLowerCase()])||void 0}em.exports={wsIsSecure:du,SCHEMES:va,isValidSchemeName:ET,getSchemeHandler:fu}});var mu=g(function(R4,wa){var{normalizeIPv6:CT,removeDotSegments:so,recomposeAuthority:jT,normalizeComponentEncoding:ba,isIPv4:qT,nonSimpleDomain:DT}=lu(),{SCHEMES:MT,getSchemeHandler:rm}=tm();function LT(e,t){if(typeof e==="string")e=Ut(yr(e,t),t);else if(typeof e==="object")e=yr(Ut(e,t),t);return e}function UT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=nm(yr(e,n),yr(t,n),n,!0);return n.skipEscape=!0,Ut(s,n)}function nm(e,t,r,n){let s={};if(!n)e=yr(Ut(e,r),r),t=yr(Ut(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=so(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=so(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=so(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=so(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 FT(e,t,r){if(typeof e==="string")e=unescape(e),e=Ut(ba(yr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Ut(ba(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Ut(ba(yr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Ut(ba(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Ut(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=rm(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 a=jT(r);if(a!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(a),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let i=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))i=so(i);if(a===void 0&&i[0]==="/"&&i[1]==="/")i="/%2F"+i.slice(2);s.push(i)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var VT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yr(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(VT);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(qT(n.host)===!1){let c=CT(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 a=rm(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)){if(n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&DT(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}}if(!a||a&&!a.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(a&&a.parse)a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var pu={SCHEMES:MT,normalize:LT,resolve:UT,resolveComponent:nm,equal:FT,serialize:Ut,parse:yr};wa.exports=pu;wa.exports.default=pu;wa.exports.fastUri=pu});var am=g(function(om){Object.defineProperty(om,"__esModule",{value:!0});var sm=mu();sm.code='require("ajv/dist/runtime/uri").default';om.default=sm});var gm=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 GT=eo();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return GT.KeywordCxt}});var Qn=Y();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Qn._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Qn.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Qn.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Qn.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Qn.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Qn.CodeGen}});var KT=ha(),dm=to(),fm=Xc(),Ft=no(),pm=Y(),Vt=Zs(),qr=Js(),Jn=re(),im=Hp(),HT=am(),mm=(e,t)=>new RegExp(e,t);mm.code="new RegExp";var BT=["removeAdditional","useDefaults","coerceTypes"],WT=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),YT={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."},XT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},cm=200;function JT(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,Ct;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:mm,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:HT.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:cm,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:cm,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!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:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(Ct=e.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Ln}}class $a{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...JT(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new pm.ValueScope({scope:{},prefixes:WT,es5:t,lines:r}),this.logger=nA(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=fm.getRules(),um.call(this,YT,e,"NOT SUPPORTED"),um.call(this,XT,e,"DEPRECATED","warn"),this._metaOpts=tA.call(this),e.formats)ZT.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)eA.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);QT.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=im;if(r==="id")n={...im},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,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}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(l){if(!(l instanceof dm.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;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=Vt.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=lm.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ft.SchemaEnv({schema:{},schemaId:r});if(t=Ft.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=lm.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=Vt.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(oA.call(this,r,t),!t)return Jn.eachItem(r,(s)=>hu.call(this,s)),this;iA.call(this,t);let n={...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)};return Jn.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 a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=hm(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:a}=this.opts;if(typeof e=="object")o=e[a];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 i=this._cache.get(e);if(i!==void 0)return i;r=Vt.normalizeId(o||r);let c=Vt.getSchemaRefs.call(this,e,r);if(i=new Ft.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_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 Ft.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{Ft.compileSchema.call(this,e)}finally{this.opts=t}}}$a.ValidationError=KT.default;$a.MissingRefError=dm.default;_r.default=$a;function um(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 lm(e){return e=Vt.normalizeId(e),this.schemas[e]||this.refs[e]}function QT(){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 ZT(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function eA(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 tA(){let e={...this.opts};for(let t of BT)delete e[t];return e}var rA={log(){},warn(){},error(){}};function nA(e){if(e===!1)return rA;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 sA=/^[a-z_$][a-z0-9_$:-]*$/i;function oA(e,t){let{RULES:r}=this;if(Jn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!sA.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,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)}};if(t.before)aA.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function aA(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 iA(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hm(t);e.validateSchema=this.compile(t,!0)}var cA={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hm(e){return{anyOf:[e,cA]}}});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var dA={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ym.default=dA});var Ra=g(function(bm){Object.defineProperty(bm,"__esModule",{value:!0});bm.callRef=bm.getValidate=void 0;var pA=to(),Sa=ht(),me=Y(),Zn=pt(),xa=no(),Dr=re(),mA={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=xa.resolveRef.call(c,u,s,r);if(l===void 0)throw new pA.default(n.opts.uriResolver,s,r);if(l instanceof xa.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return Ea(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return Ea(e,me._`${p}.validate`,u,u.$async)}function m(p){let h=vm(e,p);Ea(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:me.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:me.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function vm(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):me._`${r.scopeValue("wrapper",{ref:t})}.validate`}bm.getValidate=vm;function Ea(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?Zn.default.this:me.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(me._`await ${Sa.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(me._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(Sa.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=me._`${p}.errors`;s.assign(Zn.default.vErrors,me._`${Zn.default.vErrors} === null ? ${h} : ${Zn.default.vErrors}.concat(${h})`),s.assign(Zn.default.errors,me._`${Zn.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Dr.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",me._`${p}.evaluated.props`);o.props=Dr.mergeEvaluated.props(s,v,o.props,me.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Dr.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",me._`${p}.evaluated.items`);o.items=Dr.mergeEvaluated.items(s,v,o.items,me.Name)}}}bm.callRef=Ea;bm.default=mA});var Em=g(function($m){Object.defineProperty($m,"__esModule",{value:!0});var yA=_m(),_A=Ra(),vA=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yA.default,_A.default];$m.default=vA});var xm=g(function(Sm){Object.defineProperty(Sm,"__esModule",{value:!0});var Lr=Y(),Mr=Lr.operators,ka={maximum:{okStr:"<=",ok:Mr.LTE,fail:Mr.GT},minimum:{okStr:">=",ok:Mr.GTE,fail:Mr.LT},exclusiveMaximum:{okStr:"<",ok:Mr.LT,fail:Mr.GTE},exclusiveMinimum:{okStr:">",ok:Mr.GT,fail:Mr.LTE}},wA={message:({keyword:e,schemaCode:t})=>Lr.str`must be ${ka[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Lr._`{comparison: ${ka[e].okStr}, limit: ${t}}`},$A={keyword:Object.keys(ka),type:"number",schemaType:"number",$data:!0,error:wA,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Lr._`${r} ${ka[t].fail} ${n} || isNaN(${r})`)}};Sm.default=$A});var km=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var zt=Y(),SA={message:({schemaCode:e})=>zt.str`must be multiple of ${e}`,params:({schemaCode:e})=>zt._`{multipleOf: ${e}}`},xA={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:SA,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?zt._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:zt._`${a} !== parseInt(${a})`;e.fail$data(zt._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Rm.default=xA});var Om=g(function(Am){Object.defineProperty(Am,"__esModule",{value:!0});function Tm(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}Am.default=Tm;Tm.code='require("ajv/dist/runtime/ucs2length").default'});var Im=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var nt=Y(),Nm=re(),TA=Om(),AA={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},OA={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:AA,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,a=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Nm.useFunc(e.gen,TA.default)}(${r})`;e.fail$data(nt._`${a} ${o} ${n}`)}};Pm.default=OA});var qm=g(function(jm){Object.defineProperty(jm,"__esModule",{value:!0});var Cm=ht(),Ur=Y(),PA={message:({schemaCode:e})=>Ur.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ur._`{pattern: ${e}}`},IA={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:PA,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?Ur._`(new RegExp(${s}, ${a}))`:Cm.usePattern(e,n);e.fail$data(Ur._`!${i}.test(${t})`)}};jm.default=IA});var Mm=g(function(Dm){Object.defineProperty(Dm,"__esModule",{value:!0});var Gt=Y(),jA={message({keyword:e,schemaCode:t}){return Gt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Gt._`{limit: ${e}}`},qA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Gt.operators.GT:Gt.operators.LT;e.fail$data(Gt._`Object.keys(${r}).length ${s} ${n}`)}};Dm.default=qA});var Fm=g(function(Um){Object.defineProperty(Um,"__esModule",{value:!0});var Kt=ht(),Ht=Y(),Lm=re(),MA={message:({params:{missingProperty:e}})=>Ht.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ht._`{missingProperty: ${e}}`},LA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:MA,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Lm.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Ht.nil,d);else for(let f of r)Kt.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(Kt.checkMissingProp(e,r,f)),Kt.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Kt.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,Kt.propertyInData(t,s,f,i.ownProperties)),t.if(Ht.not(p),()=>{e.error(),t.break()})},Ht.nil)}}};Um.default=LA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Bt=Y(),FA={message({keyword:e,schemaCode:t}){return Bt.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Bt._`{limit: ${e}}`},VA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:FA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Bt.operators.GT:Bt.operators.LT;e.fail$data(Bt._`${r}.length ${s} ${n}`)}};Vm.default=VA});var Ta=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=Qs();Gm.code='require("ajv/dist/runtime/equal").default';Km.default=Gm});var Wm=g(function(Bm){Object.defineProperty(Bm,"__esModule",{value:!0});var es=Js(),oe=Y(),Hm=re(),KA=Ta(),HA={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}}`},BA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:HA,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?es.getSchemaTypes(o.items):[];e.block$data(c,l,oe._`${a} === false`),e.ok(c);function l(){let p=t.let("i",oe._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(oe._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=es.checkDataTypes(u,y,i.opts.strictNumbers,es.DataType.Wrong),A=t.const("indices",oe._`{}`);t.for(oe._`;${p}--;`,()=>{if(t.let(y,oe._`${r}[${p}]`),t.if(v,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,oe._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${A}[${y}] = ${p}`)})}function f(p,h){let y=Hm.useFunc(t,KA.default),v=t.name("outer");t.label(v).for(oe._`;${p}--;`,()=>t.for(oe._`${h} = ${p}; ${h}--;`,()=>t.if(oe._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};Bm.default=BA});var Jm=g(function(Xm){Object.defineProperty(Xm,"__esModule",{value:!0});var ts=Y(),Ym=re(),YA=Ta(),XA={message:"must be equal to constant",params:({schemaCode:e})=>ts._`{allowedValue: ${e}}`},JA={keyword:"const",$data:!0,error:XA,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ts._`!${Ym.useFunc(t,YA.default)}(${r}, ${s})`);else e.fail(ts._`${o} !== ${r}`)}};Xm.default=JA});var eh=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var Wt=Y(),Qm=re(),ZA=Ta(),eO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Wt._`{allowedValues: ${e}}`},tO={keyword:"enum",schemaType:"array",$data:!0,error:eO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Qm.useFunc(t,ZA.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=Wt.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(Wt._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?Wt._`${u()}(${r}, ${f}[${p}])`:Wt._`${r} === ${h}`}}};Zm.default=tO});var rh=g(function(th){Object.defineProperty(th,"__esModule",{value:!0});var nO=xm(),sO=km(),oO=Im(),aO=qm(),iO=Mm(),cO=Fm(),uO=zm(),lO=Wm(),dO=Jm(),fO=eh(),pO=[nO.default,sO.default,oO.default,aO.default,iO.default,cO.default,uO.default,lO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},dO.default,fO.default];th.default=pO});var gu=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});sh.validateAdditionalItems=void 0;var st=Y(),rs=re(),hO={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},gO={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:hO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){rs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}nh(e,n)}};function nh(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${i} <= ${t.length}`);else if(typeof n=="object"&&!rs.alwaysValidSchema(a,n)){let u=r.var("valid",st._`${i} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:rs.Type.Num},u),!a.allErrors)r.if(st.not(u),()=>r.break())})}}sh.validateAdditionalItems=nh;sh.default=gO});var yu=g(function(ch){Object.defineProperty(ch,"__esModule",{value:!0});ch.validateTuple=void 0;var Aa=Y(),Fr=re(),ah=ht(),_O={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return ih(e,"additionalItems",t);if(r.items=!0,Fr.alwaysValidSchema(r,t))return;e.ok(ah.validateArray(e))}};function ih(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=Fr.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",Aa._`${o}.length`);r.forEach((d,m)=>{if(Fr.alwaysValidSchema(i,d))return;n.if(Aa._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Fr.checkStrictMode(i,y,m.strictTuples)}}}ch.validateTuple=ih;ch.default=_O});var fh=g(function(dh){Object.defineProperty(dh,"__esModule",{value:!0});var lh=yu(),bO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>lh.validateTuple(e,"items")};dh.default=bO});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var Oa=Y(),ph=re(),mh=ht(),hh=gu(),$O={message:({params:{len:e}})=>Oa.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oa._`{limit: ${e}}`},EO={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:$O,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,ph.alwaysValidSchema(n,t))return;if(s)hh.validateAdditionalItems(e,s);else e.ok(mh.validateArray(e))}};gh.default=EO});var vh=g(function(_h){Object.defineProperty(_h,"__esModule",{value:!0});var _e=Y(),Vr=re(),xO={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}}`},RO={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:xO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",_e._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){Vr.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){Vr.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Vr.alwaysValidSchema(o,r)){let h=_e._`${l} >= ${a}`;if(i!==void 0)h=_e._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(_e._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:Vr.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(_e._`${h}++`),i===void 0)t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(_e._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0))}}};_h.default=RO});var Na=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});Eh.validateSchemaDeps=Eh.validatePropertyDeps=Eh.error=void 0;var ns=Y(),bh=re(),Yt=ht();Eh.error={message:({params:{property:e,depsCount:t,deps:r}})=>ns.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>ns._`{property: ${e},
8
8
  missingProperty: ${n},
9
9
  depsCount: ${t},
10
- deps: ${r}}`};var xA={keyword:"dependencies",type:"object",schemaType:"object",error:Em.error,code(e){let[t,r]=RA(e);bm(e,t),wm(e,r)}};function RA({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 bm(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=Xt.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)Xt.checkReportMissingProp(e,u)});else r.if(es._`${c} && (${Xt.checkMissingProp(e,a,o)})`),Xt.reportMissingProp(e,o),r.else()}}Em.validatePropertyDeps=bm;function wm(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if($m.alwaysValidSchema(o,t[a]))continue;r.if(Xt.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)}}Em.validateSchemaDeps=wm;Em.default=xA});var Tm=g(function(km){Object.defineProperty(km,"__esModule",{value:!0});var Ni=Y(),Rm=te(),OA={message:"property name must be valid",params:({params:e})=>Ni._`{propertyName: ${e.propertyName}}`},AA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:OA,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Rm.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(Ni.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};km.default=AA});var _u=g(function(Om){Object.defineProperty(Om,"__esModule",{value:!0});var Vr=gt(),Te=Y(),IA=ht(),zr=te(),PA={message:"must NOT have additional properties",params:({params:e})=>Te._`{additionalProperty: ${e.additionalProperty}}`},CA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:PA,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"&&zr.alwaysValidSchema(i,r))return;let u=Vr.allSchemaProperties(n.properties),d=Vr.allSchemaProperties(n.patternProperties);l(),e.ok(Te._`${o} === ${IA.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=zr.schemaRefOrVal(i,n.properties,"properties");_=Vr.isOwnProperty(t,O,y)}else if(u.length)_=Te.or(...u.map((O)=>Te._`${y} === ${O}`));else _=Te.nil;if(d.length)_=Te.or(_,...d.map((O)=>Te._`${Vr.usePattern(e,O)}.test(${y})`));return Te.not(_)}function f(y){t.code(Te._`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"&&!zr.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Te.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Te.not(_),()=>t.break())}}function m(y,_,O){let k={keyword:"additionalProperties",dataProp:y,dataPropType:zr.Type.Str};if(O===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,_)}}};Om.default=CA});var Pm=g(function(Im){Object.defineProperty(Im,"__esModule",{value:!0});var Nm=Zs(),Ii=gt(),ts=te(),Am=_u(),qA={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)Am.default.code(new Nm.KeywordCxt(o,Am.default,"additionalProperties"));let i=Ii.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(Ii.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)}}};Im.default=qA});var jm=g(function(Cm){Object.defineProperty(Cm,"__esModule",{value:!0});var Pi=gt(),Gr=Y(),Ci=te(),ji=te(),MA={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=Pi.allSchemaProperties(r),c=a.filter((m)=>Ci.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 Gr.Name))o.props=ji.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))Ci.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(Gr._`${Pi.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:ji.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(Gr._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(Gr.not(d),()=>t.break())})})}}};Cm.default=MA});var Mm=g(function(Dm){Object.defineProperty(Dm,"__esModule",{value:!0});var qm=te(),UA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(qm.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"}};Dm.default=UA});var Fm=g(function(Um){Object.defineProperty(Um,"__esModule",{value:!0});var Lm=gt(),VA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lm.validateUnion,error:{message:"must match a schema in anyOf"}};Um.default=VA});var Gm=g(function(zm){Object.defineProperty(zm,"__esModule",{value:!0});var Kr=Y(),Vm=te(),GA={message:"must match exactly one schema in oneOf",params:({params:e})=>Kr._`{passingSchemas: ${e.passing}}`},KA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:GA,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(Vm.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(Kr._`${c} && ${i}`).assign(i,!1).assign(a,Kr._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,Kr.Name)})})}}};zm.default=KA});var Bm=g(function(Hm){Object.defineProperty(Hm,"__esModule",{value:!0});var Km=te(),BA={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(Km.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Hm.default=BA});var Xm=g(function(Ym){Object.defineProperty(Ym,"__esModule",{value:!0});var Hr=Y(),qi=te(),YA={message:({params:e})=>Hr.str`must match "${e.ifClause}" schema`,params:({params:e})=>Hr._`{failingKeyword: ${e.ifClause}}`},XA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:YA,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)qi.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Wm(n,"then"),o=Wm(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(Hr.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,Hr._`${d}`);else e.setParams({ifClause:d})}}}};function Wm(e,t){let r=e.schema[t];return r!==void 0&&!qi.alwaysValidSchema(e,r)}Ym.default=XA});var Zm=g(function(Qm){Object.defineProperty(Qm,"__esModule",{value:!0});var Jm=te(),QA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Jm.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Qm.default=QA});var tg=g(function(eg){Object.defineProperty(eg,"__esModule",{value:!0});var eN=gu(),tN=fm(),rN=yu(),nN=ym(),sN=vm(),oN=Ai(),iN=Tm(),aN=_u(),cN=Pm(),uN=jm(),lN=Mm(),dN=Fm(),fN=Gm(),pN=Bm(),hN=Xm(),mN=Zm();function gN(e=!1){let t=[lN.default,dN.default,fN.default,pN.default,hN.default,mN.default,iN.default,aN.default,oN.default,cN.default,uN.default];if(e)t.push(tN.default,nN.default);else t.push(eN.default,rN.default);return t.push(sN.default),t}eg.default=gN});var vu=g(function(sg){Object.defineProperty(sg,"__esModule",{value:!0});sg.dynamicAnchor=void 0;var rs=Y(),_N=ht(),Di=ro(),rg=xi(),vN={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>ng(e,e.schema)};function ng(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=rs._`${_N.default.dynamicAnchors}${rs.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:$N(e);r.if(rs._`!${s}`,()=>r.assign(s,o))}sg.dynamicAnchor=ng;function $N(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 Di.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:i,meta:a});return Di.compileSchema.call(n,u),rg.getValidate(e,u)}sg.default=vN});var $u=g(function(ag){Object.defineProperty(ag,"__esModule",{value:!0});ag.dynamicRef=void 0;var Mi=Y(),wN=ht(),Li=xi(),EN={keyword:"$dynamicRef",schemaType:"string",code:(e)=>ig(e,e.schema)};function ig(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",Mi._`${wN.default.dynamicAnchors}${Mi.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(()=>{Li.callRef(e,c),r.let(u,!0)}):()=>Li.callRef(e,c)}}ag.dynamicRef=ig;ag.default=EN});var fg=g(function(dg){Object.defineProperty(dg,"__esModule",{value:!0});var ug=vu(),lg=te(),xN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)ug.dynamicAnchor(e,"");else lg.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};dg.default=xN});var mg=g(function(hg){Object.defineProperty(hg,"__esModule",{value:!0});var pg=$u(),kN={keyword:"$recursiveRef",schemaType:"string",code:(e)=>pg.dynamicRef(e,e.schema)};hg.default=kN});var yg=g(function(gg){Object.defineProperty(gg,"__esModule",{value:!0});var ON=vu(),AN=$u(),NN=fg(),IN=mg(),PN=[ON.default,AN.default,NN.default,IN.default];gg.default=PN});var vg=g(function(_g){Object.defineProperty(_g,"__esModule",{value:!0});var Ui=Ai(),jN={keyword:"dependentRequired",type:"object",schemaType:"object",error:Ui.error,code:(e)=>Ui.validatePropertyDeps(e)};_g.default=jN});var wg=g(function(bg){Object.defineProperty(bg,"__esModule",{value:!0});var $g=Ai(),DN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>$g.validateSchemaDeps(e)};bg.default=DN});var xg=g(function(Sg){Object.defineProperty(Sg,"__esModule",{value:!0});var Eg=te(),LN={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)Eg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};Sg.default=LN});var kg=g(function(Rg){Object.defineProperty(Rg,"__esModule",{value:!0});var FN=vg(),VN=wg(),zN=xg(),GN=[FN.default,VN.default,zN.default];Rg.default=GN});var Og=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ge=Y(),Fi=te(),HN=ht(),BN={message:"must NOT have unevaluated properties",params:({params:e})=>Ge._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},WN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:BN,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} === ${HN.default.errors}`);function c(l){if(r===!1){if(e.setParams({unevaluatedProperty:l}),e.error(),!i)t.break();return}if(!Fi.alwaysValidSchema(o,r)){let p=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:l,dataPropType:Fi.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=WN});var Ng=g(function(Ag){Object.defineProperty(Ag,"__esModule",{value:!0});var st=Y(),Vi=te(),XN={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},JN={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:XN,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",st._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(st._`${i} > ${o}`);else if(typeof r=="object"&&!Vi.alwaysValidSchema(s,r)){let c=t.var("valid",st._`${i} <= ${o}`);t.if(st.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:Vi.Type.Num},c),!s.allErrors)t.if(st.not(c),()=>t.break())})}}};Ag.default=JN});var Pg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var ZN=Og(),eI=Ng(),tI=[ZN.default,eI.default];Ig.default=tI});var jg=g(function(Cg){Object.defineProperty(Cg,"__esModule",{value:!0});var X=Y(),nI={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},sI={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:nI,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(),k()));function O(){if(c.strictSchema===!1)return X.nil;return X._`${i} && !${_}`}function k(){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,_]=k(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 k(S){let Ee=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,Se=r.scopeValue("formats",{key:o,ref:S,code:Ee});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${Se}.validate`];return["string",S,Se]}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})`}}}};Cg.default=sI});var Dg=g(function(qg){Object.defineProperty(qg,"__esModule",{value:!0});var iI=jg(),aI=[iI.default];qg.default=aI});var Ug=g(function(Mg){Object.defineProperty(Mg,"__esModule",{value:!0});Mg.contentVocabulary=Mg.metadataVocabulary=void 0;Mg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Vg=g(function(Fg){Object.defineProperty(Fg,"__esModule",{value:!0});var lI=Eh(),dI=rm(),fI=tg(),pI=yg(),hI=kg(),mI=Pg(),gI=Dg(),zi=Ug(),yI=[pI.default,lI.default,dI.default,(0,fI.default)(!0),gI.default,zi.metadataVocabulary,zi.contentVocabulary,hI.default,mI.default];Fg.default=yI});var Hg=g(function(Gg){Object.defineProperty(Gg,"__esModule",{value:!0});Gg.DiscrError=void 0;var zg;(function(e){e.Tag="tag",e.Mapping="mapping"})(zg||(Gg.DiscrError=zg={}))});var Yg=g(function(Wg){Object.defineProperty(Wg,"__esModule",{value:!0});var yt=Y(),ns=Hg(),Gi=ro(),vI=eo(),Bg=te(),$I={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}})=>yt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},bI={keyword:"discriminator",type:"object",schemaType:"object",error:$I,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",yt._`${r}${yt.getProperty(a)}`);t.if(yt._`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(yt._`${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,yt.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)&&!Bg.schemaHasRulesButRef(S,o.self.RULES)){let Se=S.$ref;if(S=Gi.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Se),S instanceof Gi.SchemaEnv)S=S.schema;if(S===void 0)throw new vI.default(o.opts.uriResolver,o.baseId,Se)}let Ee=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof Ee!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(Ee,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)k(M.const,S);else if(M.enum)for(let Ee of M.enum)k(Ee,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};Wg.default=bI});var Xg=g(function(R4,EI){EI.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 Jg=g(function(k4,SI){SI.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 Qg=g(function(T4,xI){xI.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 Zg=g(function(O4,RI){RI.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 ey=g(function(A4,kI){kI.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 ty=g(function(N4,TI){TI.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 ry=g(function(I4,OI){OI.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 ny=g(function(P4,AI){AI.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 oy=g(function(sy){Object.defineProperty(sy,"__esModule",{value:!0});var NI=Xg(),II=Jg(),PI=Qg(),CI=Zg(),jI=ey(),qI=ty(),DI=ry(),MI=ny(),LI=["/properties"];function UI(e){return[NI,II,PI,CI,jI,t(this,qI),DI,t(this,MI)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,LI):n}}sy.default=UI});var iy=g(function(ot,wu){Object.defineProperty(ot,"__esModule",{value:!0});ot.MissingRefError=ot.ValidationError=ot.CodeGen=ot.Name=ot.nil=ot.stringify=ot.str=ot._=ot.KeywordCxt=ot.Ajv2020=void 0;var VI=gh(),zI=Vg(),GI=Yg(),KI=oy(),bu="https://json-schema.org/draft/2020-12/schema";class so extends VI.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),zI.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(GI.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;KI.default.call(this,e),this.refs["http://json-schema.org/schema"]=bu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bu)?bu:void 0)}}ot.Ajv2020=so;wu.exports=ot=so;wu.exports.Ajv2020=so;Object.defineProperty(ot,"__esModule",{value:!0});ot.default=so;var HI=Zs();Object.defineProperty(ot,"KeywordCxt",{enumerable:!0,get:function(){return HI.KeywordCxt}});var ss=Y();Object.defineProperty(ot,"_",{enumerable:!0,get:function(){return ss._}});Object.defineProperty(ot,"str",{enumerable:!0,get:function(){return ss.str}});Object.defineProperty(ot,"stringify",{enumerable:!0,get:function(){return ss.stringify}});Object.defineProperty(ot,"nil",{enumerable:!0,get:function(){return ss.nil}});Object.defineProperty(ot,"Name",{enumerable:!0,get:function(){return ss.Name}});Object.defineProperty(ot,"CodeGen",{enumerable:!0,get:function(){return ss.CodeGen}});var BI=hi();Object.defineProperty(ot,"ValidationError",{enumerable:!0,get:function(){return BI.default}});var WI=eo();Object.defineProperty(ot,"MissingRefError",{enumerable:!0,get:function(){return WI.default}})});var gy=g(function(hy){Object.defineProperty(hy,"__esModule",{value:!0});hy.formatNames=hy.fastFormats=hy.fullFormats=void 0;function Jt(e,t){return{validate:e,compare:t}}hy.fullFormats={date:Jt(ly,Ru),time:Jt(Su(!0),ku),"date-time":Jt(ay(!0),fy),"iso-time":Jt(Su(),dy),"iso-date-time":Jt(ay(),py),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rP,"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:uP,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:nP,int32:{type:"number",validate:iP},int64:{type:"number",validate:aP},float:{type:"number",validate:uy},double:{type:"number",validate:uy},password:!0,binary:!0};hy.fastFormats={...hy.fullFormats,date:Jt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ru),time:Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ku),"date-time":Jt(/^\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,fy),"iso-time":Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dy),"iso-date-time":Jt(/^\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,py),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};hy.formatNames=Object.keys(hy.fullFormats);function JI(e){return e%4===0&&(e%100!==0||e%400===0)}var QI=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ZI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ly(e){let t=QI.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&&JI(r)?29:ZI[n])}function Ru(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Eu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Su(e){return function(r){let n=Eu.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 ku(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 dy(e,t){if(!(e&&t))return;let r=Eu.exec(e),n=Eu.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 xu=/t|\s/i;function ay(e){let t=Su(e);return function(n){let s=n.split(xu);return s.length===2&&ly(s[0])&&t(s[1])}}function fy(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 py(e,t){if(!(e&&t))return;let[r,n]=e.split(xu),[s,o]=t.split(xu),i=Ru(r,s);if(i===void 0)return;return i||ku(n,o)}var eP=/\/|:/,tP=/^(?:[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 rP(e){return eP.test(e)&&tP.test(e)}var cy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function nP(e){return cy.lastIndex=0,cy.test(e)}var sP=-2147483648,oP=2147483647;function iP(e){return Number.isInteger(e)&&e<=oP&&e>=sP}function aP(e){return Number.isInteger(e)}function uy(){return!0}var cP=/[^\\]\\Z/;function uP(e){if(cP.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(vy){Object.defineProperty(vy,"__esModule",{value:!0});vy.regexpCode=vy.getEsmExportName=vy.getProperty=vy.safeStringify=vy.stringify=vy.strConcat=vy.addCodeArg=vy.str=vy._=vy.nil=vy._Code=vy.Name=vy.IDENTIFIER=vy._CodeOrName=void 0;class Ki{}vy._CodeOrName=Ki;vy.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class os extends Ki{constructor(e){super();if(!vy.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}}}vy.Name=os;class Ot extends Ki{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},{})}}vy._Code=Ot;vy.nil=new Ot("");function yy(e,...t){let r=[e[0]],n=0;while(n<t.length)Au(r,t[n]),r.push(e[++n]);return new Ot(r)}vy._=yy;var Ou=new Ot("+");function _y(e,...t){let r=[oo(e[0])],n=0;while(n<t.length)r.push(Ou),Au(r,t[n]),r.push(Ou,oo(e[++n]));return dP(r),new Ot(r)}vy.str=_y;function Au(e,t){if(t instanceof Ot)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(hP(t))}vy.addCodeArg=Au;function dP(e){let t=1;while(t<e.length-1){if(e[t]===Ou){let r=fP(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function fP(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 pP(e,t){return t.emptyStr()?e:e.emptyStr()?t:_y`${e}${t}`}vy.strConcat=pP;function hP(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function mP(e){return new Ot(oo(e))}vy.stringify=mP;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vy.safeStringify=oo;function gP(e){return typeof e=="string"&&vy.IDENTIFIER.test(e)?new Ot(`.${e}`):yy`[${e}]`}vy.getProperty=gP;function yP(e){if(typeof e=="string"&&vy.IDENTIFIER.test(e))return new Ot(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}vy.getEsmExportName=yP;function _P(e){return new Ot(e.toString())}vy.regexpCode=_P});var Cu=g(function(Ey){Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueScope=Ey.ValueScopeName=Ey.Scope=Ey.varKinds=Ey.UsedValueState=void 0;var me=io();class by extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Bi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Bi||(Ey.UsedValueState=Bi={}));Ey.varKinds={const:new me.Name("const"),let:new me.Name("let"),var:new me.Name("var")};class Iu{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}}}Ey.Scope=Iu;class Pu 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}]`}}Ey.ValueScopeName=Pu;var NP=me._`\n`;class wy extends Iu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?NP:me.nil}}get(){return this._scope}name(e){return new Pu(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,Bi.Started);let u=t(c);if(u){let d=this.opts.es5?Ey.varKinds.var:Ey.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 by(c);a.set(c,Bi.Completed)})}return s}}Ey.ValueScope=wy});var Z=g(function(it){Object.defineProperty(it,"__esModule",{value:!0});it.or=it.and=it.not=it.CodeGen=it.operators=it.varKinds=it.ValueScopeName=it.ValueScope=it.Scope=it.Name=it.regexpCode=it.stringify=it.getProperty=it.nil=it.strConcat=it.str=it._=void 0;var N=io(),Oe=Cu(),Br=io();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Br._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Br.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return Br.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Br.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return Br.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Br.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return Br.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Br.Name}});var Zi=Cu();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return Zi.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return Zi.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return Zi.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return Zi.varKinds}});it.operators={GT:new N._Code(">"),GTE:new N._Code(">="),LT:new N._Code("<"),LTE:new N._Code("<="),EQ:new N._Code("==="),NEQ:new N._Code("!=="),NOT:new N._Code("!"),OR:new N._Code("||"),AND:new N._Code("&&"),ADD:new N._Code("+")};class Wr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xy extends Wr{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 N._CodeOrName?this.rhs.names:{}}}class Du extends Wr{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 N.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=as(this.rhs,e,t),this}get names(){let e=this.lhs instanceof N.Name?{}:{...this.lhs.names};return Qi(e,this.rhs)}}class Ry extends Du{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ky extends Wr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Wr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Oy extends Wr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Ay extends Wr{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 N._CodeOrName?this.code.names:{}}}class ea extends Wr{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;jP(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>En(e,t.names),{})}}class Yr extends ea{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ny extends ea{}class ao extends Yr{}ao.kind="else";class vr extends Yr{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 vr?t:t.nodes;if(this.nodes.length)return this;return new vr(qy(e),t instanceof vr?[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(Qi(e,this.condition),this.else)En(e,this.else.names);return e}}vr.kind="if";class is extends Yr{}is.kind="for";class Iy 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 En(super.names,this.iteration.names)}}class Py 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=Qi(super.names,this.from);return Qi(e,this.to)}}class ju 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 En(super.names,this.iterable.names)}}class Wi extends Yr{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)}}Wi.kind="func";class Yi extends ea{render(e){return"return "+super.render(e)}}Yi.kind="return";class Cy extends Yr{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)En(e,this.catch.names);if(this.finally)En(e,this.finally.names);return e}}class Xi extends Yr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Xi.kind="catch";class Ji extends Yr{render(e){return"finally"+super.render(e)}}Ji.kind="finally";class jy{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 Ny]}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 xy(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 Du(e,t,r))}add(e,t){return this._leafNode(new Ry(e,it.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==N.nil)this._leafNode(new Ay(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(":"),N.addCodeArg(t,n)}return t.push("}"),new N._Code(t)}if(e,t,r){if(this._blockNode(new vr(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 vr(e))}else(){return this._elseNode(new ao)}endIf(){return this._endBlockNode(vr,ao)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Iy(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 Py(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 N.Name?t:this.var("_arr",t);return this.forRange("_i",0,N._`${o}.length`,(i)=>{this.var(s,N._`${o}[${i}]`),r(s)})}return this._for(new ju("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,N._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new ju("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(is)}label(e){return this._leafNode(new ky(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Yi;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Yi)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Cy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Xi(s),t(s)}if(r)this._currNode=n.finally=new Ji,this.code(r);return this._endBlockNode(Xi,Ji)}throw(e){return this._leafNode(new Oy(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=N.nil,r,n){if(this._blockNode(new Wi(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Wi)}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 vr))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}}it.CodeGen=jy;function En(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Qi(e,t){return t instanceof N._CodeOrName?En(e,t.names):e}function as(e,t,r){if(e instanceof N.Name)return n(e);if(!s(e))return e;return new N._Code(e._items.reduce((o,i)=>{if(i instanceof N.Name)i=n(i);if(i instanceof N._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 N._Code&&o._items.some((i)=>i instanceof N.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function jP(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function qy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:N._`!${qu(e)}`}it.not=qy;var qP=Dy(it.operators.AND);function DP(...e){return e.reduce(qP)}it.and=DP;var MP=Dy(it.operators.OR);function LP(...e){return e.reduce(MP)}it.or=LP;function Dy(e){return(t,r)=>t===N.nil?r:r===N.nil?t:N._`${qu(t)} ${e} ${qu(r)}`}function qu(e){return e instanceof N.Name?e:N._`(${e})`}});var ae=g(function(By){Object.defineProperty(By,"__esModule",{value:!0});By.checkStrictMode=By.getErrorPath=By.Type=By.useFunc=By.setEvaluated=By.evaluatedPropsToName=By.mergeEvaluated=By.eachItem=By.unescapeJsonPointer=By.escapeJsonPointer=By.escapeFragment=By.unescapeFragment=By.schemaRefOrVal=By.schemaHasRulesButRef=By.schemaHasRules=By.checkUnknownRules=By.alwaysValidSchema=By.toHash=void 0;var U=Z(),Fy=io();function zP(e){let t={};for(let r of e)t[r]=!0;return t}By.toHash=zP;function GP(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Vy(e,t),!zy(t,e.self.RULES.all)}By.alwaysValidSchema=GP;function Vy(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])Hy(e,`unknown keyword: "${o}"`)}By.checkUnknownRules=Vy;function zy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}By.schemaHasRules=zy;function KP(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}By.schemaHasRulesButRef=KP;function HP({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)}`}By.schemaRefOrVal=HP;function BP(e){return Gy(decodeURIComponent(e))}By.unescapeFragment=BP;function WP(e){return encodeURIComponent(Lu(e))}By.escapeFragment=WP;function Lu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}By.escapeJsonPointer=Lu;function Gy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}By.unescapeJsonPointer=Gy;function YP(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}By.eachItem=YP;function Ly({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}}By.mergeEvaluated={props:Ly({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} || {}`),Uu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ky}),items:Ly({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 Ky(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Uu(e,r,t);return r}By.evaluatedPropsToName=Ky;function Uu(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}By.setEvaluated=Uu;var Uy={};function XP(e,t){return e.scopeValue("func",{ref:t,code:Uy[t.code]||(Uy[t.code]=new Fy._Code(t.code))})}By.useFunc=XP;var Mu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mu||(By.Type=Mu={}));function JP(e,t,r){if(e instanceof U.Name){let n=t===Mu.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():"/"+Lu(e)}By.getErrorPath=JP;function Hy(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}By.checkStrictMode=Hy});var $r=g(function(Yy){Object.defineProperty(Yy,"__esModule",{value:!0});var ue=Z(),m1={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")};Yy.default=m1});var co=g(function(Zy){Object.defineProperty(Zy,"__esModule",{value:!0});Zy.extendErrors=Zy.resetErrorsCount=Zy.reportExtraError=Zy.reportError=Zy.keyword$DataError=Zy.keywordError=void 0;var C=Z(),Xr=ae(),Ye=$r();Zy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Zy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function y1(e,t=Zy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Qy(e,t,r);if(n!==null&&n!==void 0?n:i||a)Xy(o,c);else Jy(s,C._`[${c}]`)}Zy.reportError=y1;function _1(e,t=Zy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Qy(e,t,r);if(Xy(s,a),!(o||i))Jy(n,Ye.default.vErrors)}Zy.reportExtraError=_1;function v1(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)))}Zy.resetErrorsCount=v1;function $1({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)})}Zy.extendErrors=$1;function Xy(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 Jy(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 Qy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return b1(e,t,r)}function b1(e,t,r={}){let{gen:n,it:s}=e,o=[w1(s,r),E1(e,r)];return S1(e,t,o),n.object(...o)}function w1({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Xr.getErrorPath(t,Xr.Type.Str)}`:e;return[Ye.default.instancePath,C.strConcat(Ye.default.instancePath,r)]}function E1({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Xr.getErrorPath(r,Xr.Type.Str)}`;return[Sn.schemaPath,s]}function S1(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 i_=g(function(s_){Object.defineProperty(s_,"__esModule",{value:!0});s_.boolOrEmptySchema=s_.topBoolOrEmptySchema=void 0;var t_=co(),r_=Z(),O1=$r(),A1={message:"boolean schema is false"};function N1(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)n_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(O1.default.data);else t.assign(r_._`${n}.errors`,null),t.return(!0)}s_.topBoolOrEmptySchema=N1;function I1(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),n_(e);else r.var(t,!0)}s_.boolOrEmptySchema=I1;function n_(e,t){let{gen:r,data:n}=e;t_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},A1,void 0,t)}});var Vu=g(function(a_){Object.defineProperty(a_,"__esModule",{value:!0});a_.getRules=a_.isJSONType=void 0;var C1=["string","number","integer","boolean","null","object","array"],j1=new Set(C1);function q1(e){return typeof e=="string"&&j1.has(e)}a_.isJSONType=q1;function D1(){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:{}}}a_.getRules=D1});var zu=g(function(d_){Object.defineProperty(d_,"__esModule",{value:!0});d_.shouldUseRule=d_.shouldUseGroup=d_.schemaHasRulesForType=void 0;function L1({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&u_(e,n)}d_.schemaHasRulesForType=L1;function u_(e,t){return t.rules.some((r)=>l_(e,r))}d_.shouldUseGroup=u_;function l_(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))}d_.shouldUseRule=l_});var uo=g(function(__){Object.defineProperty(__,"__esModule",{value:!0});__.reportTypeError=__.checkDataTypes=__.checkDataType=__.coerceAndCheckDataType=__.getJSONTypes=__.getSchemaTypes=__.DataType=void 0;var p_=Vu(),h_=zu(),m_=co(),R=Z(),ra=ae(),cs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(cs||(__.DataType=cs={}));function V1(e){let t=g_(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}__.getSchemaTypes=V1;function g_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(p_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}__.getJSONTypes=g_;function z1(e,t){let{gen:r,data:n,opts:s}=e,o=G1(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&h_.schemaHasRulesForType(e,t[0]));if(i){let a=Ku(t,n,s.strictNumbers,cs.Wrong);r.if(a,()=>{if(o.length)K1(e,t,o);else Hu(e)})}return i}__.coerceAndCheckDataType=z1;var y_=new Set(["string","number","integer","boolean","null"]);function G1(e,t){return t?e.filter((r)=>y_.has(r)||t==="array"&&r==="array"):[]}function K1(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(Ku(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(R._`${a} !== undefined`);for(let u of r)if(y_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Hu(e),n.endIf(),n.if(R._`${a} !== undefined`,()=>{n.assign(s,a),H1(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
- || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,R._`+${s}`);return;case"integer":n.elseIf(R._`${i} === "boolean" || ${s} === null
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 H1({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function Gu(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)}}__.checkDataType=Gu;function Ku(e,t,r,n){if(e.length===1)return Gu(e[0],t,r,n);let s,o=ra.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,Gu(i,t,r,n));return s}__.checkDataTypes=Ku;var B1={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Hu(e){let t=W1(e);m_.reportError(t,B1)}__.reportTypeError=Hu;function W1(e){let{gen:t,data:r,schema:n}=e,s=ra.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var S_=g(function(w_){Object.defineProperty(w_,"__esModule",{value:!0});w_.assignDefaults=void 0;var _t=Z(),b_=ae();function tC(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)$_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>$_(e,o,s.default))}w_.assignDefaults=tC;function $_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=_t._`${o}${_t.getProperty(t)}`;if(s){b_.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=_t._`${a} === undefined`;if(i.useDefaults==="empty")c=_t._`${c} || ${a} === null || ${a} === ""`;n.if(c,_t._`${a} = ${_t.stringify(r)}`)}});var vt=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(),Jr=$r(),x_=ae();function rC(e,t){let{gen:r,data:n,it:s}=e;r.if(Wu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=rC;function nC({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Wu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=nC;function sC(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=sC;function R_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=R_;function Bu(e,t,r){return z._`${R_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Bu;function oC(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Bu(e,t,r)}`:s}T_.propertyInData=oC;function Wu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Bu(e,t,r))):s}T_.noPropertyInData=Wu;function k_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=k_;function iC(e,t){return k_(t).filter((r)=>!us.alwaysValidSchema(e,t[r]))}T_.schemaProperties=iC;function aC({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=[[Jr.default.instancePath,z.strConcat(Jr.default.instancePath,o)],[Jr.default.parentData,i.parentData],[Jr.default.parentDataProperty,i.parentDataProperty],[Jr.default.rootData,Jr.default.rootData]];if(i.opts.dynamicRef)l.push([Jr.default.dynamicAnchors,Jr.default.dynamicAnchors]);let p=z._`${d}, ${r.object(...l)}`;return c!==z.nil?z._`${a}.call(${c}, ${p})`:z._`${a}(${p})`}T_.callValidateCode=aC;var cC=z._`new RegExp`;function uC({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"?cC:x_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=uC;function lC(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=lC;function dC(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=dC});var q_=g(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});C_.validateKeywordUsage=C_.validSchemaType=C_.funcKeywordCode=C_.macroKeywordCode=void 0;var de=Z(),xn=$r(),N_=vt(),I_=co();function SC(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=P_(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))}C_.macroKeywordCode=SC;function xC(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;kC(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=P_(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)A_(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)A_(e);y(()=>RC(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,k=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,de._`${_}${N_.callValidateCode(e,d,O,k)}`,t.modifying)}function y(_){var O;n.if(de.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}C_.funcKeywordCode=xC;function A_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function RC(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`),I_.extendErrors(e)},()=>e.error())}function kC({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function P_(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 TC(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")}C_.validSchemaType=TC;function OC({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)}}}C_.validateKeywordUsage=OC});var L_=g(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});D_.extendSubschemaMode=D_.extendSubschemaData=D_.getSubschema=void 0;var qe=Z(),na=ae();function PC(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}/${na.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')}D_.getSubschema=PC;function CC(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}${na.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]}}D_.extendSubschemaData=CC;function jC(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}D_.extendSubschemaMode=jC});var lo=g(function(G_){Object.defineProperty(G_,"__esModule",{value:!0});G_.getSchemaRefs=G_.resolveUrl=G_.normalizeId=G_._getFullPath=G_.getFullPath=G_.inlineRef=void 0;var U_=ae(),MC=Js(),LC=nu(),UC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function FC(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Yu(e);if(!t)return!1;return F_(e)<=t}G_.inlineRef=FC;var VC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yu(e){for(let t in e){if(VC.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Yu))return!0;if(typeof r=="object"&&Yu(r))return!0}return!1}function F_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,UC.has(r))continue;if(typeof e[r]=="object")U_.eachItem(e[r],(n)=>t+=F_(n));if(t===1/0)return 1/0}return t}function V_(e,t="",r){if(r!==!1)t=ls(t);let n=e.parse(t);return z_(e,n)}G_.getFullPath=V_;function z_(e,t){return e.serialize(t).split("#")[0]+"#"}G_._getFullPath=z_;var zC=/#\/?$/;function ls(e){return e?e.replace(zC,""):""}G_.normalizeId=ls;function GC(e,t,r){return r=ls(r),e.resolve(t,r)}G_.resolveUrl=GC;var KC=/^[a-z_][-a-z0-9._]*$/i;function HC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ls(e[r]||t),o={"":s},i=V_(n,s,!1),a={},c=new Set;return LC(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 _(k){let M=this.opts.uriResolver.resolve;if(k=ls(y?M(y,k):k),c.has(k))throw d(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,k);else if(k!==ls(m))if(k[0]==="#")u(l,a[k],k),a[k]=l;else this.refs[k]=m;return k}function O(k){if(typeof k=="string"){if(!KC.test(k))throw Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),a;function u(l,p,f){if(p!==void 0&&!MC(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}G_.getSchemaRefs=HC});var fo=g(function(iv){Object.defineProperty(iv,"__esModule",{value:!0});iv.getData=iv.KeywordCxt=iv.validateFunctionCode=void 0;var oa=i_(),sa=uo(),fs=zu(),Qr=uo(),Y_=S_(),Zt=q_(),ds=L_(),w=Z(),B=$r(),X_=lo(),Le=ae(),Qt=co();function QC(e){if(Z_(e)){if(ev(e),Q_(e)){tj(e);return}}J_(e,()=>oa.topBoolOrEmptySchema(e))}iv.validateFunctionCode=QC;function J_({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"; ${H_(r,s)}`),ej(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${ZC(s)}`,n.$async,()=>e.code(H_(r,s)).code(o))}function ZC(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 ej(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 tj(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{if(r.$comment&&t.$comment)rv(e);if(ij(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)rj(e);tv(e),uj(e)});return}function rj(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 H_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function nj(e,t){if(Z_(e)){if(ev(e),Q_(e)){sj(e,t);return}}oa.boolOrEmptySchema(e,t)}function Q_({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 Z_(e){return typeof e.schema!="boolean"}function sj(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)rv(e);aj(e),cj(e);let o=n.const("_errs",B.default.errors);tv(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function ev(e){Le.checkUnknownRules(e),oj(e)}function tv(e,t){if(e.opts.jtd)return B_(e,[],!1,t);let r=sa.getSchemaTypes(e.schema),n=sa.coerceAndCheckDataType(e,r);B_(e,r,!n,t)}function oj(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 ij(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 aj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=X_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function cj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function rv({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 uj(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)lj(e);t.return(w._`${B.default.errors} === 0`)}}function lj({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 B_(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(()=>sv(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)dj(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(Qr.checkDataType(p.type,i,c.strictNumbers)),W_(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Qr.reportTypeError(e);s.endIf()}else W_(e,p);if(!a)s.if(w._`${B.default.errors} === ${n||0}`)}}function W_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Y_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(fs.shouldUseRule(n,o))sv(e,o.keyword,o.definition,t.type)})}function dj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(fj(e,t),!e.opts.allowUnionTypes)pj(e,t);hj(e,e.dataTypes)}function fj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!nv(e.dataTypes,r))Xu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),gj(e,t)}function pj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Xu(e,"use allowUnionTypes to allow union type keyword")}function hj(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)=>mj(t,i)))Xu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function mj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function gj(e,t){let r=[];for(let n of e.dataTypes)if(nv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Xu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class Ju{constructor(e,t,r){if(Zt.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",ov(this.$data,e));else if(this.schemaCode=this.schemaValue,!Zt.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?Qt.reportExtraError:Qt.reportError)(this,this.def.error,t)}$dataError(){Qt.reportError(this,this.def.$dataError||Qt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Qt.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._`${Qr.checkDataTypes(a,t,s.opts.strictNumbers,Qr.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 nj(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}}iv.KeywordCxt=Ju;function sv(e,t,r,n){let s=new Ju(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Zt.funcKeywordCode(s,r);else if("macro"in r)Zt.macroKeywordCode(s,r);else if(r.compile||r.validate)Zt.funcKeywordCode(s,r)}var yj=/^\/(?:[^~]|~0|~1)*$/,_j=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ov(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!yj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=_j.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}`}}iv.getData=ov});var ia=g(function(uv){Object.defineProperty(uv,"__esModule",{value:!0});class cv extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}uv.default=cv});var po=g(function(dv){Object.defineProperty(dv,"__esModule",{value:!0});var ps=lo();class lv 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))}}dv.default=lv});var ua=g(function(hv){Object.defineProperty(hv,"__esModule",{value:!0});hv.resolveSchema=hv.getCompilingSchema=hv.resolveRef=hv.compileSchema=hv.SchemaEnv=void 0;var Ae=Z(),Ej=ia(),Rn=$r(),Ne=lo(),aa=ae(),fv=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:Ne.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={}}}hv.SchemaEnv=ho;function Zu(e){let t=pv.call(this,e);if(t)return t;let r=Ne.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:Ej.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),fv.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)}}hv.compileSchema=Zu;function Sj(e,t,r){var n;r=Ne.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=kj.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]=xj.call(this,o)}hv.resolveRef=Sj;function xj(e){if(Ne.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Zu.call(this,e)}function pv(e){for(let t of this._compilations)if(Rj(t,e))return t}hv.getCompilingSchema=pv;function Rj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function kj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ca.call(this,e,t)}function ca(e,t){let r=this.opts.uriResolver.parse(t),n=Ne._getFullPath(this.opts.uriResolver,r),s=Ne.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qu.call(this,r,e);let o=Ne.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=ca.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Qu.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Zu.call(this,i);if(o===Ne.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Ne.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:a,schemaId:c,root:e,baseId:s})}return Qu.call(this,r,i)}hv.resolveSchema=ca;var Tj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qu(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[aa.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Tj.has(a)&&u)t=Ne.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!aa.schemaHasRulesButRef(r,this.RULES)){let a=Ne.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ca.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 gv=g(function(bK,Pj){Pj.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 vv=g(function(_v){Object.defineProperty(_v,"__esModule",{value:!0});var yv=hu();yv.code='require("ajv/dist/runtime/uri").default';_v.default=yv});var Ov=g(function(br){Object.defineProperty(br,"__esModule",{value:!0});br.CodeGen=br.Name=br.nil=br.stringify=br.str=br._=br.KeywordCxt=void 0;var jj=fo();Object.defineProperty(br,"KeywordCxt",{enumerable:!0,get:function(){return jj.KeywordCxt}});var ms=Z();Object.defineProperty(br,"_",{enumerable:!0,get:function(){return ms._}});Object.defineProperty(br,"str",{enumerable:!0,get:function(){return ms.str}});Object.defineProperty(br,"stringify",{enumerable:!0,get:function(){return ms.stringify}});Object.defineProperty(br,"nil",{enumerable:!0,get:function(){return ms.nil}});Object.defineProperty(br,"Name",{enumerable:!0,get:function(){return ms.Name}});Object.defineProperty(br,"CodeGen",{enumerable:!0,get:function(){return ms.CodeGen}});var qj=ia(),Sv=po(),xv=Vu(),er=ua(),Rv=Z(),tr=lo(),Zr=uo(),hs=ae(),$v=gv(),Dj=vv(),kv=(e,t)=>new RegExp(e,t);kv.code="new RegExp";var Mj=["removeAdditional","useDefaults","coerceTypes"],Lj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Uj={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."},Fj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bv=200;function Vj(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,k,M,S,Ee,Se,pt,Rt;let lt=e.strict,jt=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=jt===!0||jt===void 0?1:jt||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:kv,_c=(s=e.uriResolver)!==null&&s!==void 0?s:Dj.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:lt)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:lt)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:lt)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:lt)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:lt)!==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:bv,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:bv,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(Ee=e.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Se=e.validateFormats)!==null&&Se!==void 0?Se:!0,unicodeRegExp:(pt=e.unicodeRegExp)!==null&&pt!==void 0?pt:!0,int32range:(Rt=e.int32range)!==null&&Rt!==void 0?Rt:!0,uriResolver:_c}}class la{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Vj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rv.ValueScope({scope:{},prefixes:Lj,es5:t,lines:r}),this.logger=Wj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=xv.getRules(),wv.call(this,Uj,e,"NOT SUPPORTED"),wv.call(this,Fj,e,"DEPRECATED","warn"),this._metaOpts=Hj.call(this),e.formats)Gj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Kj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);zj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=$v;if(r==="id")n={...$v},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 Sv.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=tr.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=Ev.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new er.SchemaEnv({schema:{},schemaId:r});if(t=er.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=Ev.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=tr.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(Xj.call(this,r,t),!t)return hs.eachItem(r,(s)=>el.call(this,s)),this;Qj.call(this,t);let n={...t,type:Zr.getJSONTypes(t.type),schemaType:Zr.getJSONTypes(t.schemaType)};return hs.eachItem(r,n.type.length===0?(s)=>el.call(this,s,n):(s)=>n.type.forEach((o)=>el.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=tr.normalizeId(o||r);let c=tr.getSchemaRefs.call(this,e,r);if(a=new er.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 er.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{er.compileSchema.call(this,e)}finally{this.opts=t}}}la.ValidationError=qj.default;la.MissingRefError=Sv.default;br.default=la;function wv(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 Ev(e){return e=tr.normalizeId(e),this.schemas[e]||this.refs[e]}function zj(){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 Gj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Kj(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 Hj(){let e={...this.opts};for(let t of Mj)delete e[t];return e}var Bj={log(){},warn(){},error(){}};function Wj(e){if(e===!1)return Bj;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 Yj=/^[a-z_$][a-z0-9_$:-]*$/i;function Xj(e,t){let{RULES:r}=this;if(hs.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Yj.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 el(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:Zr.getJSONTypes(t.type),schemaType:Zr.getJSONTypes(t.schemaType)}};if(t.before)Jj.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 Jj(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 Qj(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 Zj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,Zj]}}});var Nv=g(function(Av){Object.defineProperty(Av,"__esModule",{value:!0});var rq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Av.default=rq});var jv=g(function(Pv){Object.defineProperty(Pv,"__esModule",{value:!0});Pv.callRef=Pv.getValidate=void 0;var sq=po(),fa=vt(),ge=Z(),gs=$r(),pa=ua(),en=ae(),oq={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=pa.resolveRef.call(c,u,s,r);if(d===void 0)throw new sq.default(n.opts.uriResolver,s,r);if(d instanceof pa.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return da(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return da(e,ge._`${h}.validate`,u,u.$async)}function p(h){let m=Iv(e,h);da(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 Iv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Pv.getValidate=Iv;function da(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 ${fa.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(fa.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=en.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",ge._`${h}.evaluated.props`);o.props=en.mergeEvaluated.props(s,_,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=en.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",ge._`${h}.evaluated.items`);o.items=en.mergeEvaluated.items(s,_,o.items,ge.Name)}}}Pv.callRef=da;Pv.default=oq});var Dv=g(function(qv){Object.defineProperty(qv,"__esModule",{value:!0});var cq=Nv(),uq=jv(),lq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cq.default,uq.default];qv.default=lq});var Lv=g(function(Mv){Object.defineProperty(Mv,"__esModule",{value:!0});var rn=Z(),tn=rn.operators,ha={maximum:{okStr:"<=",ok:tn.LTE,fail:tn.GT},minimum:{okStr:">=",ok:tn.GTE,fail:tn.LT},exclusiveMaximum:{okStr:"<",ok:tn.LT,fail:tn.GTE},exclusiveMinimum:{okStr:">",ok:tn.GT,fail:tn.LTE}},fq={message:({keyword:e,schemaCode:t})=>rn.str`must be ${ha[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>rn._`{comparison: ${ha[e].okStr}, limit: ${t}}`},pq={keyword:Object.keys(ha),type:"number",schemaType:"number",$data:!0,error:fq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(rn._`${r} ${ha[t].fail} ${n} || isNaN(${r})`)}};Mv.default=pq});var Fv=g(function(Uv){Object.defineProperty(Uv,"__esModule",{value:!0});var rr=Z(),mq={message:({schemaCode:e})=>rr.str`must be multiple of ${e}`,params:({schemaCode:e})=>rr._`{multipleOf: ${e}}`},gq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:mq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?rr._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:rr._`${i} !== parseInt(${i})`;e.fail$data(rr._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Uv.default=gq});var Gv=g(function(zv){Object.defineProperty(zv,"__esModule",{value:!0});function Vv(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}zv.default=Vv;Vv.code='require("ajv/dist/runtime/ucs2length").default'});var Bv=g(function(Hv){Object.defineProperty(Hv,"__esModule",{value:!0});var at=Z(),Kv=ae(),vq=Gv(),$q={message({keyword:e,schemaCode:t}){return at.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>at._`{limit: ${e}}`},bq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:$q,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?at.operators.GT:at.operators.LT,i=s.opts.unicode===!1?at._`${r}.length`:at._`${Kv.useFunc(e.gen,vq.default)}(${r})`;e.fail$data(at._`${i} ${o} ${n}`)}};Hv.default=bq});var Xv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});var Wv=vt(),nn=Z(),Eq={message:({schemaCode:e})=>nn.str`must match pattern "${e}"`,params:({schemaCode:e})=>nn._`{pattern: ${e}}`},Sq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Eq,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?nn._`(new RegExp(${s}, ${i}))`:Wv.usePattern(e,n);e.fail$data(nn._`!${a}.test(${t})`)}};Yv.default=Sq});var Qv=g(function(Jv){Object.defineProperty(Jv,"__esModule",{value:!0});var nr=Z(),Rq={message({keyword:e,schemaCode:t}){return nr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>nr._`{limit: ${e}}`},kq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?nr.operators.GT:nr.operators.LT;e.fail$data(nr._`Object.keys(${r}).length ${s} ${n}`)}};Jv.default=kq});var t0=g(function(e0){Object.defineProperty(e0,"__esModule",{value:!0});var sr=vt(),or=Z(),Zv=ae(),Oq={message:({params:{missingProperty:e}})=>or.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>or._`{missingProperty: ${e}}`},Aq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Oq,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)`;Zv.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(or.nil,l);else for(let f of r)sr.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(sr.checkMissingProp(e,r,f)),sr.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(sr.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,sr.propertyInData(t,s,f,a.ownProperties)),t.if(or.not(h),()=>{e.error(),t.break()})},or.nil)}}};e0.default=Aq});var n0=g(function(r0){Object.defineProperty(r0,"__esModule",{value:!0});var ir=Z(),Iq={message({keyword:e,schemaCode:t}){return ir.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>ir._`{limit: ${e}}`},Pq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Iq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?ir.operators.GT:ir.operators.LT;e.fail$data(ir._`${r}.length ${s} ${n}`)}};r0.default=Pq});var ma=g(function(o0){Object.defineProperty(o0,"__esModule",{value:!0});var s0=Js();s0.code='require("ajv/dist/runtime/equal").default';o0.default=s0});var c0=g(function(a0){Object.defineProperty(a0,"__esModule",{value:!0});var ys=uo(),oe=Z(),i0=ae(),qq=ma(),Dq={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}}`},Mq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Dq,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=i0.useFunc(t,qq.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(_)})))}}};a0.default=Mq});var d0=g(function(l0){Object.defineProperty(l0,"__esModule",{value:!0});var _s=Z(),u0=ae(),Uq=ma(),Fq={message:"must be equal to constant",params:({schemaCode:e})=>_s._`{allowedValue: ${e}}`},Vq={keyword:"const",$data:!0,error:Fq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(_s._`!${u0.useFunc(t,Uq.default)}(${r}, ${s})`);else e.fail(_s._`${o} !== ${r}`)}};l0.default=Vq});var h0=g(function(p0){Object.defineProperty(p0,"__esModule",{value:!0});var ar=Z(),f0=ae(),Gq=ma(),Kq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ar._`{allowedValues: ${e}}`},Hq={keyword:"enum",schemaType:"array",$data:!0,error:Kq,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=f0.useFunc(t,Gq.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=ar.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(ar._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?ar._`${u()}(${r}, ${f}[${h}])`:ar._`${r} === ${m}`}}};p0.default=Hq});var g0=g(function(m0){Object.defineProperty(m0,"__esModule",{value:!0});var Wq=Lv(),Yq=Fv(),Xq=Bv(),Jq=Xv(),Qq=Qv(),Zq=t0(),eD=n0(),tD=c0(),rD=d0(),nD=h0(),sD=[Wq.default,Yq.default,Xq.default,Jq.default,Qq.default,Zq.default,eD.default,tD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},rD.default,nD.default];m0.default=sD});var tl=g(function(_0){Object.defineProperty(_0,"__esModule",{value:!0});_0.validateAdditionalItems=void 0;var ct=Z(),vs=ae(),iD={message:({params:{len:e}})=>ct.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ct._`{limit: ${e}}`},aD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:iD,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}y0(e,n)}};function y0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",ct._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ct._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vs.alwaysValidSchema(i,n)){let u=r.var("valid",ct._`${a} <= ${t.length}`);r.if(ct.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(ct.not(u),()=>r.break())})}}_0.validateAdditionalItems=y0;_0.default=aD});var rl=g(function(w0){Object.defineProperty(w0,"__esModule",{value:!0});w0.validateTuple=void 0;var ga=Z(),sn=ae(),$0=vt(),uD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return b0(e,"additionalItems",t);if(r.items=!0,sn.alwaysValidSchema(r,t))return;e.ok($0.validateArray(e))}};function b0(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=sn.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",ga._`${o}.length`);r.forEach((l,p)=>{if(sn.alwaysValidSchema(a,l))return;n.if(ga._`${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}"`;sn.checkStrictMode(a,y,p.strictTuples)}}}w0.validateTuple=b0;w0.default=uD});var R0=g(function(x0){Object.defineProperty(x0,"__esModule",{value:!0});var S0=rl(),dD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>S0.validateTuple(e,"items")};x0.default=dD});var N0=g(function(A0){Object.defineProperty(A0,"__esModule",{value:!0});var ya=Z(),k0=ae(),T0=vt(),O0=tl(),pD={message:({params:{len:e}})=>ya.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ya._`{limit: ${e}}`},hD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:pD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,k0.alwaysValidSchema(n,t))return;if(s)O0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};A0.default=hD});var P0=g(function(I0){Object.defineProperty(I0,"__esModule",{value:!0});var ve=Z(),on=ae(),gD={message:({params:{min:e,max:t}})=>t===void 0?ve.str`must contain at least ${e} valid item(s)`:ve.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?ve._`{minContains: ${e}}`:ve._`{minContains: ${e}, maxContains: ${t}}`},yD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:gD,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",ve._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){on.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){on.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(on.alwaysValidSchema(o,r)){let m=ve._`${d} >= ${i}`;if(a!==void 0)m=ve._`${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(ve._`${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:on.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(ve._`${m}++`),a===void 0)t.if(ve._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(ve._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(ve._`${m} >= ${i}`,()=>t.assign(l,!0))}}};I0.default=yD});var U0=g(function(D0){Object.defineProperty(D0,"__esModule",{value:!0});D0.validateSchemaDeps=D0.validatePropertyDeps=D0.error=void 0;var $s=Z(),C0=ae(),cr=vt();D0.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},
10
+ deps: ${r}}`};var TO={keyword:"dependencies",type:"object",schemaType:"object",error:Eh.error,code(e){let[t,r]=AO(e);wh(e,t),$h(e,r)}};function AO({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 wh(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 a in t){let i=t[a];if(i.length===0)continue;let c=Yt.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)Yt.checkReportMissingProp(e,u)});else r.if(ns._`${c} && (${Yt.checkMissingProp(e,i,o)})`),Yt.reportMissingProp(e,o),r.else()}}Eh.validatePropertyDeps=wh;function $h(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(bh.alwaysValidSchema(o,t[i]))continue;r.if(Yt.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}Eh.validateSchemaDeps=$h;Eh.default=TO});var Th=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});var Pa=Y(),Rh=re(),PO={message:"property name must be valid",params:({params:e})=>Pa._`{propertyName: ${e.propertyName}}`},IO={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:PO,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Rh.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(Pa.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};kh.default=IO});var _u=g(function(Ah){Object.defineProperty(Ah,"__esModule",{value:!0});var zr=ht(),ke=Y(),jO=pt(),Gr=re(),qO={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},DO={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&Gr.alwaysValidSchema(a,r))return;let u=zr.allSchemaProperties(n.properties),l=zr.allSchemaProperties(n.patternProperties);d(),e.ok(ke._`${o} === ${jO.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=Gr.schemaRefOrVal(a,n.properties,"properties");v=zr.isOwnProperty(t,A,y)}else if(u.length)v=ke.or(...u.map((A)=>ke._`${y} === ${A}`));else v=ke.nil;if(l.length)v=ke.or(v,...l.map((A)=>ke._`${zr.usePattern(e,A)}.test(${y})`));return ke.not(v)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!Gr.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(ke.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(ke.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Gr.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};Ah.default=DO});var Ih=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var Nh=eo(),Ia=ht(),ss=re(),Oh=_u(),LO={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)Oh.default.code(new Nh.KeywordCxt(o,Oh.default,"additionalProperties"));let a=Ia.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=ss.mergeEvaluated.props(t,ss.toHash(a),o.props);let i=a.filter((d)=>!ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(Ia.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Ph.default=LO});var jh=g(function(Ch){Object.defineProperty(Ch,"__esModule",{value:!0});var Ca=ht(),Kr=Y(),ja=re(),qa=re(),FO={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=Ca.allSchemaProperties(r),c=i.filter((h)=>ja.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof Kr.Name))o.props=qa.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))ja.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(Kr._`${Ca.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:qa.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(Kr._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(Kr.not(l),()=>t.break())})})}}};Ch.default=FO});var Mh=g(function(Dh){Object.defineProperty(Dh,"__esModule",{value:!0});var qh=re(),zO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(qh.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"}};Dh.default=zO});var Fh=g(function(Uh){Object.defineProperty(Uh,"__esModule",{value:!0});var Lh=ht(),KO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lh.validateUnion,error:{message:"must match a schema in anyOf"}};Uh.default=KO});var Gh=g(function(zh){Object.defineProperty(zh,"__esModule",{value:!0});var Hr=Y(),Vh=re(),BO={message:"must match exactly one schema in oneOf",params:({params:e})=>Hr._`{passingSchemas: ${e.passing}}`},WO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:BO,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,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(Vh.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(Hr._`${c} && ${a}`).assign(a,!1).assign(i,Hr._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,Hr.Name)})})}}};zh.default=WO});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Kh=re(),XO={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,a)=>{if(Kh.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};Hh.default=XO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Br=Y(),Da=re(),QO={message:({params:e})=>Br.str`must match "${e.ifClause}" schema`,params:({params:e})=>Br._`{failingKeyword: ${e.ifClause}}`},ZO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:QO,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Da.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Wh(n,"then"),o=Wh(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(Br.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,Br._`${l}`);else e.setParams({ifClause:l})}}}};function Wh(e,t){let r=e.schema[t];return r!==void 0&&!Da.alwaysValidSchema(e,r)}Yh.default=ZO});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Jh=re(),tN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Jh.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Qh.default=tN});var tg=g(function(eg){Object.defineProperty(eg,"__esModule",{value:!0});var nN=gu(),sN=fh(),oN=yu(),aN=yh(),iN=vh(),cN=Na(),uN=Th(),lN=_u(),dN=Ih(),fN=jh(),pN=Mh(),mN=Fh(),hN=Gh(),gN=Bh(),yN=Xh(),_N=Zh();function vN(e=!1){let t=[pN.default,mN.default,hN.default,gN.default,yN.default,_N.default,uN.default,lN.default,cN.default,dN.default,fN.default];if(e)t.push(sN.default,aN.default);else t.push(nN.default,oN.default);return t.push(iN.default),t}eg.default=vN});var vu=g(function(sg){Object.defineProperty(sg,"__esModule",{value:!0});sg.dynamicAnchor=void 0;var os=Y(),wN=pt(),Ma=no(),rg=Ra(),$N={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>ng(e,e.schema)};function ng(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=os._`${wN.default.dynamicAnchors}${os.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:EN(e);r.if(os._`!${s}`,()=>r.assign(s,o))}sg.dynamicAnchor=ng;function EN(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:a,meta:i}=t.root,{schemaId:c}=n.opts,u=new Ma.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:a,meta:i});return Ma.compileSchema.call(n,u),rg.getValidate(e,u)}sg.default=$N});var bu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var La=Y(),xN=pt(),Ua=Ra(),RN={keyword:"$dynamicRef",schemaType:"string",code:(e)=>ag(e,e.schema)};function ag(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)a();else{let c=r.let("valid",!1);a(c),e.ok(c)}function a(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",La._`${xN.default.dynamicAnchors}${La.getProperty(o)}`);r.if(u,i(u,c),i(s.validateName,c))}else i(s.validateName,c)()}function i(c,u){return u?()=>r.block(()=>{Ua.callRef(e,c),r.let(u,!0)}):()=>Ua.callRef(e,c)}}ig.dynamicRef=ag;ig.default=RN});var fg=g(function(dg){Object.defineProperty(dg,"__esModule",{value:!0});var ug=vu(),lg=re(),TN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)ug.dynamicAnchor(e,"");else lg.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};dg.default=TN});var hg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var pg=bu(),ON={keyword:"$recursiveRef",schemaType:"string",code:(e)=>pg.dynamicRef(e,e.schema)};mg.default=ON});var yg=g(function(gg){Object.defineProperty(gg,"__esModule",{value:!0});var PN=vu(),IN=bu(),CN=fg(),jN=hg(),qN=[PN.default,IN.default,CN.default,jN.default];gg.default=qN});var vg=g(function(_g){Object.defineProperty(_g,"__esModule",{value:!0});var Fa=Na(),MN={keyword:"dependentRequired",type:"object",schemaType:"object",error:Fa.error,code:(e)=>Fa.validatePropertyDeps(e)};_g.default=MN});var $g=g(function(wg){Object.defineProperty(wg,"__esModule",{value:!0});var bg=Na(),UN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>bg.validateSchemaDeps(e)};wg.default=UN});var xg=g(function(Sg){Object.defineProperty(Sg,"__esModule",{value:!0});var Eg=re(),VN={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)Eg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};Sg.default=VN});var kg=g(function(Rg){Object.defineProperty(Rg,"__esModule",{value:!0});var GN=vg(),KN=$g(),HN=xg(),BN=[GN.default,KN.default,HN.default];Rg.default=BN});var Ag=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ke=Y(),Va=re(),YN=pt(),XN={message:"must NOT have unevaluated properties",params:({params:e})=>Ke._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},JN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:XN,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,props:i}=o;if(i instanceof Ke.Name)t.if(Ke._`${i} !== true`,()=>t.forIn("key",n,(d)=>t.if(u(i,d),()=>c(d))));else if(i!==!0)t.forIn("key",n,(d)=>i===void 0?c(d):t.if(l(i,d),()=>c(d)));o.props=!0,e.ok(Ke._`${s} === ${YN.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!a)t.break();return}if(!Va.alwaysValidSchema(o,r)){let m=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:Va.Type.Str},m),!a)t.if(Ke.not(m),()=>t.break())}}function u(d,m){return Ke._`!${d} || !${d}[${m}]`}function l(d,m){let f=[];for(let p in d)if(d[p]===!0)f.push(Ke._`${m} !== ${p}`);return Ke.and(...f)}}};Tg.default=JN});var Ng=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),za=re(),ZN={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},eP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:ZN,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let a=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${a} > ${o}`);else if(typeof r=="object"&&!za.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${a} <= ${o}`);t.if(ot.not(c),()=>i(c,o)),e.ok(c)}s.items=!0;function i(c,u){t.forRange("i",u,a,(l)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:za.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=eP});var Ig=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var rP=Ag(),nP=Ng(),sP=[rP.default,nP.default];Pg.default=sP});var jg=g(function(Cg){Object.defineProperty(Cg,"__esModule",{value:!0});var X=Y(),aP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},iP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",X._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(X._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,X._`${h}.type || "string"`).assign(v,X._`${h}.validate`),()=>r.assign(y,X._`"string"`).assign(v,h)),e.fail$data(X.or(A(),k()));function A(){if(c.strictSchema===!1)return X.nil;return X._`${a} && !${v}`}function k(){let M=l.$async?X._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:X._`${v}(${n})`,S=X._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return X._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return X._`await ${v}(${n})`}return typeof y=="function"?X._`${v}(${n})`:X._`${v}.test(${n})`}}}};Cg.default=iP});var Dg=g(function(qg){Object.defineProperty(qg,"__esModule",{value:!0});var uP=jg(),lP=[uP.default];qg.default=lP});var Ug=g(function(Mg){Object.defineProperty(Mg,"__esModule",{value:!0});Mg.contentVocabulary=Mg.metadataVocabulary=void 0;Mg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Vg=g(function(Fg){Object.defineProperty(Fg,"__esModule",{value:!0});var pP=Em(),mP=rh(),hP=tg(),gP=yg(),yP=kg(),_P=Ig(),vP=Dg(),Ga=Ug(),bP=[gP.default,pP.default,mP.default,(0,hP.default)(!0),vP.default,Ga.metadataVocabulary,Ga.contentVocabulary,yP.default,_P.default];Fg.default=bP});var Hg=g(function(Gg){Object.defineProperty(Gg,"__esModule",{value:!0});Gg.DiscrError=void 0;var zg;(function(e){e.Tag="tag",e.Mapping="mapping"})(zg||(Gg.DiscrError=zg={}))});var Yg=g(function(Wg){Object.defineProperty(Wg,"__esModule",{value:!0});var gt=Y(),as=Hg(),Ka=no(),$P=to(),Bg=re(),EP={message:({params:{discrError:e,tagName:t}})=>e===as.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}}`},SP={keyword:"discriminator",type:"object",schemaType:"object",error:EP,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(i)}`);t.if(gt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:as.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(gt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:as.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,gt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Bg.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ka.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ka.SchemaEnv)S=S.schema;if(S===void 0)throw new $P.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Wg.default=SP});var Xg=g(function(PG,RP){RP.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 Jg=g(function(IG,kP){kP.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 Qg=g(function(CG,TP){TP.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 Zg=g(function(jG,AP){AP.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 ey=g(function(qG,OP){OP.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 ty=g(function(DG,NP){NP.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 ry=g(function(MG,PP){PP.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 ny=g(function(LG,IP){IP.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 oy=g(function(sy){Object.defineProperty(sy,"__esModule",{value:!0});var CP=Xg(),jP=Jg(),qP=Qg(),DP=Zg(),MP=ey(),LP=ty(),UP=ry(),FP=ny(),VP=["/properties"];function zP(e){return[CP,jP,qP,DP,MP,t(this,LP),UP,t(this,FP)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,VP):n}}sy.default=zP});var ay=g(function(at,$u){Object.defineProperty(at,"__esModule",{value:!0});at.MissingRefError=at.ValidationError=at.CodeGen=at.Name=at.nil=at.stringify=at.str=at._=at.KeywordCxt=at.Ajv2020=void 0;var KP=gm(),HP=Vg(),BP=Yg(),WP=oy(),wu="https://json-schema.org/draft/2020-12/schema";class oo extends KP.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),HP.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(BP.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;WP.default.call(this,e),this.refs["http://json-schema.org/schema"]=wu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wu)?wu:void 0)}}at.Ajv2020=oo;$u.exports=at=oo;$u.exports.Ajv2020=oo;Object.defineProperty(at,"__esModule",{value:!0});at.default=oo;var YP=eo();Object.defineProperty(at,"KeywordCxt",{enumerable:!0,get:function(){return YP.KeywordCxt}});var is=Y();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return is._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return is.str}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return is.stringify}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return is.nil}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return is.Name}});Object.defineProperty(at,"CodeGen",{enumerable:!0,get:function(){return is.CodeGen}});var XP=ha();Object.defineProperty(at,"ValidationError",{enumerable:!0,get:function(){return XP.default}});var JP=to();Object.defineProperty(at,"MissingRefError",{enumerable:!0,get:function(){return JP.default}})});var gy=g(function(my){Object.defineProperty(my,"__esModule",{value:!0});my.formatNames=my.fastFormats=my.fullFormats=void 0;function Xt(e,t){return{validate:e,compare:t}}my.fullFormats={date:Xt(ly,Ru),time:Xt(Su(!0),ku),"date-time":Xt(iy(!0),fy),"iso-time":Xt(Su(),dy),"iso-date-time":Xt(iy(),py),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:oI,"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:fI,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:aI,int32:{type:"number",validate:uI},int64:{type:"number",validate:lI},float:{type:"number",validate:uy},double:{type:"number",validate:uy},password:!0,binary:!0};my.fastFormats={...my.fullFormats,date:Xt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ru),time:Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ku),"date-time":Xt(/^\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,fy),"iso-time":Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dy),"iso-date-time":Xt(/^\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,py),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};my.formatNames=Object.keys(my.fullFormats);function eI(e){return e%4===0&&(e%100!==0||e%400===0)}var tI=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ly(e){let t=tI.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&&eI(r)?29:rI[n])}function Ru(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Eu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Su(e){return function(r){let n=Eu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],a=+n[3],i=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!i)return!1;if(s<=23&&o<=59&&a<60)return!0;let d=o-l*c,m=s-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function ku(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 dy(e,t){if(!(e&&t))return;let r=Eu.exec(e),n=Eu.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 xu=/t|\s/i;function iy(e){let t=Su(e);return function(n){let s=n.split(xu);return s.length===2&&ly(s[0])&&t(s[1])}}function fy(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 py(e,t){if(!(e&&t))return;let[r,n]=e.split(xu),[s,o]=t.split(xu),a=Ru(r,s);if(a===void 0)return;return a||ku(n,o)}var nI=/\/|:/,sI=/^(?:[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 oI(e){return nI.test(e)&&sI.test(e)}var cy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function aI(e){return cy.lastIndex=0,cy.test(e)}var iI=-2147483648,cI=2147483647;function uI(e){return Number.isInteger(e)&&e<=cI&&e>=iI}function lI(e){return Number.isInteger(e)}function uy(){return!0}var dI=/[^\\]\\Z/;function fI(e){if(dI.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(vy){Object.defineProperty(vy,"__esModule",{value:!0});vy.regexpCode=vy.getEsmExportName=vy.getProperty=vy.safeStringify=vy.stringify=vy.strConcat=vy.addCodeArg=vy.str=vy._=vy.nil=vy._Code=vy.Name=vy.IDENTIFIER=vy._CodeOrName=void 0;class Ha{}vy._CodeOrName=Ha;vy.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cs extends Ha{constructor(e){super();if(!vy.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}}}vy.Name=cs;class Tt extends Ha{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 cs)t[r.str]=(t[r.str]||0)+1;return t},{})}}vy._Code=Tt;vy.nil=new Tt("");function yy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new Tt(r)}vy._=yy;var Au=new Tt("+");function _y(e,...t){let r=[ao(e[0])],n=0;while(n<t.length)r.push(Au),Ou(r,t[n]),r.push(Au,ao(e[++n]));return mI(r),new Tt(r)}vy.str=_y;function Ou(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof cs)e.push(t);else e.push(yI(t))}vy.addCodeArg=Ou;function mI(e){let t=1;while(t<e.length-1){if(e[t]===Au){let r=hI(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function hI(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof cs||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 cs))return`"${e}${t.slice(1)}`;return}function gI(e,t){return t.emptyStr()?e:e.emptyStr()?t:_y`${e}${t}`}vy.strConcat=gI;function yI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ao(Array.isArray(e)?e.join(","):e)}function _I(e){return new Tt(ao(e))}vy.stringify=_I;function ao(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vy.safeStringify=ao;function vI(e){return typeof e=="string"&&vy.IDENTIFIER.test(e)?new Tt(`.${e}`):yy`[${e}]`}vy.getProperty=vI;function bI(e){if(typeof e=="string"&&vy.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}vy.getEsmExportName=bI;function wI(e){return new Tt(e.toString())}vy.regexpCode=wI});var Cu=g(function(Ey){Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueScope=Ey.ValueScopeName=Ey.Scope=Ey.varKinds=Ey.UsedValueState=void 0;var he=io();class wy extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Wa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Wa||(Ey.UsedValueState=Wa={}));Ey.varKinds={const:new he.Name("const"),let:new he.Name("let"),var:new he.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof he.Name?e:this.name(e)}name(e){return new he.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}}}Ey.Scope=Pu;class Iu extends he.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=he._`.${new he.Name(t)}[${r}]`}}Ey.ValueScopeName=Iu;var CI=he._`\n`;class $y extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?CI:he.nil}}get(){return this._scope}name(e){return new Iu(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,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[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 he._`${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=he.nil;for(let o in e){let a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,Wa.Started);let u=t(c);if(u){let l=this.opts.es5?Ey.varKinds.var:Ey.varKinds.const;s=he._`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=he._`${s}${u}${this.opts._n}`;else throw new wy(c);i.set(c,Wa.Completed)})}return s}}Ey.ValueScope=$y});var ee=g(function(it){Object.defineProperty(it,"__esModule",{value:!0});it.or=it.and=it.not=it.CodeGen=it.operators=it.varKinds=it.ValueScopeName=it.ValueScope=it.Scope=it.Name=it.regexpCode=it.stringify=it.getProperty=it.nil=it.strConcat=it.str=it._=void 0;var N=io(),Te=Cu(),Wr=io();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Wr._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Wr.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return Wr.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Wr.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return Wr.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Wr.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return Wr.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Wr.Name}});var ei=Cu();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return ei.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return ei.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return ei.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return ei.varKinds}});it.operators={GT:new N._Code(">"),GTE:new N._Code(">="),LT:new N._Code("<"),LTE:new N._Code("<="),EQ:new N._Code("==="),NEQ:new N._Code("!=="),NOT:new N._Code("!"),OR:new N._Code("||"),AND:new N._Code("&&"),ADD:new N._Code("+")};class Yr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xy extends Yr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Te.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=ls(this.rhs,e,t);return this}get names(){return this.rhs instanceof N._CodeOrName?this.rhs.names:{}}}class Du extends Yr{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 N.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ls(this.rhs,e,t),this}get names(){let e=this.lhs instanceof N.Name?{}:{...this.lhs.names};return Za(e,this.rhs)}}class Ry extends Du{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ky extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ay extends Yr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Yr{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=ls(this.code,e,t),this}get names(){return this.code instanceof N._CodeOrName?this.code.names:{}}}class ti extends Yr{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;MI(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Tn(e,t.names),{})}}class Xr extends ti{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ny extends ti{}class co extends Xr{}co.kind="else";class vr extends Xr{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 co(r):r}if(t){if(e===!1)return t instanceof vr?t:t.nodes;if(this.nodes.length)return this;return new vr(qy(e),t instanceof vr?[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=ls(this.condition,e,t),this}get names(){let e=super.names;if(Za(e,this.condition),this.else)Tn(e,this.else.names);return e}}vr.kind="if";class us extends Xr{}us.kind="for";class Py extends us{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=ls(this.iteration,e,t),this}get names(){return Tn(super.names,this.iteration.names)}}class Iy extends us{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Te.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=Za(super.names,this.from);return Za(e,this.to)}}class ju extends us{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=ls(this.iterable,e,t),this}get names(){return Tn(super.names,this.iterable.names)}}class Ya extends Xr{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)}}Ya.kind="func";class Xa extends ti{render(e){return"return "+super.render(e)}}Xa.kind="return";class Cy extends Xr{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)Tn(e,this.catch.names);if(this.finally)Tn(e,this.finally.names);return e}}class Ja extends Xr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ja.kind="catch";class Qa extends Xr{render(e){return"finally"+super.render(e)}}Qa.kind="finally";class jy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
11
+ `:""},this._extScope=e,this._scope=new Te.Scope({parent:e}),this._nodes=[new Ny]}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 xy(e,s,r)),s}const(e,t,r){return this._def(Te.varKinds.const,e,t,r)}let(e,t,r){return this._def(Te.varKinds.let,e,t,r)}var(e,t,r){return this._def(Te.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Du(e,t,r))}add(e,t){return this._leafNode(new Ry(e,it.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==N.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(":"),N.addCodeArg(t,n)}return t.push("}"),new N._Code(t)}if(e,t,r){if(this._blockNode(new vr(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 vr(e))}else(){return this._elseNode(new co)}endIf(){return this._endBlockNode(vr,co)}_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?Te.varKinds.var:Te.varKinds.let){let o=this._scope.toName(e);return this._for(new Iy(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Te.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof N.Name?t:this.var("_arr",t);return this.forRange("_i",0,N._`${o}.length`,(a)=>{this.var(s,N._`${o}[${a}]`),r(s)})}return this._for(new ju("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Te.varKinds.var:Te.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,N._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new ju("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(us)}label(e){return this._leafNode(new ky(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Xa;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Xa)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Cy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Ja(s),t(s)}if(r)this._currNode=n.finally=new Qa,this.code(r);return this._endBlockNode(Ja,Qa)}throw(e){return this._leafNode(new Ay(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=N.nil,r,n){if(this._blockNode(new Ya(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Ya)}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 vr))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}}it.CodeGen=jy;function Tn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Za(e,t){return t instanceof N._CodeOrName?Tn(e,t.names):e}function ls(e,t,r){if(e instanceof N.Name)return n(e);if(!s(e))return e;return new N._Code(e._items.reduce((o,a)=>{if(a instanceof N.Name)a=n(a);if(a instanceof N._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof N._Code&&o._items.some((a)=>a instanceof N.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function MI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function qy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:N._`!${qu(e)}`}it.not=qy;var LI=Dy(it.operators.AND);function UI(...e){return e.reduce(LI)}it.and=UI;var FI=Dy(it.operators.OR);function VI(...e){return e.reduce(FI)}it.or=VI;function Dy(e){return(t,r)=>t===N.nil?r:r===N.nil?t:N._`${qu(t)} ${e} ${qu(r)}`}function qu(e){return e instanceof N.Name?e:N._`(${e})`}});var ce=g(function(By){Object.defineProperty(By,"__esModule",{value:!0});By.checkStrictMode=By.getErrorPath=By.Type=By.useFunc=By.setEvaluated=By.evaluatedPropsToName=By.mergeEvaluated=By.eachItem=By.unescapeJsonPointer=By.escapeJsonPointer=By.escapeFragment=By.unescapeFragment=By.schemaRefOrVal=By.schemaHasRulesButRef=By.schemaHasRules=By.checkUnknownRules=By.alwaysValidSchema=By.toHash=void 0;var F=ee(),Fy=io();function HI(e){let t={};for(let r of e)t[r]=!0;return t}By.toHash=HI;function BI(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Vy(e,t),!zy(t,e.self.RULES.all)}By.alwaysValidSchema=BI;function Vy(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])Hy(e,`unknown keyword: "${o}"`)}By.checkUnknownRules=Vy;function zy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}By.schemaHasRules=zy;function WI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}By.schemaHasRulesButRef=WI;function YI({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return F._`${r}`}return F._`${e}${t}${F.getProperty(n)}`}By.schemaRefOrVal=YI;function XI(e){return Gy(decodeURIComponent(e))}By.unescapeFragment=XI;function JI(e){return encodeURIComponent(Lu(e))}By.escapeFragment=JI;function Lu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}By.escapeJsonPointer=Lu;function Gy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}By.unescapeJsonPointer=Gy;function QI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}By.eachItem=QI;function Ly({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof F.Name?(o instanceof F.Name?e(s,o,a):t(s,o,a),a):o instanceof F.Name?(t(s,a,o),o):r(o,a);return i===F.Name&&!(c instanceof F.Name)?n(s,c):c}}By.mergeEvaluated={props:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>{e.if(F._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,F._`${r} || {}`).code(F._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,F._`${r} || {}`),Uu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ky}),items:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,F._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>e.assign(r,t===!0?!0:F._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Ky(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",F._`{}`);if(t!==void 0)Uu(e,r,t);return r}By.evaluatedPropsToName=Ky;function Uu(e,t,r){Object.keys(r).forEach((n)=>e.assign(F._`${t}${F.getProperty(n)}`,!0))}By.setEvaluated=Uu;var Uy={};function ZI(e,t){return e.scopeValue("func",{ref:t,code:Uy[t.code]||(Uy[t.code]=new Fy._Code(t.code))})}By.useFunc=ZI;var Mu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mu||(By.Type=Mu={}));function eC(e,t,r){if(e instanceof F.Name){let n=t===Mu.Num;return r?n?F._`"[" + ${e} + "]"`:F._`"['" + ${e} + "']"`:n?F._`"/" + ${e}`:F._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?F.getProperty(e).toString():"/"+Lu(e)}By.getErrorPath=eC;function Hy(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}By.checkStrictMode=Hy});var br=g(function(Yy){Object.defineProperty(Yy,"__esModule",{value:!0});var le=ee(),_C={data:new le.Name("data"),valCxt:new le.Name("valCxt"),instancePath:new le.Name("instancePath"),parentData:new le.Name("parentData"),parentDataProperty:new le.Name("parentDataProperty"),rootData:new le.Name("rootData"),dynamicAnchors:new le.Name("dynamicAnchors"),vErrors:new le.Name("vErrors"),errors:new le.Name("errors"),this:new le.Name("this"),self:new le.Name("self"),scope:new le.Name("scope"),json:new le.Name("json"),jsonPos:new le.Name("jsonPos"),jsonLen:new le.Name("jsonLen"),jsonPart:new le.Name("jsonPart")};Yy.default=_C});var uo=g(function(Zy){Object.defineProperty(Zy,"__esModule",{value:!0});Zy.extendErrors=Zy.resetErrorsCount=Zy.reportExtraError=Zy.reportError=Zy.keyword$DataError=Zy.keywordError=void 0;var C=ee(),Jr=ce(),Je=br();Zy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Zy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function bC(e,t=Zy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Qy(e,t,r);if(n!==null&&n!==void 0?n:a||i)Xy(o,c);else Jy(s,C._`[${c}]`)}Zy.reportError=bC;function wC(e,t=Zy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Qy(e,t,r);if(Xy(s,i),!(o||a))Jy(n,Je.default.vErrors)}Zy.reportExtraError=wC;function $C(e,t){e.assign(Je.default.errors,t),e.if(C._`${Je.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Je.default.vErrors}.length`,t),()=>e.assign(Je.default.vErrors,null)))}Zy.resetErrorsCount=$C;function EC({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Je.default.errors,(i)=>{if(e.const(a,C._`${Je.default.vErrors}[${i}]`),e.if(C._`${a}.instancePath === undefined`,()=>e.assign(C._`${a}.instancePath`,C.strConcat(Je.default.instancePath,o.errorPath))),e.assign(C._`${a}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${a}.schema`,r),e.assign(C._`${a}.data`,n)})}Zy.extendErrors=EC;function Xy(e,t){let r=e.const("err",t);e.if(C._`${Je.default.vErrors} === null`,()=>e.assign(Je.default.vErrors,C._`[${r}]`),C._`${Je.default.vErrors}.push(${r})`),e.code(C._`${Je.default.errors}++`)}function Jy(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 An={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 Qy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return SC(e,t,r)}function SC(e,t,r={}){let{gen:n,it:s}=e,o=[xC(s,r),RC(e,r)];return kC(e,t,o),n.object(...o)}function xC({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Jr.getErrorPath(t,Jr.Type.Str)}`:e;return[Je.default.instancePath,C.strConcat(Je.default.instancePath,r)]}function RC({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Jr.getErrorPath(r,Jr.Type.Str)}`;return[An.schemaPath,s]}function kC(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([An.keyword,s],[An.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([An.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([An.schema,a],[An.parentSchema,C._`${l}${d}`],[Je.default.data,o]);if(u)n.push([An.propertyName,u])}});var a_=g(function(s_){Object.defineProperty(s_,"__esModule",{value:!0});s_.boolOrEmptySchema=s_.topBoolOrEmptySchema=void 0;var t_=uo(),r_=ee(),PC=br(),IC={message:"boolean schema is false"};function CC(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)n_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(PC.default.data);else t.assign(r_._`${n}.errors`,null),t.return(!0)}s_.topBoolOrEmptySchema=CC;function jC(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),n_(e);else r.var(t,!0)}s_.boolOrEmptySchema=jC;function n_(e,t){let{gen:r,data:n}=e;t_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},IC,void 0,t)}});var Vu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var DC=["string","number","integer","boolean","null","object","array"],MC=new Set(DC);function LC(e){return typeof e=="string"&&MC.has(e)}i_.isJSONType=LC;function UC(){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=UC});var zu=g(function(d_){Object.defineProperty(d_,"__esModule",{value:!0});d_.shouldUseRule=d_.shouldUseGroup=d_.schemaHasRulesForType=void 0;function VC({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&u_(e,n)}d_.schemaHasRulesForType=VC;function u_(e,t){return t.rules.some((r)=>l_(e,r))}d_.shouldUseGroup=u_;function l_(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))}d_.shouldUseRule=l_});var lo=g(function(__){Object.defineProperty(__,"__esModule",{value:!0});__.reportTypeError=__.checkDataTypes=__.checkDataType=__.coerceAndCheckDataType=__.getJSONTypes=__.getSchemaTypes=__.DataType=void 0;var p_=Vu(),m_=zu(),h_=uo(),R=ee(),ni=ce(),ds;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ds||(__.DataType=ds={}));function KC(e){let t=g_(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}__.getSchemaTypes=KC;function g_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(p_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}__.getJSONTypes=g_;function HC(e,t){let{gen:r,data:n,opts:s}=e,o=BC(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&m_.schemaHasRulesForType(e,t[0]));if(a){let i=Ku(t,n,s.strictNumbers,ds.Wrong);r.if(i,()=>{if(o.length)WC(e,t,o);else Hu(e)})}return a}__.coerceAndCheckDataType=HC;var y_=new Set(["string","number","integer","boolean","null"]);function BC(e,t){return t?e.filter((r)=>y_.has(r)||t==="array"&&r==="array"):[]}function WC(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",R._`typeof ${s}`),i=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(a,R._`typeof ${s}`).if(Ku(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(R._`${i} !== undefined`);for(let u of r)if(y_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Hu(e),n.endIf(),n.if(R._`${i} !== undefined`,()=>{n.assign(s,i),YC(e,i)});function c(u){switch(u){case"string":n.elseIf(R._`${a} == "number" || ${a} == "boolean"`).assign(i,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(i,R._`""`);return;case"number":n.elseIf(R._`${a} == "boolean" || ${s} === null
12
+ || (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,R._`+${s}`);return;case"integer":n.elseIf(R._`${a} === "boolean" || ${s} === null
13
+ || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,R._`+${s}`);return;case"boolean":n.elseIf(R._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf(R._`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf(R._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf(R._`${a} === "string" || ${a} === "number"
14
+ || ${a} === "boolean" || ${s} === null`).assign(i,R._`[${s}]`)}}}function YC({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function Gu(e,t,r,n=ds.Correct){let s=n===ds.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=a(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return R._`typeof ${t} ${s} ${e}`}return n===ds.Correct?o:R.not(o);function a(i=R.nil){return R.and(R._`typeof ${t} == "number"`,i,r?R._`isFinite(${t})`:R.nil)}}__.checkDataType=Gu;function Ku(e,t,r,n){if(e.length===1)return Gu(e[0],t,r,n);let s,o=ni.toHash(e);if(o.array&&o.object){let a=R._`typeof ${t} != "object"`;s=o.null?a:R._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let a in o)s=R.and(s,Gu(a,t,r,n));return s}__.checkDataTypes=Ku;var XC={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Hu(e){let t=JC(e);h_.reportError(t,XC)}__.reportTypeError=Hu;function JC(e){let{gen:t,data:r,schema:n}=e,s=ni.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var S_=g(function($_){Object.defineProperty($_,"__esModule",{value:!0});$_.assignDefaults=void 0;var yt=ee(),w_=ce();function s1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)b_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>b_(e,o,s.default))}$_.assignDefaults=s1;function b_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=yt._`${o}${yt.getProperty(t)}`;if(s){w_.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=yt._`${i} === undefined`;if(a.useDefaults==="empty")c=yt._`${c} || ${i} === null || ${i} === ""`;n.if(c,yt._`${i} = ${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=ee(),fs=ce(),Qr=br(),x_=ce();function o1(e,t){let{gen:r,data:n,it:s}=e;r.if(Wu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=o1;function a1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Wu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=a1;function i1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=i1;function R_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=R_;function Bu(e,t,r){return z._`${R_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Bu;function c1(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Bu(e,t,r)}`:s}T_.propertyInData=c1;function Wu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Bu(e,t,r))):s}T_.noPropertyInData=Wu;function k_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=k_;function u1(e,t){return k_(t).filter((r)=>!fs.alwaysValidSchema(e,t[r]))}T_.schemaProperties=u1;function l1({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?z._`${e}, ${t}, ${n}${s}`:t,d=[[Qr.default.instancePath,z.strConcat(Qr.default.instancePath,o)],[Qr.default.parentData,a.parentData],[Qr.default.parentDataProperty,a.parentDataProperty],[Qr.default.rootData,Qr.default.rootData]];if(a.opts.dynamicRef)d.push([Qr.default.dynamicAnchors,Qr.default.dynamicAnchors]);let m=z._`${l}, ${r.object(...d)}`;return c!==z.nil?z._`${i}.call(${c}, ${m})`:z._`${i}(${m})`}T_.callValidateCode=l1;var d1=z._`new RegExp`;function f1({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"?d1:x_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=f1;function p1(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:fs.Type.Num},o),t.if(z.not(o),i)})}}T_.validateArray=p1;function m1(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>fs.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,z._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(z.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=m1});var q_=g(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});C_.validateKeywordUsage=C_.validSchemaType=C_.funcKeywordCode=C_.macroKeywordCode=void 0;var fe=ee(),On=br(),N_=_t(),P_=uo();function k1(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=I_(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:fe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}C_.macroKeywordCode=k1;function T1(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;O1(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=I_(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)O_(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)O_(e);y(()=>A1(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(fe._`await `),(A)=>n.assign(d,!1).if(fe._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,fe._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=fe._`${l}.errors`;return n.assign(v,null),h(fe.nil),v}function h(v=t.async?fe._`await `:fe.nil){let A=c.opts.passContext?On.default.this:On.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,fe._`${v}${N_.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(fe.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}C_.funcKeywordCode=T1;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,fe._`${n.parentData}[${n.parentDataProperty}]`))}function A1(e,t){let{gen:r}=e;r.if(fe._`Array.isArray(${t})`,()=>{r.assign(On.default.vErrors,fe._`${On.default.vErrors} === null ? ${t} : ${On.default.vErrors}.concat(${t})`).assign(On.default.errors,fe._`${On.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function O1({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function I_(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:fe.stringify(r)})}function N1(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")}C_.validSchemaType=N1;function P1({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 a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.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)}}}C_.validateKeywordUsage=P1});var L_=g(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});D_.extendSubschemaMode=D_.extendSubschemaData=D_.getSubschema=void 0;var De=ee(),si=ce();function q1(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:De._`${e.schemaPath}${De.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:De._`${e.schemaPath}${De.getProperty(t)}${De.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${si.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}D_.getSubschema=q1;function D1(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",De._`${t.data}${De.getProperty(r)}`,!0);c(m),e.errorPath=De.str`${u}${si.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=De._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof De.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}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]}}D_.extendSubschemaData=D1;function M1(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}D_.extendSubschemaMode=M1});var fo=g(function(G_){Object.defineProperty(G_,"__esModule",{value:!0});G_.getSchemaRefs=G_.resolveUrl=G_.normalizeId=G_._getFullPath=G_.getFullPath=G_.inlineRef=void 0;var U_=ce(),F1=Qs(),V1=nu(),z1=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function G1(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Yu(e);if(!t)return!1;return F_(e)<=t}G_.inlineRef=G1;var K1=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yu(e){for(let t in e){if(K1.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Yu))return!0;if(typeof r=="object"&&Yu(r))return!0}return!1}function F_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,z1.has(r))continue;if(typeof e[r]=="object")U_.eachItem(e[r],(n)=>t+=F_(n));if(t===1/0)return 1/0}return t}function V_(e,t="",r){if(r!==!1)t=ps(t);let n=e.parse(t);return z_(e,n)}G_.getFullPath=V_;function z_(e,t){return e.serialize(t).split("#")[0]+"#"}G_._getFullPath=z_;var H1=/#\/?$/;function ps(e){return e?e.replace(H1,""):""}G_.normalizeId=ps;function B1(e,t,r){return r=ps(r),e.resolve(t,r)}G_.resolveUrl=B1;var W1=/^[a-z_][-a-z0-9._]*$/i;function Y1(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(e[r]||t),o={"":s},a=V_(n,s,!1),i={},c=new Set;return V1(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=ps(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==ps(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!W1.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!F1(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}G_.getSchemaRefs=Y1});var po=g(function(av){Object.defineProperty(av,"__esModule",{value:!0});av.getData=av.KeywordCxt=av.validateFunctionCode=void 0;var ai=a_(),oi=lo(),hs=zu(),Zr=lo(),Y_=S_(),Qt=q_(),ms=L_(),w=ee(),B=br(),X_=fo(),Ue=ce(),Jt=uo();function tj(e){if(Z_(e)){if(ev(e),Q_(e)){sj(e);return}}J_(e,()=>ai.topBoolOrEmptySchema(e))}av.validateFunctionCode=tj;function J_({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"; ${H_(r,s)}`),nj(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${rj(s)}`,n.$async,()=>e.code(H_(r,s)).code(o))}function rj(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 nj(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 sj(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{if(r.$comment&&t.$comment)rv(e);if(uj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)oj(e);tv(e),fj(e)});return}function oj(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 H_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function aj(e,t){if(Z_(e)){if(ev(e),Q_(e)){ij(e,t);return}}ai.boolOrEmptySchema(e,t)}function Q_({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 Z_(e){return typeof e.schema!="boolean"}function ij(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)rv(e);lj(e),dj(e);let o=n.const("_errs",B.default.errors);tv(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function ev(e){Ue.checkUnknownRules(e),cj(e)}function tv(e,t){if(e.opts.jtd)return B_(e,[],!1,t);let r=oi.getSchemaTypes(e.schema),n=oi.coerceAndCheckDataType(e,r);B_(e,r,!n,t)}function cj(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Ue.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function uj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Ue.checkStrictMode(e,"default is ignored in the schema root")}function lj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=X_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function dj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function rv({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 a=w.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function fj(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)pj(e);t.return(w._`${B.default.errors} === 0`)}}function pj({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 B_(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Ue.schemaHasRulesButRef(o,l))){s.block(()=>sv(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)mj(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!hs.shouldUseGroup(o,m))return;if(m.type){if(s.if(Zr.checkDataType(m.type,a,c.strictNumbers)),W_(e,m),t.length===1&&t[0]===m.type&&r)s.else(),Zr.reportTypeError(e);s.endIf()}else W_(e,m);if(!i)s.if(w._`${B.default.errors} === ${n||0}`)}}function W_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Y_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(hs.shouldUseRule(n,o))sv(e,o.keyword,o.definition,t.type)})}function mj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(hj(e,t),!e.opts.allowUnionTypes)gj(e,t);yj(e,e.dataTypes)}function hj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!nv(e.dataTypes,r))Xu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),vj(e,t)}function gj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Xu(e,"use allowUnionTypes to allow union type keyword")}function yj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&hs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>_j(t,a)))Xu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function _j(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function vj(e,t){let r=[];for(let n of e.dataTypes)if(nv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Xu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Ue.checkStrictMode(e,t,e.opts.strictTypes)}class Ju{constructor(e,t,r){if(Qt.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=Ue.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",ov(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qt.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?Jt.reportExtraError:Jt.reportError)(this,this.def.error,t)}$dataError(){Jt.reportError(this,this.def.$dataError||Jt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Jt.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(),a());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return w._`${Zr.checkDataTypes(i,t,s.opts.strictNumbers,Zr.DataType.Wrong)}`}return w.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${i}(${t})`}return w.nil}}subschema(e,t){let r=ms.getSubschema(this.it,e);ms.extendSubschemaData(r,this.it,e),ms.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return aj(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=Ue.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Ue.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}}av.KeywordCxt=Ju;function sv(e,t,r,n){let s=new Ju(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Qt.funcKeywordCode(s,r);else if("macro"in r)Qt.macroKeywordCode(s,r);else if(r.compile||r.validate)Qt.funcKeywordCode(s,r)}var bj=/^\/(?:[^~]|~0|~1)*$/,wj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ov(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!bj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=wj.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=w._`${o}${w.getProperty(Ue.unescapeJsonPointer(u))}`,a=w._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}av.getData=ov});var ii=g(function(uv){Object.defineProperty(uv,"__esModule",{value:!0});class cv extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}uv.default=cv});var mo=g(function(dv){Object.defineProperty(dv,"__esModule",{value:!0});var gs=fo();class lv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=gs.resolveUrl(e,t,r),this.missingSchema=gs.normalizeId(gs.getFullPath(e,this.missingRef))}}dv.default=lv});var li=g(function(mv){Object.defineProperty(mv,"__esModule",{value:!0});mv.resolveSchema=mv.getCompilingSchema=mv.resolveRef=mv.compileSchema=mv.SchemaEnv=void 0;var Ae=ee(),Rj=ii(),Nn=br(),Oe=fo(),ci=ce(),fv=po();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:Oe.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={}}}mv.SchemaEnv=ho;function Zu(e){let t=pv.call(this,e);if(t)return t;let r=Oe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:Rj.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Nn.default.data,parentData:Nn.default.parentData,parentDataProperty:Nn.default.parentDataProperty,dataNames:[Nn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,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},l;try{this._compilations.add(e),fv.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(Nn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${Nn.default.self}`,`${Nn.default.scope}`,l)(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:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof Ae.Name?void 0:p,items:h instanceof Ae.Name?void 0:h,dynamicProps:p instanceof Ae.Name,dynamicItems:h instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}mv.compileSchema=Zu;function kj(e,t,r){var n;r=Oe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=Oj.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ho({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=Tj.call(this,o)}mv.resolveRef=kj;function Tj(e){if(Oe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Zu.call(this,e)}function pv(e){for(let t of this._compilations)if(Aj(t,e))return t}mv.getCompilingSchema=pv;function Aj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Oj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ui.call(this,e,t)}function ui(e,t){let r=this.opts.uriResolver.parse(t),n=Oe._getFullPath(this.opts.uriResolver,r),s=Oe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qu.call(this,r,e);let o=Oe.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ui.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return Qu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)Zu.call(this,a);if(o===Oe.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Oe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:i,schemaId:c,root:e,baseId:s})}return Qu.call(this,r,a)}mv.resolveSchema=ui;var Nj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ci.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Nj.has(i)&&u)t=Oe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ci.schemaHasRulesButRef(r,this.RULES)){let i=Oe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ui.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ho({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var gv=g(function(kK,qj){qj.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 vv=g(function(_v){Object.defineProperty(_v,"__esModule",{value:!0});var yv=mu();yv.code='require("ajv/dist/runtime/uri").default';_v.default=yv});var Av=g(function(wr){Object.defineProperty(wr,"__esModule",{value:!0});wr.CodeGen=wr.Name=wr.nil=wr.stringify=wr.str=wr._=wr.KeywordCxt=void 0;var Mj=po();Object.defineProperty(wr,"KeywordCxt",{enumerable:!0,get:function(){return Mj.KeywordCxt}});var _s=ee();Object.defineProperty(wr,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(wr,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(wr,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(wr,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(wr,"Name",{enumerable:!0,get:function(){return _s.Name}});Object.defineProperty(wr,"CodeGen",{enumerable:!0,get:function(){return _s.CodeGen}});var Lj=ii(),Sv=mo(),xv=Vu(),Zt=li(),Rv=ee(),er=fo(),en=lo(),ys=ce(),bv=gv(),Uj=vv(),kv=(e,t)=>new RegExp(e,t);kv.code="new RegExp";var Fj=["removeAdditional","useDefaults","coerceTypes"],Vj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),zj={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."},Gj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wv=200;function Kj(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,Ct;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:kv,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:Uj.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:wv,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:wv,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!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:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(Ct=e.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Ln}}class di{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Kj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rv.ValueScope({scope:{},prefixes:Vj,es5:t,lines:r}),this.logger=Jj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=xv.getRules(),$v.call(this,zj,e,"NOT SUPPORTED"),$v.call(this,Gj,e,"DEPRECATED","warn"),this._metaOpts=Yj.call(this),e.formats)Bj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Wj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Hj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=bv;if(r==="id")n={...bv},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,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}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(l){if(!(l instanceof Sv.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;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=er.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=Ev.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Zt.SchemaEnv({schema:{},schemaId:r});if(t=Zt.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=Ev.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=er.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(Zj.call(this,r,t),!t)return ys.eachItem(r,(s)=>el.call(this,s)),this;tq.call(this,t);let n={...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)};return ys.eachItem(r,n.type.length===0?(s)=>el.call(this,s,n):(s)=>n.type.forEach((o)=>el.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 a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=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:a}=this.opts;if(typeof e=="object")o=e[a];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 i=this._cache.get(e);if(i!==void 0)return i;r=er.normalizeId(o||r);let c=er.getSchemaRefs.call(this,e,r);if(i=new Zt.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_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 Zt.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{Zt.compileSchema.call(this,e)}finally{this.opts=t}}}di.ValidationError=Lj.default;di.MissingRefError=Sv.default;wr.default=di;function $v(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 Ev(e){return e=er.normalizeId(e),this.schemas[e]||this.refs[e]}function Hj(){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 Bj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Wj(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 Yj(){let e={...this.opts};for(let t of Fj)delete e[t];return e}var Xj={log(){},warn(){},error(){}};function Jj(e){if(e===!1)return Xj;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 Qj=/^[a-z_$][a-z0-9_$:-]*$/i;function Zj(e,t){let{RULES:r}=this;if(ys.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Qj.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 el(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,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)}};if(t.before)eq.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function eq(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 tq(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 rq={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,rq]}}});var Nv=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var oq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=oq});var jv=g(function(Iv){Object.defineProperty(Iv,"__esModule",{value:!0});Iv.callRef=Iv.getValidate=void 0;var iq=mo(),pi=_t(),ge=ee(),vs=br(),mi=li(),tn=ce(),cq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=mi.resolveRef.call(c,u,s,r);if(l===void 0)throw new iq.default(n.opts.uriResolver,s,r);if(l instanceof mi.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return fi(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return fi(e,ge._`${p}.validate`,u,u.$async)}function m(p){let h=Pv(e,p);fi(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:ge.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:ge.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),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`}Iv.getValidate=Pv;function fi(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?vs.default.this:ge.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(ge._`await ${pi.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(ge._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(pi.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=ge._`${p}.errors`;s.assign(vs.default.vErrors,ge._`${vs.default.vErrors} === null ? ${h} : ${vs.default.vErrors}.concat(${h})`),s.assign(vs.default.errors,ge._`${vs.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=tn.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",ge._`${p}.evaluated.props`);o.props=tn.mergeEvaluated.props(s,v,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=tn.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",ge._`${p}.evaluated.items`);o.items=tn.mergeEvaluated.items(s,v,o.items,ge.Name)}}}Iv.callRef=fi;Iv.default=cq});var Dv=g(function(qv){Object.defineProperty(qv,"__esModule",{value:!0});var dq=Nv(),fq=jv(),pq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",dq.default,fq.default];qv.default=pq});var Lv=g(function(Mv){Object.defineProperty(Mv,"__esModule",{value:!0});var nn=ee(),rn=nn.operators,hi={maximum:{okStr:"<=",ok:rn.LTE,fail:rn.GT},minimum:{okStr:">=",ok:rn.GTE,fail:rn.LT},exclusiveMaximum:{okStr:"<",ok:rn.LT,fail:rn.GTE},exclusiveMinimum:{okStr:">",ok:rn.GT,fail:rn.LTE}},hq={message:({keyword:e,schemaCode:t})=>nn.str`must be ${hi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>nn._`{comparison: ${hi[e].okStr}, limit: ${t}}`},gq={keyword:Object.keys(hi),type:"number",schemaType:"number",$data:!0,error:hq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(nn._`${r} ${hi[t].fail} ${n} || isNaN(${r})`)}};Mv.default=gq});var Fv=g(function(Uv){Object.defineProperty(Uv,"__esModule",{value:!0});var tr=ee(),_q={message:({schemaCode:e})=>tr.str`must be multiple of ${e}`,params:({schemaCode:e})=>tr._`{multipleOf: ${e}}`},vq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_q,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?tr._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:tr._`${a} !== parseInt(${a})`;e.fail$data(tr._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Uv.default=vq});var Gv=g(function(zv){Object.defineProperty(zv,"__esModule",{value:!0});function Vv(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}zv.default=Vv;Vv.code='require("ajv/dist/runtime/ucs2length").default'});var Bv=g(function(Hv){Object.defineProperty(Hv,"__esModule",{value:!0});var ct=ee(),Kv=ce(),$q=Gv(),Eq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},Sq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Eq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,a=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Kv.useFunc(e.gen,$q.default)}(${r})`;e.fail$data(ct._`${a} ${o} ${n}`)}};Hv.default=Sq});var Xv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});var Wv=_t(),sn=ee(),Rq={message:({schemaCode:e})=>sn.str`must match pattern "${e}"`,params:({schemaCode:e})=>sn._`{pattern: ${e}}`},kq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Rq,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?sn._`(new RegExp(${s}, ${a}))`:Wv.usePattern(e,n);e.fail$data(sn._`!${i}.test(${t})`)}};Yv.default=kq});var Qv=g(function(Jv){Object.defineProperty(Jv,"__esModule",{value:!0});var rr=ee(),Aq={message({keyword:e,schemaCode:t}){return rr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>rr._`{limit: ${e}}`},Oq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Aq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?rr.operators.GT:rr.operators.LT;e.fail$data(rr._`Object.keys(${r}).length ${s} ${n}`)}};Jv.default=Oq});var t0=g(function(e0){Object.defineProperty(e0,"__esModule",{value:!0});var nr=_t(),sr=ee(),Zv=ce(),Pq={message:({params:{missingProperty:e}})=>sr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>sr._`{missingProperty: ${e}}`},Iq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Pq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Zv.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(sr.nil,d);else for(let f of r)nr.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(nr.checkMissingProp(e,r,f)),nr.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(nr.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,nr.propertyInData(t,s,f,i.ownProperties)),t.if(sr.not(p),()=>{e.error(),t.break()})},sr.nil)}}};e0.default=Iq});var n0=g(function(r0){Object.defineProperty(r0,"__esModule",{value:!0});var or=ee(),jq={message({keyword:e,schemaCode:t}){return or.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>or._`{limit: ${e}}`},qq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?or.operators.GT:or.operators.LT;e.fail$data(or._`${r}.length ${s} ${n}`)}};r0.default=qq});var gi=g(function(o0){Object.defineProperty(o0,"__esModule",{value:!0});var s0=Qs();s0.code='require("ajv/dist/runtime/equal").default';o0.default=s0});var c0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var bs=lo(),ae=ee(),a0=ce(),Lq=gi(),Uq={message:({params:{i:e,j:t}})=>ae.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>ae._`{i: ${e}, j: ${t}}`},Fq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Uq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?bs.getSchemaTypes(o.items):[];e.block$data(c,l,ae._`${a} === false`),e.ok(c);function l(){let p=t.let("i",ae._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(ae._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=bs.checkDataTypes(u,y,i.opts.strictNumbers,bs.DataType.Wrong),A=t.const("indices",ae._`{}`);t.for(ae._`;${p}--;`,()=>{if(t.let(y,ae._`${r}[${p}]`),t.if(v,ae._`continue`),u.length>1)t.if(ae._`typeof ${y} == "string"`,ae._`${y} += "_"`);t.if(ae._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,ae._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(ae._`${A}[${y}] = ${p}`)})}function f(p,h){let y=a0.useFunc(t,Lq.default),v=t.name("outer");t.label(v).for(ae._`;${p}--;`,()=>t.for(ae._`${h} = ${p}; ${h}--;`,()=>t.if(ae._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};i0.default=Fq});var d0=g(function(l0){Object.defineProperty(l0,"__esModule",{value:!0});var ws=ee(),u0=ce(),zq=gi(),Gq={message:"must be equal to constant",params:({schemaCode:e})=>ws._`{allowedValue: ${e}}`},Kq={keyword:"const",$data:!0,error:Gq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ws._`!${u0.useFunc(t,zq.default)}(${r}, ${s})`);else e.fail(ws._`${o} !== ${r}`)}};l0.default=Kq});var m0=g(function(p0){Object.defineProperty(p0,"__esModule",{value:!0});var ar=ee(),f0=ce(),Bq=gi(),Wq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ar._`{allowedValues: ${e}}`},Yq={keyword:"enum",schemaType:"array",$data:!0,error:Wq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=f0.useFunc(t,Bq.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=ar.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(ar._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?ar._`${u()}(${r}, ${f}[${p}])`:ar._`${r} === ${h}`}}};p0.default=Yq});var g0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var Jq=Lv(),Qq=Fv(),Zq=Bv(),eD=Xv(),tD=Qv(),rD=t0(),nD=n0(),sD=c0(),oD=d0(),aD=m0(),iD=[Jq.default,Qq.default,Zq.default,eD.default,tD.default,rD.default,nD.default,sD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},oD.default,aD.default];h0.default=iD});var tl=g(function(_0){Object.defineProperty(_0,"__esModule",{value:!0});_0.validateAdditionalItems=void 0;var ut=ee(),$s=ce(),uD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},lD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:uD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){$s.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}y0(e,n)}};function y0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${i} <= ${t.length}`);else if(typeof n=="object"&&!$s.alwaysValidSchema(a,n)){let u=r.var("valid",ut._`${i} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:$s.Type.Num},u),!a.allErrors)r.if(ut.not(u),()=>r.break())})}}_0.validateAdditionalItems=y0;_0.default=lD});var rl=g(function($0){Object.defineProperty($0,"__esModule",{value:!0});$0.validateTuple=void 0;var yi=ee(),on=ce(),b0=_t(),fD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return w0(e,"additionalItems",t);if(r.items=!0,on.alwaysValidSchema(r,t))return;e.ok(b0.validateArray(e))}};function w0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=on.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",yi._`${o}.length`);r.forEach((d,m)=>{if(on.alwaysValidSchema(i,d))return;n.if(yi._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;on.checkStrictMode(i,y,m.strictTuples)}}}$0.validateTuple=w0;$0.default=fD});var R0=g(function(x0){Object.defineProperty(x0,"__esModule",{value:!0});var S0=rl(),mD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>S0.validateTuple(e,"items")};x0.default=mD});var N0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var _i=ee(),k0=ce(),T0=_t(),A0=tl(),gD={message:({params:{len:e}})=>_i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_i._`{limit: ${e}}`},yD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,k0.alwaysValidSchema(n,t))return;if(s)A0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=yD});var I0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var ve=ee(),an=ce(),vD={message:({params:{min:e,max:t}})=>t===void 0?ve.str`must contain at least ${e} valid item(s)`:ve.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?ve._`{minContains: ${e}}`:ve._`{minContains: ${e}, maxContains: ${t}}`},bD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",ve._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){an.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){an.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(an.alwaysValidSchema(o,r)){let h=ve._`${l} >= ${a}`;if(i!==void 0)h=ve._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(ve._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:an.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(ve._`${h}++`),i===void 0)t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(ve._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0))}}};P0.default=bD});var U0=g(function(D0){Object.defineProperty(D0,"__esModule",{value:!0});D0.validateSchemaDeps=D0.validatePropertyDeps=D0.error=void 0;var Es=ee(),C0=ce(),ir=_t();D0.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},
15
15
  missingProperty: ${n},
16
16
  depsCount: ${t},
17
- deps: ${r}}`};var vD={keyword:"dependencies",type:"object",schemaType:"object",error:D0.error,code(e){let[t,r]=$D(e);j0(e,t),q0(e,r)}};function $D({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 j0(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=cr.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)cr.checkReportMissingProp(e,u)});else r.if($s._`${c} && (${cr.checkMissingProp(e,a,o)})`),cr.reportMissingProp(e,o),r.else()}}D0.validatePropertyDeps=j0;function q0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(C0.alwaysValidSchema(o,t[a]))continue;r.if(cr.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)}}D0.validateSchemaDeps=q0;D0.default=vD});var z0=g(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});var _a=Z(),F0=ae(),ED={message:"property name must be valid",params:({params:e})=>_a._`{propertyName: ${e.propertyName}}`},SD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ED,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(F0.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(_a.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};V0.default=SD});var nl=g(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});var an=vt(),Ie=Z(),RD=$r(),cn=ae(),kD={message:"must NOT have additional properties",params:({params:e})=>Ie._`{additionalProperty: ${e.additionalProperty}}`},TD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kD,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"&&cn.alwaysValidSchema(i,r))return;let u=an.allSchemaProperties(n.properties),d=an.allSchemaProperties(n.patternProperties);l(),e.ok(Ie._`${o} === ${RD.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=cn.schemaRefOrVal(i,n.properties,"properties");_=an.isOwnProperty(t,O,y)}else if(u.length)_=Ie.or(...u.map((O)=>Ie._`${y} === ${O}`));else _=Ie.nil;if(d.length)_=Ie.or(_,...d.map((O)=>Ie._`${an.usePattern(e,O)}.test(${y})`));return Ie.not(_)}function f(y){t.code(Ie._`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"&&!cn.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Ie.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Ie.not(_),()=>t.break())}}function m(y,_,O){let k={keyword:"additionalProperties",dataProp:y,dataPropType:cn.Type.Str};if(O===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,_)}}};G0.default=TD});var W0=g(function(B0){Object.defineProperty(B0,"__esModule",{value:!0});var H0=fo(),va=vt(),bs=ae(),K0=nl(),AD={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)K0.default.code(new H0.KeywordCxt(o,K0.default,"additionalProperties"));let i=va.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=bs.mergeEvaluated.props(t,bs.toHash(i),o.props);let a=i.filter((l)=>!bs.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(va.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)}}};B0.default=AD});var X0=g(function(Y0){Object.defineProperty(Y0,"__esModule",{value:!0});var $a=vt(),un=Z(),ba=ae(),wa=ae(),ID={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=$a.allSchemaProperties(r),c=a.filter((m)=>ba.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 un.Name))o.props=wa.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))ba.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(un._`${$a.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:wa.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(un._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(un.not(d),()=>t.break())})})}}};Y0.default=ID});var Z0=g(function(Q0){Object.defineProperty(Q0,"__esModule",{value:!0});var J0=ae(),CD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(J0.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"}};Q0.default=CD});var r$=g(function(t$){Object.defineProperty(t$,"__esModule",{value:!0});var e$=vt(),qD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e$.validateUnion,error:{message:"must match a schema in anyOf"}};t$.default=qD});var o$=g(function(s$){Object.defineProperty(s$,"__esModule",{value:!0});var ln=Z(),n$=ae(),MD={message:"must match exactly one schema in oneOf",params:({params:e})=>ln._`{passingSchemas: ${e.passing}}`},LD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MD,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(n$.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(ln._`${c} && ${i}`).assign(i,!1).assign(a,ln._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,ln.Name)})})}}};s$.default=LD});var c$=g(function(a$){Object.defineProperty(a$,"__esModule",{value:!0});var i$=ae(),FD={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(i$.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};a$.default=FD});var d$=g(function(l$){Object.defineProperty(l$,"__esModule",{value:!0});var dn=Z(),Ea=ae(),zD={message:({params:e})=>dn.str`must match "${e.ifClause}" schema`,params:({params:e})=>dn._`{failingKeyword: ${e.ifClause}}`},GD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:zD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Ea.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=u$(n,"then"),o=u$(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(dn.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,dn._`${d}`);else e.setParams({ifClause:d})}}}};function u$(e,t){let r=e.schema[t];return r!==void 0&&!Ea.alwaysValidSchema(e,r)}l$.default=GD});var h$=g(function(p$){Object.defineProperty(p$,"__esModule",{value:!0});var f$=ae(),HD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)f$.checkStrictMode(r,`"${e}" without "if" is ignored`)}};p$.default=HD});var g$=g(function(m$){Object.defineProperty(m$,"__esModule",{value:!0});var WD=tl(),YD=R0(),XD=rl(),JD=N0(),QD=P0(),ZD=U0(),eM=z0(),tM=nl(),rM=W0(),nM=X0(),sM=Z0(),oM=r$(),iM=o$(),aM=c$(),cM=d$(),uM=h$();function lM(e=!1){let t=[sM.default,oM.default,iM.default,aM.default,cM.default,uM.default,eM.default,tM.default,ZD.default,rM.default,nM.default];if(e)t.push(YD.default,JD.default);else t.push(WD.default,XD.default);return t.push(QD.default),t}m$.default=lM});var _$=g(function(y$){Object.defineProperty(y$,"__esModule",{value:!0});var J=Z(),fM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},pM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fM,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(),k()));function O(){if(c.strictSchema===!1)return J.nil;return J._`${i} && !${_}`}function k(){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,_]=k(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 k(S){let Ee=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,Se=r.scopeValue("formats",{key:o,ref:S,code:Ee});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${Se}.validate`];return["string",S,Se]}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})`}}}};y$.default=pM});var $$=g(function(v$){Object.defineProperty(v$,"__esModule",{value:!0});var mM=_$(),gM=[mM.default];v$.default=gM});var E$=g(function(b$){Object.defineProperty(b$,"__esModule",{value:!0});b$.contentVocabulary=b$.metadataVocabulary=void 0;b$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];b$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var x$=g(function(S$){Object.defineProperty(S$,"__esModule",{value:!0});var vM=Dv(),$M=g0(),bM=g$(),wM=$$(),Sa=E$(),EM=[vM.default,$M.default,(0,bM.default)(),wM.default,Sa.metadataVocabulary,Sa.contentVocabulary];S$.default=EM});var O$=g(function(k$){Object.defineProperty(k$,"__esModule",{value:!0});k$.DiscrError=void 0;var R$;(function(e){e.Tag="tag",e.Mapping="mapping"})(R$||(k$.DiscrError=R$={}))});var I$=g(function(N$){Object.defineProperty(N$,"__esModule",{value:!0});var $t=Z(),ws=O$(),xa=ua(),xM=po(),A$=ae(),RM={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}})=>$t._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},kM={keyword:"discriminator",type:"object",schemaType:"object",error:RM,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",$t._`${r}${$t.getProperty(a)}`);t.if($t._`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($t._`${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,$t.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)&&!A$.schemaHasRulesButRef(S,o.self.RULES)){let Se=S.$ref;if(S=xa.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Se),S instanceof xa.SchemaEnv)S=S.schema;if(S===void 0)throw new xM.default(o.opts.uriResolver,o.baseId,Se)}let Ee=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof Ee!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(Ee,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)k(M.const,S);else if(M.enum)for(let Ee of M.enum)k(Ee,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};N$.default=kM});var P$=g(function(mH,OM){OM.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 j$=g(function(ut,sl){Object.defineProperty(ut,"__esModule",{value:!0});ut.MissingRefError=ut.ValidationError=ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=ut.Ajv=void 0;var AM=Ov(),NM=x$(),IM=I$(),C$=P$(),PM=["/properties"],Ra="http://json-schema.org/draft-07/schema";class mo extends AM.default{_addVocabularies(){if(super._addVocabularies(),NM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(IM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(C$,PM):C$;this.addMetaSchema(e,Ra,!1),this.refs["http://json-schema.org/schema"]=Ra}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ra)?Ra:void 0)}}ut.Ajv=mo;sl.exports=ut=mo;sl.exports.Ajv=mo;Object.defineProperty(ut,"__esModule",{value:!0});ut.default=mo;var CM=fo();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return CM.KeywordCxt}});var Es=Z();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return Es._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return Es.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return Es.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return Es.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return Es.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return Es.CodeGen}});var jM=ia();Object.defineProperty(ut,"ValidationError",{enumerable:!0,get:function(){return jM.default}});var qM=po();Object.defineProperty(ut,"MissingRefError",{enumerable:!0,get:function(){return qM.default}})});var M$=g(function(D$){Object.defineProperty(D$,"__esModule",{value:!0});D$.formatLimitDefinition=void 0;var q$=j$(),Pe=Z(),fn=Pe.operators,ka={formatMaximum:{okStr:"<=",ok:fn.LTE,fail:fn.GT},formatMinimum:{okStr:">=",ok:fn.GTE,fail:fn.LT},formatExclusiveMaximum:{okStr:"<",ok:fn.LT,fail:fn.GTE},formatExclusiveMinimum:{okStr:">",ok:fn.GT,fail:fn.LTE}},LM={message:({keyword:e,schemaCode:t})=>Pe.str`should be ${ka[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pe._`{comparison: ${ka[e].okStr}, limit: ${t}}`};D$.formatLimitDefinition={keyword:Object.keys(ka),type:"string",schemaType:"string",$data:!0,error:LM,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 q$.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",Pe._`${p}[${c.schemaCode}]`);e.fail$data(Pe.or(Pe._`typeof ${f} != "object"`,Pe._`${f} instanceof RegExp`,Pe._`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?Pe._`${i.code.formats}${Pe.getProperty(p)}`:void 0});e.fail$data(l(h))}function l(p){return Pe._`${p}.compare(${r}, ${n}) ${ka[s].fail} 0`}},dependencies:["format"]};var UM=(e)=>(e.addKeyword(D$.formatLimitDefinition),e);D$.default=UM});var V$=g(function(go,F$){Object.defineProperty(go,"__esModule",{value:!0});var bt=gy(),VM=M$(),Ss=Z(),L$=new Ss.Name("fullFormats"),zM=new Ss.Name("fastFormats"),il=(e,t={keywords:!0})=>{if(Array.isArray(t))return U$(e,t,bt.fullFormats,L$),e;let[r,n]=t.mode==="fast"?[bt.fastFormats,zM]:[bt.fullFormats,L$],s=t.formats||bt.formatNames;if(U$(e,s,r,n),t.keywords)(0,VM.default)(e);return e};il.get=(e,t="full")=>{let n=(t==="fast"?bt.fastFormats:bt.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function U$(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])}F$.exports=go=il;Object.defineProperty(go,"__esModule",{value:!0});go.default=il});function al(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))GM(e,t,s,r);return HM(e,t),XM(e,t,n),e}var GM=(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(!KM(s,o)&&n)return;Object.defineProperty(e,r,o)},KM=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)},HM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},BM=(e,t)=>`/* Wrapped ${e}*/
18
- ${t}`,WM,YM,XM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=BM.bind(null,n,t.toString());Object.defineProperty(s,"name",YM);let{writable:o,enumerable:i,configurable:a}=WM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:a})};var z$=F(()=>{WM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),YM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var JM=(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 al(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},cl;var G$=F(()=>{z$();cl=JM});var yo=g(function(TH,K$){var QM=Number.MAX_SAFE_INTEGER||9007199254740991,ZM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];K$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:QM,RELEASE_TYPES:ZM,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _o=g(function(OH,H$){var eL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};H$.exports=eL});var xs=g(function(ur,B$){var{MAX_SAFE_COMPONENT_LENGTH:ul,MAX_SAFE_BUILD_LENGTH:tL,MAX_LENGTH:rL}=yo(),nL=_o();ur=B$.exports={};var sL=ur.re=[],oL=ur.safeRe=[],j=ur.src=[],iL=ur.safeSrc=[],q=ur.t={},aL=0,ll="[a-zA-Z0-9-]",cL=[["\\s",1],["\\d",rL],[ll,tL]],uL=(e)=>{for(let[t,r]of cL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=uL(t),s=aL++;nL(e,s,t),q[e]=s,j[s]=t,iL[s]=n,sL[s]=new RegExp(t,r?"g":void 0),oL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ll}*`);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",`${ll}+`);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,${ul}})(?:\\.(\\d{1,${ul}}))?(?:\\.(\\d{1,${ul}}))?`);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);ur.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);ur.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);ur.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(AH,W$){var lL=Object.freeze({loose:!0}),dL=Object.freeze({}),fL=(e)=>{if(!e)return dL;if(typeof e!=="object")return lL;return e};W$.exports=fL});var dl=g(function(NH,J$){var Y$=/^[0-9]+$/,X$=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Y$.test(e),n=Y$.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},pL=(e,t)=>X$(t,e);J$.exports={compareIdentifiers:X$,rcompareIdentifiers:pL}});var Ke=g(function(IH,Z$){var Oa=_o(),{MAX_LENGTH:Q$,MAX_SAFE_INTEGER:Aa}=yo(),{safeRe:Na,t:Ia}=xs(),hL=Ta(),{compareIdentifiers:fl}=dl();class At{constructor(e,t){if(t=hL(t),e instanceof At)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>Q$)throw TypeError(`version is longer than ${Q$} characters`);Oa("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Na[Ia.LOOSE]:Na[Ia.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>Aa||this.major<0)throw TypeError("Invalid major version");if(this.minor>Aa||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Aa||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<Aa)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(Oa("SemVer.compare",this.version,this.options,e),!(e instanceof At)){if(typeof e==="string"&&e===this.version)return 0;e=new At(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof At))e=new At(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 At))e=new At(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(Oa("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 fl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof At))e=new At(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Oa("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 fl(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?Na[Ia.PRERELEASELOOSE]:Na[Ia.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(fl(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}}Z$.exports=At});var kn=g(function(PH,tb){var eb=Ke(),mL=(e,t,r=!1)=>{if(e instanceof eb)return e;try{return new eb(e,t)}catch(n){if(!r)return null;throw n}};tb.exports=mL});var nb=g(function(CH,rb){var gL=kn(),yL=(e,t)=>{let r=gL(e,t);return r?r.version:null};rb.exports=yL});var ob=g(function(jH,sb){var _L=kn(),vL=(e,t)=>{let r=_L(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};sb.exports=vL});var cb=g(function(qH,ab){var ib=Ke(),$L=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new ib(e instanceof ib?e.version:e,r).inc(t,n,s).version}catch(o){return null}};ab.exports=$L});var db=g(function(DH,lb){var ub=kn(),bL=(e,t)=>{let r=ub(e,null,!0),n=ub(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"};lb.exports=bL});var pb=g(function(MH,fb){var wL=Ke(),EL=(e,t)=>new wL(e,t).major;fb.exports=EL});var mb=g(function(LH,hb){var SL=Ke(),xL=(e,t)=>new SL(e,t).minor;hb.exports=xL});var yb=g(function(UH,gb){var RL=Ke(),kL=(e,t)=>new RL(e,t).patch;gb.exports=kL});var vb=g(function(FH,_b){var TL=kn(),OL=(e,t)=>{let r=TL(e,t);return r&&r.prerelease.length?r.prerelease:null};_b.exports=OL});var wt=g(function(VH,bb){var $b=Ke(),AL=(e,t,r)=>new $b(e,r).compare(new $b(t,r));bb.exports=AL});var Eb=g(function(zH,wb){var NL=wt(),IL=(e,t,r)=>NL(t,e,r);wb.exports=IL});var xb=g(function(GH,Sb){var PL=wt(),CL=(e,t)=>PL(e,t,!0);Sb.exports=CL});var Pa=g(function(KH,kb){var Rb=Ke(),jL=(e,t,r)=>{let n=new Rb(e,r),s=new Rb(t,r);return n.compare(s)||n.compareBuild(s)};kb.exports=jL});var Ob=g(function(HH,Tb){var qL=Pa(),DL=(e,t)=>e.sort((r,n)=>qL(r,n,t));Tb.exports=DL});var Nb=g(function(BH,Ab){var ML=Pa(),LL=(e,t)=>e.sort((r,n)=>ML(n,r,t));Ab.exports=LL});var vo=g(function(WH,Ib){var UL=wt(),FL=(e,t,r)=>UL(e,t,r)>0;Ib.exports=FL});var Ca=g(function(YH,Pb){var VL=wt(),zL=(e,t,r)=>VL(e,t,r)<0;Pb.exports=zL});var pl=g(function(XH,Cb){var GL=wt(),KL=(e,t,r)=>GL(e,t,r)===0;Cb.exports=KL});var hl=g(function(JH,jb){var HL=wt(),BL=(e,t,r)=>HL(e,t,r)!==0;jb.exports=BL});var ja=g(function(QH,qb){var WL=wt(),YL=(e,t,r)=>WL(e,t,r)>=0;qb.exports=YL});var qa=g(function(ZH,Db){var XL=wt(),JL=(e,t,r)=>XL(e,t,r)<=0;Db.exports=JL});var ml=g(function(e5,Mb){var QL=pl(),ZL=hl(),eU=vo(),tU=ja(),rU=Ca(),nU=qa(),sU=(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 QL(e,r,n);case"!=":return ZL(e,r,n);case">":return eU(e,r,n);case">=":return tU(e,r,n);case"<":return rU(e,r,n);case"<=":return nU(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Mb.exports=sU});var Ub=g(function(t5,Lb){var oU=Ke(),iU=kn(),{safeRe:Da,t:Ma}=xs(),aU=(e,t)=>{if(e instanceof oU)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?Da[Ma.COERCEFULL]:Da[Ma.COERCE]);else{let c=t.includePrerelease?Da[Ma.COERCERTLFULL]:Da[Ma.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 iU(`${n}.${s}.${o}${i}${a}`,t)};Lb.exports=aU});var zb=g(function(r5,Vb){class Fb{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}}Vb.exports=Fb});var Et=g(function(n5,Bb){var cU=/\s+/g;class $o{constructor(e,t){if(t=lU(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 La)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(cU," "),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)=>!Kb(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&&yU(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&&mU)|(this.options.loose&&gU))+":"+e,n=Gb.get(r);if(n)return n;let s=this.options.loose,o=s?Xe[He.HYPHENRANGELOOSE]:Xe[He.HYPHENRANGE];e=e.replace(o,kU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Xe[He.COMPARATORTRIM],fU),ye("comparator trim",e),e=e.replace(Xe[He.TILDETRIM],pU),ye("tilde trim",e),e=e.replace(Xe[He.CARETTRIM],hU),ye("caret trim",e);let i=e.split(" ").map((d)=>_U(d,this.options)).join(" ").split(/\s+/).map((d)=>RU(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 La(d,this.options));for(let d of c){if(Kb(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return Gb.set(r,u),u}intersects(e,t){if(!(e instanceof $o))throw TypeError("a Range is required");return this.set.some((r)=>Hb(r,t)&&e.set.some((n)=>Hb(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 dU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(TU(this.set[t],e,this.options))return!0;return!1}}Bb.exports=$o;var uU=zb(),Gb=new uU,lU=Ta(),La=bo(),ye=_o(),dU=Ke(),{safeRe:Xe,t:He,comparatorTrimReplace:fU,tildeTrimReplace:pU,caretTrimReplace:hU}=xs(),{FLAG_INCLUDE_PRERELEASE:mU,FLAG_LOOSE:gU}=yo(),Kb=(e)=>e.value==="<0.0.0-0",yU=(e)=>e.value==="",Hb=(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},_U=(e,t)=>(e=e.replace(Xe[He.BUILD],""),ye("comp",e,t),e=bU(e,t),ye("caret",e),e=vU(e,t),ye("tildes",e),e=EU(e,t),ye("xrange",e),e=xU(e,t),ye("stars",e),e),Je=(e)=>!e||e.toLowerCase()==="x"||e==="*",vU=(e,t)=>e.trim().split(/\s+/).map((r)=>$U(r,t)).join(" "),$U=(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})},bU=(e,t)=>e.trim().split(/\s+/).map((r)=>wU(r,t)).join(" "),wU=(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})},EU=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>SU(r,t)).join(" ")),SU=(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})},xU=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Xe[He.STAR],"")),RU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Xe[t.includePrerelease?He.GTE0PRE:He.GTE0],"")),kU=(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()},TU=(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===La.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 bo=g(function(s5,Zb){var wo=Symbol("SemVer ANY");class Ua{static get ANY(){return wo}constructor(e,t){if(t=Wb(t),e instanceof Ua)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),yl("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;yl("comp",this)}parse(e){let t=this.options.loose?Yb[Xb.COMPARATORLOOSE]:Yb[Xb.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 Jb(r[2],this.options.loose)}toString(){return this.value}test(e){if(yl("Comparator.test",e,this.options.loose),this.semver===wo||e===wo)return!0;if(typeof e==="string")try{e=new Jb(e,this.options)}catch(t){return!1}return gl(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ua))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Qb(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Qb(this.value,t).test(e.semver)}if(t=Wb(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(gl(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(gl(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Zb.exports=Ua;var Wb=Ta(),{safeRe:Yb,t:Xb}=xs(),gl=ml(),yl=_o(),Jb=Ke(),Qb=Et()});var Eo=g(function(o5,ew){var OU=Et(),AU=(e,t,r)=>{try{t=new OU(t,r)}catch(n){return!1}return t.test(e)};ew.exports=AU});var rw=g(function(i5,tw){var NU=Et(),IU=(e,t)=>new NU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));tw.exports=IU});var sw=g(function(a5,nw){var PU=Ke(),CU=Et(),jU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new CU(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};nw.exports=jU});var iw=g(function(c5,ow){var qU=Ke(),DU=Et(),MU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new DU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===1)n=i,s=new qU(n,r)}}),n};ow.exports=MU});var uw=g(function(u5,cw){var _l=Ke(),LU=Et(),aw=vo(),UU=(e,t)=>{e=new LU(e,t);let r=new _l("0.0.0");if(e.test(r))return r;if(r=new _l("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 _l(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||aw(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||aw(r,o)))r=o}if(r&&e.test(r))return r;return null};cw.exports=UU});var dw=g(function(l5,lw){var FU=Et(),VU=(e,t)=>{try{return new FU(e,t).range||"*"}catch(r){return null}};lw.exports=VU});var Fa=g(function(d5,mw){var zU=Ke(),hw=bo(),{ANY:GU}=hw,KU=Et(),HU=Eo(),fw=vo(),pw=Ca(),BU=qa(),WU=ja(),YU=(e,t,r,n)=>{e=new zU(e,n),t=new KU(t,n);let s,o,i,a,c;switch(r){case">":s=fw,o=BU,i=pw,a=">",c=">=";break;case"<":s=pw,o=WU,i=fw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(HU(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===GU)f=new hw(">=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};mw.exports=YU});var yw=g(function(f5,gw){var XU=Fa(),JU=(e,t,r)=>XU(e,t,">",r);gw.exports=JU});var vw=g(function(p5,_w){var QU=Fa(),ZU=(e,t,r)=>QU(e,t,"<",r);_w.exports=ZU});var ww=g(function(h5,bw){var $w=Et(),e2=(e,t,r)=>(e=new $w(e,r),t=new $w(t,r),e.intersects(t,r));bw.exports=e2});var Sw=g(function(m5,Ew){var t2=Eo(),r2=wt();Ew.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((d,l)=>r2(d,l,r));for(let d of i)if(t2(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 Aw=g(function(g5,Ow){var xw=Et(),$l=bo(),{ANY:vl}=$l,So=Eo(),bl=wt(),n2=(e,t,r={})=>{if(e===t)return!0;e=new xw(e,r),t=new xw(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=o2(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},s2=[new $l(">=0.0.0-0")],Rw=[new $l(">=0.0.0")],o2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vl)if(t.length===1&&t[0].semver===vl)return!0;else if(r.includePrerelease)e=s2;else e=Rw;if(t.length===1&&t[0].semver===vl)if(r.includePrerelease)return!0;else t=Rw;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=kw(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=bl(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=kw(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},kw=(e,t,r)=>{if(!e)return t;let n=bl(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=bl(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Ow.exports=n2});var Iw=g(function(y5,Nw){var Rs=xs(),Va=yo(),i2=Ke(),za=dl(),a2=kn(),c2=nb(),u2=ob(),l2=cb(),d2=db(),f2=pb(),p2=mb(),h2=yb(),m2=vb(),g2=wt(),y2=Eb(),_2=xb(),v2=Pa(),$2=Ob(),b2=Nb(),w2=vo(),E2=Ca(),S2=pl(),x2=hl(),R2=ja(),k2=qa(),T2=ml(),O2=Ub(),A2=bo(),N2=Et(),I2=Eo(),P2=rw(),C2=sw(),j2=iw(),q2=uw(),D2=dw(),M2=Fa(),L2=yw(),U2=vw(),F2=ww(),V2=Sw(),z2=Aw();Nw.exports={parse:a2,valid:c2,clean:u2,inc:l2,diff:d2,major:f2,minor:p2,patch:h2,prerelease:m2,compare:g2,rcompare:y2,compareLoose:_2,compareBuild:v2,sort:$2,rsort:b2,gt:w2,lt:E2,eq:S2,neq:x2,gte:R2,lte:k2,cmp:T2,coerce:O2,Comparator:A2,Range:N2,satisfies:I2,toComparators:P2,maxSatisfying:C2,minSatisfying:j2,minVersion:q2,validRange:D2,outside:M2,gtr:L2,ltr:U2,intersects:F2,simplifyRange:V2,subset:z2,SemVer:i2,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Va.SEMVER_SPEC_VERSION,RELEASE_TYPES:Va.RELEASE_TYPES,compareIdentifiers:za.compareIdentifiers,rcompareIdentifiers:za.rcompareIdentifiers}});function Cw(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return G2.call(e)===r}function jw(e){return Cw(e,Uint8Array,"[object Uint8Array]")}function K2(e){return Cw(e,ArrayBuffer,"[object ArrayBuffer]")}function H2(e){return jw(e)||K2(e)}function B2(e){if(!jw(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function W2(e){if(!H2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function wl(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)B2(s),r.set(s,n),n+=s.length;return r}function El(e,t="utf8"){return W2(e),Pw[t]??=new globalThis.TextDecoder(t),Pw[t].decode(e)}function Y2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function Ga(e){return Y2(e),X2.encode(e)}var G2,Pw,X2,_5;var qw=F(()=>{G2=Object.prototype.toString;Pw={utf8:new globalThis.TextDecoder("utf8")};X2=new globalThis.TextEncoder;_5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as J2}from"util";import Dw from"process";import Tn from"fs";import Mw from"path";import xo from"crypto";import Q2 from"assert";var Uw,Fw,On,Z2,Lw="aes-256-cbc",ks=()=>Object.create(null),eF=(e)=>e!==void 0&&e!==null,tF=(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`)},Ka="__internal__",Sl,Ha;var Vw=F(()=>{dd();pd();zd();G$();qw();Uw=vc(iy(),1),Fw=vc(V$(),1),On=vc(Iw(),1),Z2=Fw.default.default,Sl=`${Ka}.migrations.version`;Ha=class Ha{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=xc(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 Uw.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});Z2(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=Mw.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(ks(),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{Q2.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 ${Ka} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(tF(s,o),this.#e.accessPropertiesByDotNotation)wc(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 ld(this.store,e);return e in this.store}reset(...e){for(let t of e)if(eF(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)ud(t,e);else delete t[e];this.store=t}clear(){this.store=ks();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=Tn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(ks(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),ks();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return ks();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:El(e);try{let t=e.slice(0,16),r=xo.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=xo.createDecipheriv(Lw,r,t),s=e.slice(17),o=typeof s==="string"?Ga(s):s;return El(wl([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(J2(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(){Tn.mkdirSync(Mw.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(Lw,n,r);t=wl([r,Ga(":"),s.update(Ga(t)),s.final()])}if(Dw.env.SNAP)Tn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{qc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){Tn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!Tn.existsSync(this.path))this._write(ks());if(Dw.platform==="win32")Tn.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else Tn.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(Sl,"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(Sl,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(Sl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Ka)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Ka}.`))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 cd(this.store,e,t)}_set(e,t){let{store:r}=this;wc(r,e,t),this.store=r}}});var re,zw,I,wr=(e)=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":if(Array.isArray(e))return I.array;if(e===null)return I.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return I.promise;if(typeof Map<"u"&&e instanceof Map)return I.map;if(typeof Set<"u"&&e instanceof Set)return I.set;if(typeof Date<"u"&&e instanceof Date)return I.date;return I.object;default:return I.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})})(zw||(zw={}));I=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var E,ft;var Ba=F(()=>{Ro();E=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 rF=(e,t)=>{let r;switch(e.code){case E.invalid_type:if(e.received===I.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.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 E.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 E.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 E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},pn;var xl=F(()=>{Ba();Ro();pn=rF});function ko(){return nF}var nF;var Wa=F(()=>{xl();nF=pn});function T(e,t){let r=ko(),n=Ya({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===pn?void 0:pn].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 Ya=(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,Ts=(e)=>({status:"dirty",value:e}),Qe=(e)=>({status:"valid",value:e}),Rl=(e)=>e.status==="aborted",kl=(e)=>e.status==="dirty",An=(e)=>e.status==="valid",To=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=F(()=>{Wa();xl();G=Object.freeze({status:"aborted"})});var Gw=()=>{};var D;var Kw=F(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class Nt{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 wr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wr(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:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(To(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:wr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Hw(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(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:wr(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(To(n)?n:Promise.resolve(n));return Hw(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:E.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 fr({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 dr.create(this,this._def)}nullable(){return hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lr.create(this)}promise(){return Ps.create(this,this._def)}or(e){return Po.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new fr({...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 Il({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 nc.create(this,e)}readonly(){return Uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Ww(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 $F(e){return new RegExp(`^${Ww(e)}$`)}function bF(e){let t=`${Bw}T${Ww(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 wF(e,t){if((t==="v4"||!t)&&pF.test(e))return!0;if((t==="v6"||!t)&&mF.test(e))return!0;return!1}function EF(e,t){if(!uF.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 SF(e,t){if((t==="v4"||!t)&&hF.test(e))return!0;if((t==="v6"||!t)&&gF.test(e))return!0;return!1}function xF(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]=dr.create(Os(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof lr)return new lr({...e._def,type:Os(e.element)});else if(e instanceof dr)return dr.create(Os(e.unwrap()));else if(e instanceof hn)return hn.create(Os(e.unwrap()));else if(e instanceof Rr)return Rr.create(e.items.map((t)=>Os(t)));else return e}function Al(e,t){let r=wr(e),n=wr(t);if(e===t)return{valid:!0,data:e};else if(r===I.object&&n===I.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=Al(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===I.array&&n===I.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=Al(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===I.date&&n===I.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Yw(e,t){return new In({values:e,typeName:K.ZodEnum,...Q(t)})}var Hw=(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}}}},sF,oF,iF,aF,cF,uF,lF,dF,fF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ol,pF,hF,mF,gF,yF,_F,Bw="((\\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])))",vF,Sr,As,Ns,Xa,Ao,Ja,No,Io,Qa,Nn,xr,Za,lr,Ce,Po,Er=(e)=>{if(e instanceof jo)return Er(e.schema);else if(e instanceof fr)return Er(e.innerType());else if(e instanceof qo)return[e.value];else if(e instanceof In)return e.options;else if(e instanceof Do)return re.objectValues(e.enum);else if(e instanceof Mo)return Er(e._def.innerType);else if(e instanceof No)return[void 0];else if(e instanceof Io)return[null];else if(e instanceof dr)return[void 0,...Er(e.unwrap())];else if(e instanceof hn)return[null,...Er(e.unwrap())];else if(e instanceof Il)return Er(e.unwrap());else if(e instanceof Uo)return Er(e.unwrap());else if(e instanceof Lo)return Er(e._def.innerType);else return[]},Nl,Co,Rr,ec,tc,Is,Oo,jo,qo,In,Do,Ps,fr,dr,hn,Mo,Lo,rc,Y5,Il,nc,Uo,X5,K,v,fe,J5,Q5,Ue,Z5,e3,t3,r3,n3,s3,o3,i3,Ze,ne,a3,RF,Xw,c3,u3,kF,l3,d3,f3,p3,Pn,Ve,h3,m3,g3,y3,_3,v3,$3;var Jw=F(()=>{Ba();Wa();Kw();Tl();Ro();sF=/^c[^\s-]{8,}$/i,oF=/^[0-9a-z]+$/,iF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aF=/^[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,cF=/^[a-z0-9_-]{21}$/i,uF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lF=/^[-+]?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)?)??$/,dF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pF=/^(?:(?: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])$/,hF=/^(?:(?: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])$/,mF=/^(([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]))$/,gF=/^(([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])$/,yF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_F=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vF=new RegExp(`^${Bw}$`);Sr=class Sr extends ee{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==I.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.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),T(n,{code:E.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),T(n,{code:E.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)T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(i)T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!dF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"email",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!Ol)Ol=new RegExp(fF,"u");if(!Ol.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"emoji",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!aF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"uuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!cF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"nanoid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!sF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!oF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid2",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"ulid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),T(n,{validation:"url",code:E.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),T(n,{validation:"regex",code:E.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),T(n,{code:E.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),T(n,{code:E.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),T(n,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!bF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!vF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!$F(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!lF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"duration",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!wF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"ip",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!EF(e.data,s.alg))n=this._getOrReturnCtx(e,n),T(n,{validation:"jwt",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!SF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"cidr",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!yF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!_F.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64url",code:E.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:E.invalid_string,...D.errToObj(r)})}_addCheck(e){return new Sr({...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 Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...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}};Sr.create=(e)=>new Sr({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)!==I.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.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),T(r,{code:E.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),T(r,{code:E.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),T(r,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(xF(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),T(r,{code:E.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),T(r,{code:E.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)});Ns=class Ns 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)!==I.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),T(r,{code:E.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),T(r,{code:E.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),T(r,{code:E.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 T(t,{code:E.invalid_type,expected:I.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 Ns({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Ns({...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}};Ns.create=(e)=>new Ns({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Xa=class Xa extends ee{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==I.boolean){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.boolean,received:r.parsedType}),G}return Qe(e.data)}};Xa.create=(e)=>new Xa({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)!==I.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.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),T(n,{code:E.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),T(n,{code:E.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)});Ja=class Ja extends ee{_parse(e){if(this._getType(e)!==I.symbol){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.symbol,received:r.parsedType}),G}return Qe(e.data)}};Ja.create=(e)=>new Ja({typeName:K.ZodSymbol,...Q(e)});No=class No extends ee{_parse(e){if(this._getType(e)!==I.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.undefined,received:r.parsedType}),G}return Qe(e.data)}};No.create=(e)=>new No({typeName:K.ZodUndefined,...Q(e)});Io=class Io extends ee{_parse(e){if(this._getType(e)!==I.null){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.null,received:r.parsedType}),G}return Qe(e.data)}};Io.create=(e)=>new Io({typeName:K.ZodNull,...Q(e)});Qa=class Qa extends ee{constructor(){super(...arguments);this._any=!0}_parse(e){return Qe(e.data)}};Qa.create=(e)=>new Qa({typeName:K.ZodAny,...Q(e)});Nn=class Nn extends ee{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Qe(e.data)}};Nn.create=(e)=>new Nn({typeName:K.ZodUnknown,...Q(e)});xr=class xr extends ee{_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:I.never,received:t.parsedType}),G}};xr.create=(e)=>new xr({typeName:K.ZodNever,...Q(e)});Za=class Za extends ee{_parse(e){if(this._getType(e)!==I.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.void,received:r.parsedType}),G}return Qe(e.data)}};Za.create=(e)=>new Za({typeName:K.ZodVoid,...Q(e)});lr=class lr extends ee{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==I.array)return T(t,{code:E.invalid_type,expected:I.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)T(t,{code:o?E.too_big:E.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)T(t,{code:E.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)T(t,{code:E.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 Nt(t,o,t.path,i)))).then((o)=>Be.mergeArray(r,o));let s=[...t.data].map((o,i)=>n.type._parseSync(new Nt(t,o,t.path,i)));return Be.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new lr({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new lr({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new lr({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};lr.create=(e,t)=>new lr({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)!==I.object){let c=this._getOrReturnCtx(e);return T(c,{code:E.invalid_type,expected:I.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 xr&&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 Nt(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof xr){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)T(n,{code:E.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 Nt(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 dr)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Yw(re.objectKeys(this.shape))}};Ce.create=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ce.strictCreate=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ce.lazycreate=(e,t)=>new Ce({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Po=class Po 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 T(t,{code:E.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 T(t,{code:E.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Po.create=(e,t)=>new Po({options:e,typeName:K.ZodUnion,...Q(t)});Nl=class Nl extends ee{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return T(t,{code:E.invalid_type,expected:I.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return T(t,{code:E.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=Er(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 Nl({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(Rl(s)||Rl(o))return G;let i=Al(s.value,o.value);if(!i.valid)return T(r,{code:E.invalid_intersection_types}),G;if(kl(s)||kl(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)});Rr=class Rr extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.array)return T(r,{code:E.invalid_type,expected:I.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return T(r,{code:E.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)T(r,{code:E.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 Nt(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 Rr({...this._def,rest:e})}};Rr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:e,typeName:K.ZodTuple,rest:null,...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!==I.object)return T(r,{code:E.invalid_type,expected:I.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 Nt(r,i,r.path,i)),value:o._parse(new Nt(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 ec({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new ec({keyType:Sr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};tc=class tc 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!==I.map)return T(r,{code:E.invalid_type,expected:I.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 Nt(r,i,r.path,[c,"key"])),value:s._parse(new Nt(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}}}};tc.create=(e,t,r)=>new tc({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});Is=class Is extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.set)return T(r,{code:E.invalid_type,expected:I.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)T(r,{code:E.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)T(r,{code:E.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 Nt(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 Is({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new Is({...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)}};Is.create=(e,t)=>new Is({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!==I.function)return T(t,{code:E.invalid_type,expected:I.function,received:t.parsedType}),G;function r(i,a){return Ya({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ko(),pn].filter((c)=>!!c),issueData:{code:E.invalid_arguments,argumentsError:a}})}function n(i,a){return Ya({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ko(),pn].filter((c)=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:a}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ps){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:Rr.create(e).rest(Nn.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:Rr.create([]).rest(Nn.create()),returns:t||Nn.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 T(t,{received:t.data,code:E.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)});In=class In extends ee{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{expected:re.joinValues(r),received:t.parsedType,code:E.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 T(t,{received:t.data,code:E.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 In.create(e,{...this._def,...t})}exclude(e,t=this._def){return In.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};In.create=Yw;Do=class Do extends ee{_parse(e){let t=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==I.string&&r.parsedType!==I.number){let n=re.objectValues(t);return T(r,{expected:re.joinValues(n),received:r.parsedType,code:E.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 T(r,{received:r.data,code:E.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)});Ps=class Ps extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return T(t,{code:E.invalid_type,expected:I.promise,received:t.parsedType}),G;let r=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return Qe(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ps.create=(e,t)=>new Ps({type:e,typeName:K.ZodPromise,...Q(t)});fr=class fr 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(T(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 Ts(a.value);if(t.value==="dirty")return Ts(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 Ts(i.value);if(t.value==="dirty")return Ts(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)}};fr.create=(e,t,r)=>new fr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});fr.createWithPreprocess=(e,t,r)=>new fr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});dr=class dr extends ee{_parse(e){if(this._getType(e)===I.undefined)return Qe(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dr.create=(e,t)=>new dr({innerType:e,typeName:K.ZodOptional,...Q(t)});hn=class hn extends ee{_parse(e){if(this._getType(e)===I.null)return Qe(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hn.create=(e,t)=>new hn({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===I.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(To(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)});rc=class rc extends ee{_parse(e){if(this._getType(e)!==I.nan){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};rc.create=(e)=>new rc({typeName:K.ZodNaN,...Q(e)});Y5=Symbol("zod_brand");Il=class Il 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}};nc=class nc 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(),Ts(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 nc({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 To(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)});X5={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=Sr.create,fe=As.create,J5=rc.create,Q5=Ns.create,Ue=Xa.create,Z5=Ao.create,e3=Ja.create,t3=No.create,r3=Io.create,n3=Qa.create,s3=Nn.create,o3=xr.create,i3=Za.create,Ze=lr.create,ne=Ce.create,a3=Ce.strictCreate,RF=Po.create,Xw=Nl.create,c3=Co.create,u3=Rr.create,kF=ec.create,l3=tc.create,d3=Is.create,f3=Oo.create,p3=jo.create,Pn=qo.create,Ve=In.create,h3=Do.create,m3=Ps.create,g3=fr.create,y3=dr.create,_3=hn.create,v3=fr.createWithPreprocess,$3=nc.create});var Pl=F(()=>{Wa();Tl();Gw();Ro();Jw();Ba()});var jn=F(()=>{Pl();Pl()});function N3(e){return OF.includes(e)}var TF,qn,OF,I3,AF,Qw,NF,Zw,IF,PF,P3,CF,C3,j3,q3,D3,jF,eE,qF,tE,M3=20,L3=500,DF,U3;var sc=F(()=>{jn();TF=Ve(["pending","verified","approved","revoked"]),qn=Ve(["person","service","test"]),OF=qn.options;I3={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"},AF=Ve(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Qw=AF.options,NF=Ve(["active","pending","revoked"]),Zw=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),IF=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:TF.optional(),email_verified:Ue().optional(),orcid_verified:Ue().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:Ze(Zw).optional(),username_auto_assigned:Ue().optional(),account_kind:qn.optional()}).passthrough(),PF=ne({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),P3=ne({user:IF,token:PF.optional()}).passthrough(),CF=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(),C3=ne({users:Ze(CF),count:fe().int()}).passthrough(),j3=Ve(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),q3=Ve(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),D3=ne({suggestion:v().nullable(),based_on:Ve(["name","unavailable","exhausted"])}).passthrough(),jF=Ve(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),eE=jF.options,qF=Ve(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),tE=qF.options,DF=ne({id:fe().int(),email:v(),username:v().nullable(),role:v(),status:NF,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(Zw),username_auto_assigned:Ue()}).passthrough(),U3=ne({user:DF.nullable()}).passthrough()});function pr(e){if(e instanceof Error)return e.message;return String(e)}function V3(e){if(!(e instanceof hr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var hr,Cl;var jl=F(()=>{hr=class hr 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"}};Cl=class Cl extends hr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function UF(){let e=new Map;for(let[t,r]of Object.entries($e)){for(let[n,s]of Object.entries(r))$e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=$e[n],e.set(s[0],s[1]);Object.defineProperty($e,t,{value:r,enumerable:!1})}return Object.defineProperty($e,"codes",{value:e,enumerable:!1}),$e.color.close="\x1B[39m",$e.bgColor.close="\x1B[49m",$e.color.ansi=rE(),$e.color.ansi256=nE(),$e.color.ansi16m=sE(),$e.bgColor.ansi=rE(10),$e.bgColor.ansi256=nE(10),$e.bgColor.ansi16m=sE(10),Object.defineProperties($e,{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)=>$e.rgbToAnsi256(...$e.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)=>$e.ansi256ToAnsi($e.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>$e.ansi256ToAnsi($e.hexToAnsi256(t)),enumerable:!1}}),$e}var rE=(e=0)=>(t)=>`\x1B[${t+e}m`,nE=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,sE=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,$e,G3,MF,LF,K3,FF,It;var oE=F(()=>{$e={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]}},G3=Object.keys($e.modifier),MF=Object.keys($e.color),LF=Object.keys($e.bgColor),K3=[...MF,...LF];FF=UF(),It=FF});import ql from"process";import VF from"os";import iE from"tty";function St(e,t=globalThis.Deno?globalThis.Deno.args:ql.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function zF(){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 GF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function KF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=zF();if(n!==void 0)oc=n;let s=r?oc:n;if(s===0)return 0;if(r){if(St("color=16m")||St("color=full")||St("color=truecolor"))return 3;if(St("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(ql.platform==="win32"){let i=VF.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 aE(e,t={}){let r=KF(e,{streamIsTTY:e&&e.isTTY,...t});return GF(r)}var be,oc,HF,cE;var uE=F(()=>{({env:be}=ql);if(St("no-color")||St("no-colors")||St("color=false")||St("color=never"))oc=0;else if(St("color")||St("colors")||St("color=true")||St("color=always"))oc=1;HF={stdout:aE({isTTY:iE.isatty(1)}),stderr:aE({isTTY:iE.isatty(2)})},cE=HF});function lE(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 dE(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 $D={keyword:"dependencies",type:"object",schemaType:"object",error:D0.error,code(e){let[t,r]=ED(e);j0(e,t),q0(e,r)}};function ED({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 j0(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 a in t){let i=t[a];if(i.length===0)continue;let c=ir.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)ir.checkReportMissingProp(e,u)});else r.if(Es._`${c} && (${ir.checkMissingProp(e,i,o)})`),ir.reportMissingProp(e,o),r.else()}}D0.validatePropertyDeps=j0;function q0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(C0.alwaysValidSchema(o,t[i]))continue;r.if(ir.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}D0.validateSchemaDeps=q0;D0.default=$D});var z0=g(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});var vi=ee(),F0=ce(),RD={message:"property name must be valid",params:({params:e})=>vi._`{propertyName: ${e.propertyName}}`},kD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:RD,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(F0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(vi.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};V0.default=kD});var nl=g(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});var cn=_t(),Ne=ee(),AD=br(),un=ce(),OD={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},ND={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:OD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&un.alwaysValidSchema(a,r))return;let u=cn.allSchemaProperties(n.properties),l=cn.allSchemaProperties(n.patternProperties);d(),e.ok(Ne._`${o} === ${AD.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=un.schemaRefOrVal(a,n.properties,"properties");v=cn.isOwnProperty(t,A,y)}else if(u.length)v=Ne.or(...u.map((A)=>Ne._`${y} === ${A}`));else v=Ne.nil;if(l.length)v=Ne.or(v,...l.map((A)=>Ne._`${cn.usePattern(e,A)}.test(${y})`));return Ne.not(v)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!un.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(Ne.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(Ne.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:un.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};G0.default=ND});var W0=g(function(B0){Object.defineProperty(B0,"__esModule",{value:!0});var H0=po(),bi=_t(),Ss=ce(),K0=nl(),ID={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)K0.default.code(new H0.KeywordCxt(o,K0.default,"additionalProperties"));let a=bi.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=Ss.mergeEvaluated.props(t,Ss.toHash(a),o.props);let i=a.filter((d)=>!Ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(bi.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};B0.default=ID});var X0=g(function(Y0){Object.defineProperty(Y0,"__esModule",{value:!0});var wi=_t(),ln=ee(),$i=ce(),Ei=ce(),jD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=wi.allSchemaProperties(r),c=i.filter((h)=>$i.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof ln.Name))o.props=Ei.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))$i.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(ln._`${wi.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:Ei.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(ln._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(ln.not(l),()=>t.break())})})}}};Y0.default=jD});var Z0=g(function(Q0){Object.defineProperty(Q0,"__esModule",{value:!0});var J0=ce(),DD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(J0.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"}};Q0.default=DD});var rb=g(function(tb){Object.defineProperty(tb,"__esModule",{value:!0});var eb=_t(),LD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eb.validateUnion,error:{message:"must match a schema in anyOf"}};tb.default=LD});var ob=g(function(sb){Object.defineProperty(sb,"__esModule",{value:!0});var dn=ee(),nb=ce(),FD={message:"must match exactly one schema in oneOf",params:({params:e})=>dn._`{passingSchemas: ${e.passing}}`},VD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:FD,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,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(nb.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(dn._`${c} && ${a}`).assign(a,!1).assign(i,dn._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,dn.Name)})})}}};sb.default=VD});var cb=g(function(ib){Object.defineProperty(ib,"__esModule",{value:!0});var ab=ce(),GD={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,a)=>{if(ab.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};ib.default=GD});var db=g(function(lb){Object.defineProperty(lb,"__esModule",{value:!0});var fn=ee(),Si=ce(),HD={message:({params:e})=>fn.str`must match "${e.ifClause}" schema`,params:({params:e})=>fn._`{failingKeyword: ${e.ifClause}}`},BD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:HD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Si.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=ub(n,"then"),o=ub(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(fn.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,fn._`${l}`);else e.setParams({ifClause:l})}}}};function ub(e,t){let r=e.schema[t];return r!==void 0&&!Si.alwaysValidSchema(e,r)}lb.default=BD});var mb=g(function(pb){Object.defineProperty(pb,"__esModule",{value:!0});var fb=ce(),YD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)fb.checkStrictMode(r,`"${e}" without "if" is ignored`)}};pb.default=YD});var gb=g(function(hb){Object.defineProperty(hb,"__esModule",{value:!0});var JD=tl(),QD=R0(),ZD=rl(),eM=N0(),tM=I0(),rM=U0(),nM=z0(),sM=nl(),oM=W0(),aM=X0(),iM=Z0(),cM=rb(),uM=ob(),lM=cb(),dM=db(),fM=mb();function pM(e=!1){let t=[iM.default,cM.default,uM.default,lM.default,dM.default,fM.default,nM.default,sM.default,rM.default,oM.default,aM.default];if(e)t.push(QD.default,eM.default);else t.push(JD.default,ZD.default);return t.push(tM.default),t}hb.default=pM});var _b=g(function(yb){Object.defineProperty(yb,"__esModule",{value:!0});var J=ee(),hM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},gM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",J._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(J._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,J._`${h}.type || "string"`).assign(v,J._`${h}.validate`),()=>r.assign(y,J._`"string"`).assign(v,h)),e.fail$data(J.or(A(),k()));function A(){if(c.strictSchema===!1)return J.nil;return J._`${a} && !${v}`}function k(){let M=l.$async?J._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:J._`${v}(${n})`,S=J._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return J._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return J._`await ${v}(${n})`}return typeof y=="function"?J._`${v}(${n})`:J._`${v}.test(${n})`}}}};yb.default=gM});var bb=g(function(vb){Object.defineProperty(vb,"__esModule",{value:!0});var _M=_b(),vM=[_M.default];vb.default=vM});var Eb=g(function(wb){Object.defineProperty(wb,"__esModule",{value:!0});wb.contentVocabulary=wb.metadataVocabulary=void 0;wb.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wb.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var xb=g(function(Sb){Object.defineProperty(Sb,"__esModule",{value:!0});var $M=Dv(),EM=g0(),SM=gb(),xM=bb(),xi=Eb(),RM=[$M.default,EM.default,(0,SM.default)(),xM.default,xi.metadataVocabulary,xi.contentVocabulary];Sb.default=RM});var Ab=g(function(kb){Object.defineProperty(kb,"__esModule",{value:!0});kb.DiscrError=void 0;var Rb;(function(e){e.Tag="tag",e.Mapping="mapping"})(Rb||(kb.DiscrError=Rb={}))});var Pb=g(function(Nb){Object.defineProperty(Nb,"__esModule",{value:!0});var vt=ee(),xs=Ab(),Ri=li(),TM=mo(),Ob=ce(),AM={message:({params:{discrError:e,tagName:t}})=>e===xs.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}}`},OM={keyword:"discriminator",type:"object",schemaType:"object",error:AM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(i)}`);t.if(vt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:xs.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(vt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:xs.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,vt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Ob.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ri.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ri.SchemaEnv)S=S.schema;if(S===void 0)throw new TM.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Nb.default=OM});var Ib=g(function(wH,PM){PM.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 jb=g(function(lt,sl){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 IM=Av(),CM=xb(),jM=Pb(),Cb=Ib(),qM=["/properties"],ki="http://json-schema.org/draft-07/schema";class go extends IM.default{_addVocabularies(){if(super._addVocabularies(),CM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(jM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Cb,qM):Cb;this.addMetaSchema(e,ki,!1),this.refs["http://json-schema.org/schema"]=ki}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ki)?ki:void 0)}}lt.Ajv=go;sl.exports=lt=go;sl.exports.Ajv=go;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=go;var DM=po();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return DM.KeywordCxt}});var Rs=ee();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return Rs._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return Rs.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return Rs.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return Rs.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return Rs.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return Rs.CodeGen}});var MM=ii();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return MM.default}});var LM=mo();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return LM.default}})});var Mb=g(function(Db){Object.defineProperty(Db,"__esModule",{value:!0});Db.formatLimitDefinition=void 0;var qb=jb(),Pe=ee(),pn=Pe.operators,Ti={formatMaximum:{okStr:"<=",ok:pn.LTE,fail:pn.GT},formatMinimum:{okStr:">=",ok:pn.GTE,fail:pn.LT},formatExclusiveMaximum:{okStr:"<",ok:pn.LT,fail:pn.GTE},formatExclusiveMinimum:{okStr:">",ok:pn.GT,fail:pn.LTE}},VM={message:({keyword:e,schemaCode:t})=>Pe.str`should be ${Ti[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pe._`{comparison: ${Ti[e].okStr}, limit: ${t}}`};Db.formatLimitDefinition={keyword:Object.keys(Ti),type:"string",schemaType:"string",$data:!0,error:VM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:a,self:i}=o;if(!a.validateFormats)return;let c=new qb.KeywordCxt(o,i.RULES.all.format.definition,"format");if(c.$data)u();else l();function u(){let m=t.scopeValue("formats",{ref:i.formats,code:a.code.formats}),f=t.const("fmt",Pe._`${m}[${c.schemaCode}]`);e.fail$data(Pe.or(Pe._`typeof ${f} != "object"`,Pe._`${f} instanceof RegExp`,Pe._`typeof ${f}.compare != "function"`,d(f)))}function l(){let m=c.schema,f=i.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${m}" does not define "compare" function`);let p=t.scopeValue("formats",{key:m,ref:f,code:a.code.formats?Pe._`${a.code.formats}${Pe.getProperty(m)}`:void 0});e.fail$data(d(p))}function d(m){return Pe._`${m}.compare(${r}, ${n}) ${Ti[s].fail} 0`}},dependencies:["format"]};var zM=(e)=>(e.addKeyword(Db.formatLimitDefinition),e);Db.default=zM});var Vb=g(function(yo,Fb){Object.defineProperty(yo,"__esModule",{value:!0});var bt=gy(),KM=Mb(),ks=ee(),Lb=new ks.Name("fullFormats"),HM=new ks.Name("fastFormats"),al=(e,t={keywords:!0})=>{if(Array.isArray(t))return Ub(e,t,bt.fullFormats,Lb),e;let[r,n]=t.mode==="fast"?[bt.fastFormats,HM]:[bt.fullFormats,Lb],s=t.formats||bt.formatNames;if(Ub(e,s,r,n),t.keywords)(0,KM.default)(e);return e};al.get=(e,t="full")=>{let n=(t==="fast"?bt.fastFormats:bt.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function Ub(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=ks._`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}Fb.exports=yo=al;Object.defineProperty(yo,"__esModule",{value:!0});yo.default=al});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))BM(e,t,s,r);return YM(e,t),ZM(e,t,n),e}var BM=(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(!WM(s,o)&&n)return;Object.defineProperty(e,r,o)},WM=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)},YM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},XM=(e,t)=>`/* Wrapped ${e}*/
18
+ ${t}`,JM,QM,ZM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=XM.bind(null,n,t.toString());Object.defineProperty(s,"name",QM);let{writable:o,enumerable:a,configurable:i}=JM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:a,configurable:i})};var zb=L(()=>{JM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),QM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var eL=(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 a,i,c,u=function(...l){let d=this,m=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(d,l)},f=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(d,l)},p=s&&!a;if(clearTimeout(a),a=setTimeout(m,r),n>0&&n!==Number.POSITIVE_INFINITY&&!i)i=setTimeout(f,n);if(p)c=e.apply(d,l);return c};return il(u,e),u.cancel=()=>{if(a)clearTimeout(a),a=void 0;if(i)clearTimeout(i),i=void 0},u},cl;var Gb=L(()=>{zb();cl=eL});var _o=g(function(CH,Kb){var tL=Number.MAX_SAFE_INTEGER||9007199254740991,rL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Kb.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:tL,RELEASE_TYPES:rL,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vo=g(function(jH,Hb){var nL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Hb.exports=nL});var Ts=g(function(cr,Bb){var{MAX_SAFE_COMPONENT_LENGTH:ul,MAX_SAFE_BUILD_LENGTH:sL,MAX_LENGTH:oL}=_o(),aL=vo();cr=Bb.exports={};var iL=cr.re=[],cL=cr.safeRe=[],j=cr.src=[],uL=cr.safeSrc=[],q=cr.t={},lL=0,ll="[a-zA-Z0-9-]",dL=[["\\s",1],["\\d",oL],[ll,sL]],fL=(e)=>{for(let[t,r]of dL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=fL(t),s=lL++;aL(e,s,t),q[e]=s,j[s]=t,uL[s]=n,iL[s]=new RegExp(t,r?"g":void 0),cL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ll}*`);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",`${ll}+`);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,${ul}})(?:\\.(\\d{1,${ul}}))?(?:\\.(\\d{1,${ul}}))?`);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);cr.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);cr.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);cr.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 Ai=g(function(qH,Wb){var pL=Object.freeze({loose:!0}),mL=Object.freeze({}),hL=(e)=>{if(!e)return mL;if(typeof e!=="object")return pL;return e};Wb.exports=hL});var dl=g(function(DH,Jb){var Yb=/^[0-9]+$/,Xb=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Yb.test(e),n=Yb.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},gL=(e,t)=>Xb(t,e);Jb.exports={compareIdentifiers:Xb,rcompareIdentifiers:gL}});var He=g(function(MH,Zb){var Oi=vo(),{MAX_LENGTH:Qb,MAX_SAFE_INTEGER:Ni}=_o(),{safeRe:Pi,t:Ii}=Ts(),yL=Ai(),{compareIdentifiers:fl}=dl();class At{constructor(e,t){if(t=yL(t),e instanceof At)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>Qb)throw TypeError(`version is longer than ${Qb} characters`);Oi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Pi[Ii.LOOSE]:Pi[Ii.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>Ni||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ni||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ni||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<Ni)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(Oi("SemVer.compare",this.version,this.options,e),!(e instanceof At)){if(typeof e==="string"&&e===this.version)return 0;e=new At(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof At))e=new At(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 At))e=new At(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(Oi("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 fl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof At))e=new At(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Oi("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 fl(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?Pi[Ii.PRERELEASELOOSE]:Pi[Ii.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(fl(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}}Zb.exports=At});var Pn=g(function(LH,tw){var ew=He(),_L=(e,t,r=!1)=>{if(e instanceof ew)return e;try{return new ew(e,t)}catch(n){if(!r)return null;throw n}};tw.exports=_L});var nw=g(function(UH,rw){var vL=Pn(),bL=(e,t)=>{let r=vL(e,t);return r?r.version:null};rw.exports=bL});var ow=g(function(FH,sw){var wL=Pn(),$L=(e,t)=>{let r=wL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};sw.exports=$L});var cw=g(function(VH,iw){var aw=He(),EL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new aw(e instanceof aw?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iw.exports=EL});var dw=g(function(zH,lw){var uw=Pn(),SL=(e,t)=>{let r=uw(e,null,!0),n=uw(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,a=o?r:n,i=o?n:r,c=!!a.prerelease.length;if(!!i.prerelease.length&&!c){if(!i.patch&&!i.minor)return"major";if(i.compareMain(a)===0){if(i.minor&&!i.patch)return"minor";return"patch"}}let l=c?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};lw.exports=SL});var pw=g(function(GH,fw){var xL=He(),RL=(e,t)=>new xL(e,t).major;fw.exports=RL});var hw=g(function(KH,mw){var kL=He(),TL=(e,t)=>new kL(e,t).minor;mw.exports=TL});var yw=g(function(HH,gw){var AL=He(),OL=(e,t)=>new AL(e,t).patch;gw.exports=OL});var vw=g(function(BH,_w){var NL=Pn(),PL=(e,t)=>{let r=NL(e,t);return r&&r.prerelease.length?r.prerelease:null};_w.exports=PL});var wt=g(function(WH,ww){var bw=He(),IL=(e,t,r)=>new bw(e,r).compare(new bw(t,r));ww.exports=IL});var Ew=g(function(YH,$w){var CL=wt(),jL=(e,t,r)=>CL(t,e,r);$w.exports=jL});var xw=g(function(XH,Sw){var qL=wt(),DL=(e,t)=>qL(e,t,!0);Sw.exports=DL});var Ci=g(function(JH,kw){var Rw=He(),ML=(e,t,r)=>{let n=new Rw(e,r),s=new Rw(t,r);return n.compare(s)||n.compareBuild(s)};kw.exports=ML});var Aw=g(function(QH,Tw){var LL=Ci(),UL=(e,t)=>e.sort((r,n)=>LL(r,n,t));Tw.exports=UL});var Nw=g(function(ZH,Ow){var FL=Ci(),VL=(e,t)=>e.sort((r,n)=>FL(n,r,t));Ow.exports=VL});var bo=g(function(e5,Pw){var zL=wt(),GL=(e,t,r)=>zL(e,t,r)>0;Pw.exports=GL});var ji=g(function(t5,Iw){var KL=wt(),HL=(e,t,r)=>KL(e,t,r)<0;Iw.exports=HL});var pl=g(function(r5,Cw){var BL=wt(),WL=(e,t,r)=>BL(e,t,r)===0;Cw.exports=WL});var ml=g(function(n5,jw){var YL=wt(),XL=(e,t,r)=>YL(e,t,r)!==0;jw.exports=XL});var qi=g(function(s5,qw){var JL=wt(),QL=(e,t,r)=>JL(e,t,r)>=0;qw.exports=QL});var Di=g(function(o5,Dw){var ZL=wt(),eU=(e,t,r)=>ZL(e,t,r)<=0;Dw.exports=eU});var hl=g(function(a5,Mw){var tU=pl(),rU=ml(),nU=bo(),sU=qi(),oU=ji(),aU=Di(),iU=(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 tU(e,r,n);case"!=":return rU(e,r,n);case">":return nU(e,r,n);case">=":return sU(e,r,n);case"<":return oU(e,r,n);case"<=":return aU(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Mw.exports=iU});var Uw=g(function(i5,Lw){var cU=He(),uU=Pn(),{safeRe:Mi,t:Li}=Ts(),lU=(e,t)=>{if(e instanceof cU)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?Mi[Li.COERCEFULL]:Mi[Li.COERCE]);else{let c=t.includePrerelease?Mi[Li.COERCERTLFULL]:Mi[Li.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",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",i=t.includePrerelease&&r[6]?`+${r[6]}`:"";return uU(`${n}.${s}.${o}${a}${i}`,t)};Lw.exports=lU});var zw=g(function(c5,Vw){class Fw{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}}Vw.exports=Fw});var $t=g(function(u5,Bw){var dU=/\s+/g;class wo{constructor(e,t){if(t=pU(t),e instanceof wo)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new wo(e.raw,t);if(e instanceof Ui)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(dU," "),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)=>!Kw(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&&bU(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&&_U)|(this.options.loose&&vU))+":"+e,n=Gw.get(r);if(n)return n;let s=this.options.loose,o=s?Qe[Be.HYPHENRANGELOOSE]:Qe[Be.HYPHENRANGE];e=e.replace(o,OU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Qe[Be.COMPARATORTRIM],hU),ye("comparator trim",e),e=e.replace(Qe[Be.TILDETRIM],gU),ye("tilde trim",e),e=e.replace(Qe[Be.CARETTRIM],yU),ye("caret trim",e);let a=e.split(" ").map((l)=>wU(l,this.options)).join(" ").split(/\s+/).map((l)=>AU(l,this.options));if(s)a=a.filter((l)=>(ye("loose invalid filter",l,this.options),!!l.match(Qe[Be.COMPARATORLOOSE])));ye("range list",a);let i=new Map,c=a.map((l)=>new Ui(l,this.options));for(let l of c){if(Kw(l))return[l];i.set(l.value,l)}if(i.size>1&&i.has(""))i.delete("");let u=[...i.values()];return Gw.set(r,u),u}intersects(e,t){if(!(e instanceof wo))throw TypeError("a Range is required");return this.set.some((r)=>Hw(r,t)&&e.set.some((n)=>Hw(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 mU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(NU(this.set[t],e,this.options))return!0;return!1}}Bw.exports=wo;var fU=zw(),Gw=new fU,pU=Ai(),Ui=$o(),ye=vo(),mU=He(),{safeRe:Qe,t:Be,comparatorTrimReplace:hU,tildeTrimReplace:gU,caretTrimReplace:yU}=Ts(),{FLAG_INCLUDE_PRERELEASE:_U,FLAG_LOOSE:vU}=_o(),Kw=(e)=>e.value==="<0.0.0-0",bU=(e)=>e.value==="",Hw=(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},wU=(e,t)=>(e=e.replace(Qe[Be.BUILD],""),ye("comp",e,t),e=SU(e,t),ye("caret",e),e=$U(e,t),ye("tildes",e),e=RU(e,t),ye("xrange",e),e=TU(e,t),ye("stars",e),e),Ze=(e)=>!e||e.toLowerCase()==="x"||e==="*",$U=(e,t)=>e.trim().split(/\s+/).map((r)=>EU(r,t)).join(" "),EU=(e,t)=>{let r=t.loose?Qe[Be.TILDELOOSE]:Qe[Be.TILDE];return e.replace(r,(n,s,o,a,i)=>{ye("tilde",e,n,s,o,a,i);let c;if(Ze(s))c="";else if(Ze(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Ze(a))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(i)ye("replaceTilde pr",i),c=`>=${s}.${o}.${a}-${i} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},SU=(e,t)=>e.trim().split(/\s+/).map((r)=>xU(r,t)).join(" "),xU=(e,t)=>{ye("caret",e,t);let r=t.loose?Qe[Be.CARETLOOSE]:Qe[Be.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,a,i,c)=>{ye("caret",e,s,o,a,i,c);let u;if(Ze(o))u="";else if(Ze(a))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Ze(i))if(o==="0")u=`>=${o}.${a}.0${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(a==="0")u=`>=${o}.${a}.${i}-${c} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}-${c} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(a==="0")u=`>=${o}.${a}.${i}${n} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i} <${+o+1}.0.0-0`;return ye("caret return",u),u})},RU=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>kU(r,t)).join(" ")),kU=(e,t)=>{e=e.trim();let r=t.loose?Qe[Be.XRANGELOOSE]:Qe[Be.XRANGE];return e.replace(r,(n,s,o,a,i,c)=>{ye("xRange",e,n,s,o,a,i,c);let u=Ze(o),l=u||Ze(a),d=l||Ze(i),m=d;if(s==="="&&m)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&m){if(l)a=0;if(i=0,s===">")if(s=">=",l)o=+o+1,a=0,i=0;else a=+a+1,i=0;else if(s==="<=")if(s="<",l)o=+o+1;else a=+a+1;if(s==="<")c="-0";n=`${s+o}.${a}.${i}${c}`}else if(l)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${a}.0${c} <${o}.${+a+1}.0-0`;return ye("xRange return",n),n})},TU=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Qe[Be.STAR],"")),AU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Qe[t.includePrerelease?Be.GTE0PRE:Be.GTE0],"")),OU=(e)=>(t,r,n,s,o,a,i,c,u,l,d,m)=>{if(Ze(n))r="";else if(Ze(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Ze(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(a)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Ze(u))c="";else if(Ze(l))c=`<${+u+1}.0.0-0`;else if(Ze(d))c=`<${u}.${+l+1}.0-0`;else if(m)c=`<=${u}.${l}.${d}-${m}`;else if(e)c=`<${u}.${l}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},NU=(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===Ui.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 $o=g(function(l5,Zw){var Eo=Symbol("SemVer ANY");class Fi{static get ANY(){return Eo}constructor(e,t){if(t=Ww(t),e instanceof Fi)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),yl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Eo)this.value="";else this.value=this.operator+this.semver.version;yl("comp",this)}parse(e){let t=this.options.loose?Yw[Xw.COMPARATORLOOSE]:Yw[Xw.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=Eo;else this.semver=new Jw(r[2],this.options.loose)}toString(){return this.value}test(e){if(yl("Comparator.test",e,this.options.loose),this.semver===Eo||e===Eo)return!0;if(typeof e==="string")try{e=new Jw(e,this.options)}catch(t){return!1}return gl(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Fi))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Qw(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Qw(this.value,t).test(e.semver)}if(t=Ww(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(gl(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(gl(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Zw.exports=Fi;var Ww=Ai(),{safeRe:Yw,t:Xw}=Ts(),gl=hl(),yl=vo(),Jw=He(),Qw=$t()});var So=g(function(d5,e$){var PU=$t(),IU=(e,t,r)=>{try{t=new PU(t,r)}catch(n){return!1}return t.test(e)};e$.exports=IU});var r$=g(function(f5,t$){var CU=$t(),jU=(e,t)=>new CU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));t$.exports=jU});var s$=g(function(p5,n$){var qU=He(),DU=$t(),MU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new DU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===-1)n=a,s=new qU(n,r)}}),n};n$.exports=MU});var a$=g(function(m5,o$){var LU=He(),UU=$t(),FU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new UU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===1)n=a,s=new LU(n,r)}}),n};o$.exports=FU});var u$=g(function(h5,c$){var _l=He(),VU=$t(),i$=bo(),zU=(e,t)=>{e=new VU(e,t);let r=new _l("0.0.0");if(e.test(r))return r;if(r=new _l("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((a)=>{let i=new _l(a.semver.version);switch(a.operator){case">":if(i.prerelease.length===0)i.patch++;else i.prerelease.push(0);i.raw=i.format();case"":case">=":if(!o||i$(i,o))o=i;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${a.operator}`)}}),o&&(!r||i$(r,o)))r=o}if(r&&e.test(r))return r;return null};c$.exports=zU});var d$=g(function(g5,l$){var GU=$t(),KU=(e,t)=>{try{return new GU(e,t).range||"*"}catch(r){return null}};l$.exports=KU});var Vi=g(function(y5,h$){var HU=He(),m$=$o(),{ANY:BU}=m$,WU=$t(),YU=So(),f$=bo(),p$=ji(),XU=Di(),JU=qi(),QU=(e,t,r,n)=>{e=new HU(e,n),t=new WU(t,n);let s,o,a,i,c;switch(r){case">":s=f$,o=XU,a=p$,i=">",c=">=";break;case"<":s=p$,o=JU,a=f$,i="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(YU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,m=null;if(l.forEach((f)=>{if(f.semver===BU)f=new m$(">=0.0.0");if(d=d||f,m=m||f,s(f.semver,d.semver,n))d=f;else if(a(f.semver,m.semver,n))m=f}),d.operator===i||d.operator===c)return!1;if((!m.operator||m.operator===i)&&o(e,m.semver))return!1;else if(m.operator===c&&a(e,m.semver))return!1}return!0};h$.exports=QU});var y$=g(function(_5,g$){var ZU=Vi(),e2=(e,t,r)=>ZU(e,t,">",r);g$.exports=e2});var v$=g(function(v5,_$){var t2=Vi(),r2=(e,t,r)=>t2(e,t,"<",r);_$.exports=r2});var $$=g(function(b5,w$){var b$=$t(),n2=(e,t,r)=>(e=new b$(e,r),t=new b$(t,r),e.intersects(t,r));w$.exports=n2});var S$=g(function(w5,E$){var s2=So(),o2=wt();E$.exports=(e,t,r)=>{let n=[],s=null,o=null,a=e.sort((l,d)=>o2(l,d,r));for(let l of a)if(s2(l,t,r)){if(o=l,!s)s=l}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let i=[];for(let[l,d]of n)if(l===d)i.push(l);else if(!d&&l===a[0])i.push("*");else if(!d)i.push(`>=${l}`);else if(l===a[0])i.push(`<=${d}`);else i.push(`${l} - ${d}`);let c=i.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var O$=g(function($5,A$){var x$=$t(),bl=$o(),{ANY:vl}=bl,xo=So(),wl=wt(),a2=(e,t,r={})=>{if(e===t)return!0;e=new x$(e,r),t=new x$(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let a=c2(s,o,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},i2=[new bl(">=0.0.0-0")],R$=[new bl(">=0.0.0")],c2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vl)if(t.length===1&&t[0].semver===vl)return!0;else if(r.includePrerelease)e=i2;else e=R$;if(t.length===1&&t[0].semver===vl)if(r.includePrerelease)return!0;else t=R$;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=k$(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=T$(o,f,r);else n.add(f.semver);if(n.size>1)return null;let a;if(s&&o){if(a=wl(s.semver,o.semver,r),a>0)return null;else if(a===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!xo(f,String(s),r))return null;if(o&&!xo(f,String(o),r))return null;for(let p of t)if(!xo(f,String(p),r))return!1;return!0}let i,c,u,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let f of t){if(l=l||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(m){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===m.major&&f.semver.minor===m.minor&&f.semver.patch===m.patch)m=!1}if(f.operator===">"||f.operator===">="){if(i=k$(s,f,r),i===f&&i!==s)return!1}else if(s.operator===">="&&!xo(s.semver,String(f),r))return!1}if(o){if(d){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch)d=!1}if(f.operator==="<"||f.operator==="<="){if(c=T$(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!xo(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&a!==0)return!1}if(s&&u&&!o&&a!==0)return!1;if(o&&l&&!s&&a!==0)return!1;if(m||d)return!1;return!0},k$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},T$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};A$.exports=a2});var P$=g(function(E5,N$){var As=Ts(),zi=_o(),u2=He(),Gi=dl(),l2=Pn(),d2=nw(),f2=ow(),p2=cw(),m2=dw(),h2=pw(),g2=hw(),y2=yw(),_2=vw(),v2=wt(),b2=Ew(),w2=xw(),$2=Ci(),E2=Aw(),S2=Nw(),x2=bo(),R2=ji(),k2=pl(),T2=ml(),A2=qi(),O2=Di(),N2=hl(),P2=Uw(),I2=$o(),C2=$t(),j2=So(),q2=r$(),D2=s$(),M2=a$(),L2=u$(),U2=d$(),F2=Vi(),V2=y$(),z2=v$(),G2=$$(),K2=S$(),H2=O$();N$.exports={parse:l2,valid:d2,clean:f2,inc:p2,diff:m2,major:h2,minor:g2,patch:y2,prerelease:_2,compare:v2,rcompare:b2,compareLoose:w2,compareBuild:$2,sort:E2,rsort:S2,gt:x2,lt:R2,eq:k2,neq:T2,gte:A2,lte:O2,cmp:N2,coerce:P2,Comparator:I2,Range:C2,satisfies:j2,toComparators:q2,maxSatisfying:D2,minSatisfying:M2,minVersion:L2,validRange:U2,outside:F2,gtr:V2,ltr:z2,intersects:G2,simplifyRange:K2,subset:H2,SemVer:u2,re:As.re,src:As.src,tokens:As.t,SEMVER_SPEC_VERSION:zi.SEMVER_SPEC_VERSION,RELEASE_TYPES:zi.RELEASE_TYPES,compareIdentifiers:Gi.compareIdentifiers,rcompareIdentifiers:Gi.rcompareIdentifiers}});function C$(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return B2.call(e)===r}function j$(e){return C$(e,Uint8Array,"[object Uint8Array]")}function W2(e){return C$(e,ArrayBuffer,"[object ArrayBuffer]")}function Y2(e){return j$(e)||W2(e)}function X2(e){if(!j$(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function J2(e){if(!Y2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function $l(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)X2(s),r.set(s,n),n+=s.length;return r}function El(e,t="utf8"){return J2(e),I$[t]??=new globalThis.TextDecoder(t),I$[t].decode(e)}function Q2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function Ki(e){return Q2(e),Z2.encode(e)}var B2,I$,Z2,S5;var q$=L(()=>{B2=Object.prototype.toString;I$={utf8:new globalThis.TextDecoder("utf8")};Z2=new globalThis.TextEncoder;S5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as eF}from"util";import D$ from"process";import In from"fs";import M$ from"path";import Ro from"crypto";import tF from"assert";var U$,F$,Cn,rF,L$="aes-256-cbc",Os=()=>Object.create(null),nF=(e)=>e!==void 0&&e!==null,sF=(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`)},Hi="__internal__",Sl,Bi;var V$=L(()=>{dd();pd();zd();Gb();q$();U$=vc(ay(),1),F$=vc(Vb(),1),Cn=vc(P$(),1),rF=F$.default.default,Sl=`${Hi}.migrations.version`;Bi=class Bi{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=xc(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 U$.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});rF(o);let a={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(a);for(let[i,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[i]=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=M$.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Os(),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{tF.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 ${Hi} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(sF(s,o),this.#e.accessPropertiesByDotNotation)$c(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,a]of Object.entries(s))n(o,a)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ld(this.store,e);return e in this.store}reset(...e){for(let t of e)if(nF(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)ud(t,e);else delete t[e];this.store=t}clear(){this.store=Os();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=In.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Os(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Os();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Os();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:El(e);try{let t=e.slice(0,16),r=Ro.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=Ro.createDecipheriv(L$,r,t),s=e.slice(17),o=typeof s==="string"?Ki(s):s;return El($l([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(eF(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(){In.mkdirSync(M$.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=Ro.randomBytes(16),n=Ro.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=Ro.createCipheriv(L$,n,r);t=$l([r,Ki(":"),s.update(Ki(t)),s.final()])}if(D$.env.SNAP)In.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{qc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){In.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!In.existsSync(this.path))this._write(Os());if(D$.platform==="win32")In.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else In.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(Sl,"0.0.0"),s=Object.keys(e).filter((a)=>this._shouldPerformMigration(a,n,t)),o={...this.store};for(let a of s)try{if(r)r(this,{fromVersion:n,toVersion:a,finalVersion:t,versions:s});let i=e[a];i?.(this),this._set(Sl,a),n=a,o={...this.store}}catch(i){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${i}`)}if(this._isVersionInRangeFormat(n)||!Cn.default.eq(n,t))this._set(Sl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Hi)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Hi}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return Cn.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&Cn.default.satisfies(t,e))return!1;return Cn.default.satisfies(r,e)}if(Cn.default.lte(e,t))return!1;if(Cn.default.gt(e,r))return!1;return!0}_get(e,t){return cd(this.store,e,t)}_set(e,t){let{store:r}=this;$c(r,e,t),this.store=r}}});var se,z$,P,$r=(e)=>{switch(typeof e){case"undefined":return P.undefined;case"string":return P.string;case"number":return Number.isNaN(e)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":if(Array.isArray(e))return P.array;if(e===null)return P.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return P.promise;if(typeof Map<"u"&&e instanceof Map)return P.map;if(typeof Set<"u"&&e instanceof Set)return P.set;if(typeof Date<"u"&&e instanceof Date)return P.date;return P.object;default:return P.unknown}};var ko=L(()=>{(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 a of s)o[a]=a;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((i)=>typeof s[s[i]]!=="number"),a={};for(let i of o)a[i]=s[i];return e.objectValues(a)},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 a in s)if(Object.prototype.hasOwnProperty.call(s,a))o.push(a);return o},e.find=(s,o)=>{for(let a of s)if(o(a))return a;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((a)=>typeof a==="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(se||(se={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(z$||(z$={}));P=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var E,ft;var Wi=L(()=>{ko();E=se.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 a=r,i=0;while(i<o.path.length){let c=o.path[i];if(i!==o.path.length-1)a[c]=a[c]||{_errors:[]};else a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o));a=a[c],i++}}};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,se.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 oF=(e,t)=>{let r;switch(e.code){case E.invalid_type:if(e.received===P.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.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 se.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case E.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 E.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 E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,se.assertNever(e)}return{message:r}},mn;var xl=L(()=>{Wi();ko();mn=oF});function To(){return aF}var aF;var Yi=L(()=>{xl();aF=mn});function T(e,t){let r=To(),n=Xi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mn?void 0:mn].filter((s)=>!!s)});e.common.issues.push(n)}class We{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 We.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 Xi=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)i=u(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}},G,Ns=(e)=>({status:"dirty",value:e}),et=(e)=>({status:"valid",value:e}),Rl=(e)=>e.status==="aborted",kl=(e)=>e.status==="dirty",jn=(e)=>e.status==="valid",Ao=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=L(()=>{Yi();xl();G=Object.freeze({status:"aborted"})});var G$=()=>{};var D;var K$=L(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class Ot{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:(a,i)=>{let{message:c}=e;if(a.code==="invalid_enum_value")return{message:c??i.defaultError};if(typeof i.data>"u")return{message:c??n??i.defaultError};if(a.code!=="invalid_type")return{message:i.defaultError};return{message:c??r??i.defaultError}},description:s}}class te{get description(){return this._def.description}_getType(e){return $r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new We,ctx:{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ao(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:$r(e)},n=this._parseSync({data:e,path:r.path,parent:r});return H$(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return jn(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)=>jn(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:$r(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(Ao(n)?n:Promise.resolve(n));return H$(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),a=()=>s.addIssue({code:E.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((i)=>{if(!i)return a(),!1;else return!0});if(!o)return a(),!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 dr({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 lr.create(this,this._def)}nullable(){return hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this)}promise(){return qs.create(this,this._def)}or(e){return Co.create([this,e],this._def)}and(e){return jo.create(this,e,this._def)}transform(e){return new dr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Lo({...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 Uo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return sc.create(this,e)}readonly(){return Fo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function W$(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 EF(e){return new RegExp(`^${W$(e)}$`)}function SF(e){let t=`${B$}T${W$(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 xF(e,t){if((t==="v4"||!t)&&gF.test(e))return!0;if((t==="v6"||!t)&&_F.test(e))return!0;return!1}function RF(e,t){if(!fF.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 kF(e,t){if((t==="v4"||!t)&&yF.test(e))return!0;if((t==="v6"||!t)&&vF.test(e))return!0;return!1}function TF(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(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}function Ps(e){if(e instanceof Ie){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=lr.create(Ps(n))}return new Ie({...e._def,shape:()=>t})}else if(e instanceof ur)return new ur({...e._def,type:Ps(e.element)});else if(e instanceof lr)return lr.create(Ps(e.unwrap()));else if(e instanceof hn)return hn.create(Ps(e.unwrap()));else if(e instanceof Rr)return Rr.create(e.items.map((t)=>Ps(t)));else return e}function Ol(e,t){let r=$r(e),n=$r(t);if(e===t)return{valid:!0,data:e};else if(r===P.object&&n===P.object){let s=se.objectKeys(t),o=se.objectKeys(e).filter((i)=>s.indexOf(i)!==-1),a={...e,...t};for(let i of o){let c=Ol(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===P.array&&n===P.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let a=e[o],i=t[o],c=Ol(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===P.date&&n===P.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Y$(e,t){return new Dn({values:e,typeName:K.ZodEnum,...Q(t)})}var H$=(e,t)=>{if(jn(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}}}},iF,cF,uF,lF,dF,fF,pF,mF,hF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Al,gF,yF,_F,vF,bF,wF,B$="((\\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])))",$F,Sr,Is,Cs,Ji,No,Qi,Po,Io,Zi,qn,xr,ec,ur,Ie,Co,Er=(e)=>{if(e instanceof qo)return Er(e.schema);else if(e instanceof dr)return Er(e.innerType());else if(e instanceof Do)return[e.value];else if(e instanceof Dn)return e.options;else if(e instanceof Mo)return se.objectValues(e.enum);else if(e instanceof Lo)return Er(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof Io)return[null];else if(e instanceof lr)return[void 0,...Er(e.unwrap())];else if(e instanceof hn)return[null,...Er(e.unwrap())];else if(e instanceof Pl)return Er(e.unwrap());else if(e instanceof Fo)return Er(e.unwrap());else if(e instanceof Uo)return Er(e._def.innerType);else return[]},Nl,jo,Rr,tc,rc,js,Oo,qo,Do,Dn,Mo,qs,dr,lr,hn,Lo,Uo,nc,t3,Pl,sc,Fo,r3,K,_,ne,n3,s3,Ce,o3,a3,i3,c3,u3,l3,d3,f3,Ye,Z,p3,AF,X$,m3,h3,OF,g3,y3,_3,v3,gn,Fe,b3,w3,$3,E3,S3,x3,R3;var J$=L(()=>{Wi();Yi();K$();Tl();ko();iF=/^c[^\s-]{8,}$/i,cF=/^[0-9a-z]+$/,uF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lF=/^[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,dF=/^[a-z0-9_-]{21}$/i,fF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pF=/^[-+]?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)?)??$/,mF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gF=/^(?:(?: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])$/,yF=/^(?:(?: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])$/,_F=/^(([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]))$/,vF=/^(([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])$/,bF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$F=new RegExp(`^${B$}$`);Sr=class Sr extends te{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==P.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.string,received:s.parsedType}),G}let r=new We,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),T(n,{code:E.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),T(n,{code:E.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,a=e.data.length<s.value;if(o||a){if(n=this._getOrReturnCtx(e,n),o)T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(a)T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!mF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"email",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!Al)Al=new RegExp(hF,"u");if(!Al.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"emoji",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!lF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"uuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!dF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"nanoid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!cF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid2",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!uF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"ulid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),T(n,{validation:"url",code:E.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),T(n,{validation:"regex",code:E.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),T(n,{code:E.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),T(n,{code:E.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),T(n,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!SF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!$F.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!EF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!pF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"duration",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!xF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"ip",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!RF(e.data,s.alg))n=this._getOrReturnCtx(e,n),T(n,{validation:"jwt",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!kF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"cidr",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!bF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!wF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64url",code:E.invalid_string,message:s.message}),r.dirty()}else se.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:E.invalid_string,...D.errToObj(r)})}_addCheck(e){return new Sr({...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 Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...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}};Sr.create=(e)=>new Sr({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});Is=class Is extends te{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)!==P.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.number,received:s.parsedType}),G}let r=void 0,n=new We;for(let s of this._def.checks)if(s.kind==="int"){if(!se.isInteger(e.data))r=this._getOrReturnCtx(e,r),T(r,{code:E.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),T(r,{code:E.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),T(r,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(TF(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),T(r,{code:E.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),T(r,{code:E.not_finite,message:s.message}),n.dirty()}else se.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 Is({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Is({...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"&&se.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)}};Is.create=(e)=>new Is({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Cs=class Cs extends te{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)!==P.bigint)return this._getInvalidInput(e);let r=void 0,n=new We;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),T(r,{code:E.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),T(r,{code:E.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),T(r,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else se.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.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 Cs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Cs({...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}};Cs.create=(e)=>new Cs({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ji=class Ji extends te{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==P.boolean){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.boolean,received:r.parsedType}),G}return et(e.data)}};Ji.create=(e)=>new Ji({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});No=class No extends te{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==P.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),G}let r=new We,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),T(n,{code:E.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),T(n,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else se.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new No({...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}};No.create=(e)=>new No({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Qi=class Qi extends te{_parse(e){if(this._getType(e)!==P.symbol){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.symbol,received:r.parsedType}),G}return et(e.data)}};Qi.create=(e)=>new Qi({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.undefined,received:r.parsedType}),G}return et(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});Io=class Io extends te{_parse(e){if(this._getType(e)!==P.null){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.null,received:r.parsedType}),G}return et(e.data)}};Io.create=(e)=>new Io({typeName:K.ZodNull,...Q(e)});Zi=class Zi extends te{constructor(){super(...arguments);this._any=!0}_parse(e){return et(e.data)}};Zi.create=(e)=>new Zi({typeName:K.ZodAny,...Q(e)});qn=class qn extends te{constructor(){super(...arguments);this._unknown=!0}_parse(e){return et(e.data)}};qn.create=(e)=>new qn({typeName:K.ZodUnknown,...Q(e)});xr=class xr extends te{_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.never,received:t.parsedType}),G}};xr.create=(e)=>new xr({typeName:K.ZodNever,...Q(e)});ec=class ec extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.void,received:r.parsedType}),G}return et(e.data)}};ec.create=(e)=>new ec({typeName:K.ZodVoid,...Q(e)});ur=class ur extends te{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==P.array)return T(t,{code:E.invalid_type,expected:P.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;if(o||a)T(t,{code:o?E.too_big:E.too_small,minimum:a?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)T(t,{code:E.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)T(t,{code:E.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,a)=>n.type._parseAsync(new Ot(t,o,t.path,a)))).then((o)=>We.mergeArray(r,o));let s=[...t.data].map((o,a)=>n.type._parseSync(new Ot(t,o,t.path,a)));return We.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ur({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new ur({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new ur({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};ur.create=(e,t)=>new ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ie=class Ie extends te{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=se.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==P.object){let c=this._getOrReturnCtx(e);return T(c,{code:E.invalid_type,expected:P.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))a.push(c)}let i=[];for(let c of o){let u=s[c],l=n.data[c];i.push({key:{status:"valid",value:c},value:u._parse(new Ot(n,l,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof xr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)i.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(a.length>0)T(n,{code:E.unrecognized_keys,keys:a}),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 a){let l=n.data[u];i.push({key:{status:"valid",value:u},value:c._parse(new Ot(n,l,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of i){let l=await u.key,d=await u.value;c.push({key:l,value:d,alwaysSet:u.alwaysSet})}return c}).then((c)=>We.mergeObjectSync(r,c));else return We.mergeObjectSync(r,i)}get shape(){return this._def.shape()}strict(e){return D.errToObj,new Ie({...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 Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({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 Ie({...this._def,catchall:e})}pick(e){let t={};for(let r of se.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Ie({...this._def,shape:()=>t})}omit(e){let t={};for(let r of se.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ie({...this._def,shape:()=>t})}deepPartial(){return Ps(this)}partial(e){let t={};for(let r of se.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new Ie({...this._def,shape:()=>t})}required(e){let t={};for(let r of se.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof lr)s=s._def.innerType;t[r]=s}return new Ie({...this._def,shape:()=>t})}keyof(){return Y$(se.objectKeys(this.shape))}};Ie.create=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ie.strictCreate=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ie.lazycreate=(e,t)=>new Ie({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Co=class Co extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map((a)=>new ft(a.ctx.common.issues));return T(t,{code:E.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 i of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=i._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 a=o.map((i)=>new ft(i));return T(t,{code:E.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}};Co.create=(e,t)=>new Co({options:e,typeName:K.ZodUnion,...Q(t)});Nl=class Nl extends te{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return T(t,{code:E.invalid_type,expected:P.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return T(t,{code:E.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=Er(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(n.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new Nl({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};jo=class jo extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(Rl(s)||Rl(o))return G;let a=Ol(s.value,o.value);if(!a.valid)return T(r,{code:E.invalid_intersection_types}),G;if(kl(s)||kl(o))t.dirty();return{status:t.value,value:a.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}))}};jo.create=(e,t,r)=>new jo({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});Rr=class Rr extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.array)return T(r,{code:E.invalid_type,expected:P.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return T(r,{code:E.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)T(r,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,a)=>{let i=this._def.items[a]||this._def.rest;if(!i)return null;return i._parse(new Ot(r,o,r.path,a))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>We.mergeArray(t,o));else return We.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Rr({...this._def,rest:e})}};Rr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};tc=class tc extends te{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!==P.object)return T(r,{code:E.invalid_type,expected:P.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)n.push({key:s._parse(new Ot(r,a,r.path,a)),value:o._parse(new Ot(r,r.data[a],r.path,a)),alwaysSet:a in r.data});if(r.common.async)return We.mergeObjectAsync(t,n);else return We.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof te)return new tc({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new tc({keyType:Sr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};rc=class rc extends te{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!==P.map)return T(r,{code:E.invalid_type,expected:P.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,i],c)=>({key:n._parse(new Ot(r,a,r.path,[c,"key"])),value:s._parse(new Ot(r,i,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let i of o){let c=await i.key,u=await i.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let i of o){let{key:c,value:u}=i;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}}}};rc.create=(e,t,r)=>new rc({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});js=class js extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.set)return T(r,{code:E.invalid_type,expected:P.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)T(r,{code:E.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)T(r,{code:E.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(i){let c=new Set;for(let u of i){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let a=[...r.data.values()].map((i,c)=>s._parse(new Ot(r,i,r.path,c)));if(r.common.async)return Promise.all(a).then((i)=>o(i));else return o(a)}min(e,t){return new js({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new js({...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)}};js.create=(e,t)=>new js({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends te{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return T(t,{code:E.invalid_type,expected:P.function,received:t.parsedType}),G;function r(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_arguments,argumentsError:i}})}function n(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:i}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof qs){let a=this;return et(async function(...i){let c=new ft([]),u=await a._def.args.parseAsync(i,s).catch((m)=>{throw c.addIssue(r(i,m)),c}),l=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(l,s).catch((m)=>{throw c.addIssue(n(l,m)),c})})}else{let a=this;return et(function(...i){let c=a._def.args.safeParse(i,s);if(!c.success)throw new ft([r(i,c.error)]);let u=Reflect.apply(o,this,c.data),l=a._def.returns.safeParse(u,s);if(!l.success)throw new ft([n(u,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:Rr.create(e).rest(qn.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:Rr.create([]).rest(qn.create()),returns:t||qn.create(),typeName:K.ZodFunction,...Q(r)})}};qo=class qo extends te{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})}};qo.create=(e,t)=>new qo({getter:e,typeName:K.ZodLazy,...Q(t)});Do=class Do extends te{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return T(t,{received:t.data,code:E.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};Do.create=(e,t)=>new Do({value:e,typeName:K.ZodLiteral,...Q(t)});Dn=class Dn extends te{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{expected:se.joinValues(r),received:t.parsedType,code:E.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 T(t,{received:t.data,code:E.invalid_enum_value,options:r}),G}return et(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 Dn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Dn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Dn.create=Y$;Mo=class Mo extends te{_parse(e){let t=se.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==P.string&&r.parsedType!==P.number){let n=se.objectValues(t);return T(r,{expected:se.joinValues(n),received:r.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(se.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=se.objectValues(t);return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),G}return et(e.data)}get enum(){return this._def.values}};Mo.create=(e,t)=>new Mo({values:e,typeName:K.ZodNativeEnum,...Q(t)});qs=class qs extends te{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.promise&&t.common.async===!1)return T(t,{code:E.invalid_type,expected:P.promise,received:t.parsedType}),G;let r=t.parsedType===P.promise?t.data:Promise.resolve(t.data);return et(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};qs.create=(e,t)=>new qs({type:e,typeName:K.ZodPromise,...Q(t)});dr=class dr extends te{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(T(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(a)=>{if(t.value==="aborted")return G;let i=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return Ns(i.value);if(t.value==="dirty")return Ns(i.value);return i});else{if(t.value==="aborted")return G;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return Ns(a.value);if(t.value==="dirty")return Ns(a.value);return a}}if(n.type==="refinement"){let o=(a)=>{let i=n.refinement(a,s);if(r.common.async)return Promise.resolve(i);if(i instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value),{status:t.value,value:a.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((a)=>{if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value).then(()=>({status:t.value,value:a.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(!jn(o))return G;let a=n.transform(o.value,s);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!jn(o))return G;return Promise.resolve(n.transform(o.value,s)).then((a)=>({status:t.value,value:a}))});se.assertNever(n)}};dr.create=(e,t,r)=>new dr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});dr.createWithPreprocess=(e,t,r)=>new dr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});lr=class lr extends te{_parse(e){if(this._getType(e)===P.undefined)return et(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:K.ZodOptional,...Q(t)});hn=class hn extends te{_parse(e){if(this._getType(e)===P.null)return et(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hn.create=(e,t)=>new hn({innerType:e,typeName:K.ZodNullable,...Q(t)});Lo=class Lo extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===P.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Uo=class Uo extends te{_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(Ao(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}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});nc=class nc extends te{_parse(e){if(this._getType(e)!==P.nan){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};nc.create=(e)=>new nc({typeName:K.ZodNaN,...Q(e)});t3=Symbol("zod_brand");Pl=class Pl extends te{_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}};sc=class sc extends te{_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(),Ns(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 sc({in:e,out:t,typeName:K.ZodPipeline})}};Fo=class Fo extends te{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(jn(n))n.value=Object.freeze(n.value);return n};return Ao(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Fo.create=(e,t)=>new Fo({innerType:e,typeName:K.ZodReadonly,...Q(t)});r3={object:Ie.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={}));_=Sr.create,ne=Is.create,n3=nc.create,s3=Cs.create,Ce=Ji.create,o3=No.create,a3=Qi.create,i3=Po.create,c3=Io.create,u3=Zi.create,l3=qn.create,d3=xr.create,f3=ec.create,Ye=ur.create,Z=Ie.create,p3=Ie.strictCreate,AF=Co.create,X$=Nl.create,m3=jo.create,h3=Rr.create,OF=tc.create,g3=rc.create,y3=js.create,_3=Oo.create,v3=qo.create,gn=Do.create,Fe=Dn.create,b3=Mo.create,w3=qs.create,$3=dr.create,E3=lr.create,S3=hn.create,x3=dr.createWithPreprocess,R3=sc.create});var Il=L(()=>{Yi();Tl();G$();ko();J$();Wi()});var _n=L(()=>{Il();Il()});function D3(e){return PF.includes(e)}var NF,Mn,PF,M3,IF,Q$,CF,Z$,jF,qF,L3,DF,U3,F3,V3,z3,MF,eE,LF,tE,G3=20,K3=500,UF,H3;var oc=L(()=>{_n();NF=Fe(["pending","verified","approved","revoked"]),Mn=Fe(["person","service","test"]),PF=Mn.options;M3={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"},IF=Fe(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Q$=IF.options,CF=Fe(["active","pending","revoked"]),Z$=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),jF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:ne().int().optional(),sandbox_completed:Ce().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:Ce().optional(),status:NF.optional(),email_verified:Ce().optional(),orcid_verified:Ce().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:Ye(Z$).optional(),username_auto_assigned:Ce().optional(),account_kind:Mn.optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),qF=Z({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),L3=Z({user:jF,token:qF.optional()}).passthrough(),DF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:ne().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:ne().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),orcid:_().nullable().optional(),upload_access_requested_at:_().nullable().optional(),account_kind:Mn.optional(),matched_in:Ye(_()).optional(),match_kind:_().optional()}).passthrough(),U3=Z({users:Ye(DF),count:ne().int()}).passthrough(),F3=Fe(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),V3=Fe(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),z3=Z({suggestion:_().nullable(),based_on:Fe(["name","unavailable","exhausted"])}).passthrough(),MF=Fe(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),eE=MF.options,LF=Fe(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),tE=LF.options,UF=Z({id:ne().int(),email:_(),username:_().nullable(),role:_(),status:CF,email_verified:Ce(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:Ce(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:Ce(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:Ye(Z$),username_auto_assigned:Ce(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),H3=Z({user:UF.nullable()}).passthrough()});function fr(e){if(e instanceof Error)return e.message;return String(e)}function W3(e){if(!(e instanceof pr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var pr,Cl;var jl=L(()=>{pr=class pr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;retryAfterSeconds;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"}};Cl=class Cl extends pr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function zF(){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=rE(),be.color.ansi256=nE(),be.color.ansi16m=sE(),be.bgColor.ansi=rE(10),be.bgColor.ansi256=nE(10),be.bgColor.ansi16m=sE(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 i=t%36;r=Math.floor(t/36)/5,n=Math.floor(i/6)/5,s=i%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let a=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)a+=60;return a},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 rE=(e=0)=>(t)=>`\x1B[${t+e}m`,nE=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,sE=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,be,X3,FF,VF,J3,GF,Nt;var oE=L(()=>{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]}},X3=Object.keys(be.modifier),FF=Object.keys(be.color),VF=Object.keys(be.bgColor),J3=[...FF,...VF];GF=zF(),Nt=GF});import ql from"process";import KF from"os";import aE from"tty";function Et(e,t=globalThis.Deno?globalThis.Deno.args:ql.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function HF(){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 BF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function WF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=HF();if(n!==void 0)ac=n;let s=r?ac:n;if(s===0)return 0;if(r){if(Et("color=16m")||Et("color=full")||Et("color=truecolor"))return 3;if(Et("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(ql.platform==="win32"){let a=KF.release().split(".");if(Number(a[0])>=10&&Number(a[2])>=10586)return Number(a[2])>=14931?3:2;return 1}if("CI"in we){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((a)=>(a in we)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((a)=>(a 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 a=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return a>=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 iE(e,t={}){let r=WF(e,{streamIsTTY:e&&e.isTTY,...t});return BF(r)}var we,ac,YF,cE;var uE=L(()=>{({env:we}=ql);if(Et("no-color")||Et("no-colors")||Et("color=false")||Et("color=never"))ac=0;else if(Et("color")||Et("colors")||Et("color=true")||Et("color=always"))ac=1;YF={stdout:iE({isTTY:aE.isatty(1)}),stderr:iE({isTTY:aE.isatty(2)})},cE=YF});function lE(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,a="";do a+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return a+=e.slice(o),a}function dE(e,t,r,n){let s=0,o="";do{let a=e[n-1]==="\r";o+=e.slice(s,a?n-1:n)+t+(a?`\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 WF(e)}var fE,pE,Ml,Cs,Fo,hE,js,BF=(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=fE?fE.level:0;e.level=t.level===void 0?r:t.level},WF=(e)=>{let t=(...r)=>r.join(" ");return BF(t,e),Object.setPrototypeOf(t,Vo.prototype),t},Ll=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return It[r].ansi16m(...n);if(t==="ansi256")return It[r].ansi256(It.rgbToAnsi256(...n));return It[r].ansi(It.rgbToAnsi(...n))}if(e==="hex")return Ll("rgb",t,r,...It.hexToRgb(...n));return It[r][e](...n)},YF,XF,Ul=(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}},ic=(e,t,r)=>{let n=(...s)=>JF(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,XF),n[Ml]=e,n[Cs]=t,n[Fo]=r,n},JF=(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=lE(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
22
- `);if(o!==-1)t=dE(t,s,n,o);return n+t+s},QF,tB,Pt;var Fl=F(()=>{oE();uE();({stdout:fE,stderr:pE}=cE),Ml=Symbol("GENERATOR"),Cs=Symbol("STYLER"),Fo=Symbol("IS_EMPTY"),hE=["ansi","ansi","ansi256","ansi16m"],js=Object.create(null);Object.setPrototypeOf(Vo.prototype,Function.prototype);for(let[e,t]of Object.entries(It))js[e]={get(){let r=ic(this,Ul(t.open,t.close,this[Cs]),this[Fo]);return Object.defineProperty(this,e,{value:r}),r}};js.visible={get(){let e=ic(this,this[Cs],!0);return Object.defineProperty(this,"visible",{value:e}),e}};YF=["rgb","hex","ansi256"];for(let e of YF){js[e]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,hE[r],"color",...n),It.color.close,this[Cs]);return ic(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=Ul(Ll(e,hE[r],"bgColor",...n),It.bgColor.close,this[Cs]);return ic(this,s,this[Fo])}}}}XF=Object.defineProperties(()=>{},{...js,level:{enumerable:!0,get(){return this[Ml].level},set(e){this[Ml].level=e}}});Object.defineProperties(Vo.prototype,js);QF=Vo(),tB=Vo({level:pE?pE.level:0}),Pt=QF});function nB(e){Vl=e}function ac(){return Vl}function qs(e){if(Vl)process.stderr.write(`${e}
23
- `)}var Vl=!1;var{spawn:ZF}=globalThis.Bun;function zl(e,t=[]){let r=e.replace(eV,'("$1","<redacted>")');for(let n of t)if(n.length>=tV)r=r.split(n).join("<redacted>");return r}function nV(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 mE(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 gE(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=ZF({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??rV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ac()?[...nV(r),...t.redact??[]]:[];if(ac()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Pt.dim(zl(`$ ${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([mE(n.stdout,l),mE(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ac()){if(t.sensitiveOutput)qs(Pt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Pt.dim(zl(p.trimEnd(),d)));if(f.trim())qs(Pt.yellow(zl(f.trimEnd(),d)))}qs(Pt.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 eV,tV=8,rV=120000;var yE=F(()=>{Fl();eV=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function oV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function vE(e,t=oV()){return e.installInstructions[t]}function iV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function cV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:aV}async function $E(e){try{let{exitCode:t,stdout:r,timedOut:n}=await gE(e.cmd,{timeout:cV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:iV(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 Gl(){let e=Object.entries(_E);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await $E(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:vE(r)}}))}async function lB(){let t=(await Gl()).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 dB(e){let r=sV[e].map((i)=>_E[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await $E(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:vE(i.check)}));if(s.length===0)return;let o=[`
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 _E,sV,aV=4000;var bE=F(()=>{yE();_E={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)"}}},sV={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 EE;var wE=F(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-PR2297.8fed331",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var cc;var Kl=F(()=>{wE();cc=EE.version});import{mkdirSync as lV,readdirSync as dV,unlinkSync as fV,writeFileSync as pV}from"fs";import{join as Hl}from"path";function wB(){Ds=!0}function dc(){return Ds}function EB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function SB(e){TE=e,mr(`Step: ${e}`)}function xB(){RE=!0}function RB(){return RE}function kB(){if(kE)return;Wl=!0}function TB(){Wl=!1,kE=!0}function OB(){return Wl}function mr(e){if(Ds)process.stderr.write(`[debug] ${e}
27
- `)}function yV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=gV.has(r.toLowerCase())?"[REDACTED]":n;return t}function AE(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Bl(e,t,r=0){if(r>vV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Bl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Bl(s,o,r+1);return n}if(typeof t==="string"){if(_V.test(e))return"[REDACTED]";return t.replace(OE,AE)}return t}function Yl(e){return e.replace($V,"Bearer [REDACTED]").replace(bV,"[REDACTED_AWS_KEY]").replace(wV,"$1[REDACTED]").replace(EV,"$1$2=[REDACTED]").replace(OE,AE)}function SV(e){return Yl(e)}function SE(e,t=mV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Bl("",n))}catch{}if(r=Yl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function fc(e){if(!Ds)return;let t=SV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?yV(e.requestHeaders):void 0,requestBody:SE(e.requestBody),responseBody:SE(e.responseBody)};lc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=pr(r);lc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),mr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function xV(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${cc}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${pr(t)})`)}e.push(""),e.push("Active account:");try{let t=mn();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: ${pr(t)})`)}e.push(""),e.push("External tools:");try{let t=await Gl();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: ${pr(t)})`)}return e}async function RV(){return(await xV()).join(`
28
- `)}async function AB(){if(!Ds||uc!==void 0)return;try{uc=await RV()}catch(e){let t=pr(e);uc=`(could not build environment report: ${t})`,mr(`environment snapshot failed: ${t}`)}}function NE(e){if(xE.has(e))return{flag:e};for(let t of xE){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 kV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(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 TV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function OV(e){let t=[];for(let n of TV(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 AV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Yl(kV(e).join(" "))}`),r.push(""),r.push(uc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),lc.length===0)r.push(" (none)");else lc.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: ${TE??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
21
+ `,s)}while(n!==-1);return o+=e.slice(s),o}function zo(e){return JF(e)}var fE,pE,Ml,Ds,Vo,mE,Ms,XF=(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=fE?fE.level:0;e.level=t.level===void 0?r:t.level},JF=(e)=>{let t=(...r)=>r.join(" ");return XF(t,e),Object.setPrototypeOf(t,zo.prototype),t},Ll=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return Nt[r].ansi16m(...n);if(t==="ansi256")return Nt[r].ansi256(Nt.rgbToAnsi256(...n));return Nt[r].ansi(Nt.rgbToAnsi(...n))}if(e==="hex")return Ll("rgb",t,r,...Nt.hexToRgb(...n));return Nt[r][e](...n)},QF,ZF,Ul=(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}},ic=(e,t,r)=>{let n=(...s)=>eV(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,ZF),n[Ml]=e,n[Ds]=t,n[Vo]=r,n},eV=(e,t)=>{if(e.level<=0||!t)return e[Vo]?"":t;let r=e[Ds];if(r===void 0)return t;let{openAll:n,closeAll:s}=r;if(t.includes("\x1B"))while(r!==void 0)t=lE(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
22
+ `);if(o!==-1)t=dE(t,s,n,o);return n+t+s},tV,iB,Pt;var Fl=L(()=>{oE();uE();({stdout:fE,stderr:pE}=cE),Ml=Symbol("GENERATOR"),Ds=Symbol("STYLER"),Vo=Symbol("IS_EMPTY"),mE=["ansi","ansi","ansi256","ansi16m"],Ms=Object.create(null);Object.setPrototypeOf(zo.prototype,Function.prototype);for(let[e,t]of Object.entries(Nt))Ms[e]={get(){let r=ic(this,Ul(t.open,t.close,this[Ds]),this[Vo]);return Object.defineProperty(this,e,{value:r}),r}};Ms.visible={get(){let e=ic(this,this[Ds],!0);return Object.defineProperty(this,"visible",{value:e}),e}};QF=["rgb","hex","ansi256"];for(let e of QF){Ms[e]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,mE[r],"color",...n),Nt.color.close,this[Ds]);return ic(this,s,this[Vo])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Ms[t]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,mE[r],"bgColor",...n),Nt.bgColor.close,this[Ds]);return ic(this,s,this[Vo])}}}}ZF=Object.defineProperties(()=>{},{...Ms,level:{enumerable:!0,get(){return this[Ml].level},set(e){this[Ml].level=e}}});Object.defineProperties(zo.prototype,Ms);tV=zo(),iB=zo({level:pE?pE.level:0}),Pt=tV});function uB(e){Vl=e}function cc(){return Vl}function Ls(e){if(Vl)process.stderr.write(`${e}
23
+ `)}var Vl=!1;var{spawn:rV}=globalThis.Bun;function zl(e,t=[]){let r=e.replace(nV,'("$1","<redacted>")');for(let n of t)if(n.length>=sV)r=r.split(n).join("<redacted>");return r}function aV(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 hE(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:a}=await r.read();if(o)break;if(a.byteLength===0)continue;t(),s+=n.decode(a,{stream:!0})}return s+n.decode()}async function gE(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=rV({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,a,i=performance.now(),c=()=>{if(a!==void 0)clearTimeout(a),a=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),a=setTimeout(()=>{a=void 0;try{t.onInactivityWarning?.(performance.now()-i)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??oV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let l=cc()?[...aV(r),...t.redact??[]]:[];if(cc()){let y=t.cwd?` (cwd=${t.cwd})`:"";Ls(Pt.dim(zl(`$ ${e.join(" ")}${y}`,l)))}let d=()=>{i=performance.now(),u()},m,f,p,h=n.exited.then((y)=>(c(),y));try{[m,f,p]=await Promise.all([hE(n.stdout,d),hE(n.stderr,d),h])}finally{if(c(),o)clearTimeout(o)}if(cc()){if(t.sensitiveOutput)Ls(Pt.dim("[sensitive subprocess output suppressed]"));else{if(m.trim())Ls(Pt.dim(zl(m.trimEnd(),l)));if(f.trim())Ls(Pt.yellow(zl(f.trimEnd(),l)))}Ls(Pt.dim(`(exit ${p})`))}if(s)return{stdout:m,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:p??1,timedOut:!0};return{stdout:m,stderr:f,exitCode:p,timedOut:!1}}var nV,sV=8,oV=120000;var yE=L(()=>{Fl();nV=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function cV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function vE(e,t=cV()){return e.installInstructions[t]}function uV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function dV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:lV}async function bE(e){try{let{exitCode:t,stdout:r,timedOut:n}=await gE(e.cmd,{timeout:dV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:uV(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 Gl(){let e=Object.entries(_E);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await bE(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:vE(r)}}))}async function gB(){let t=(await Gl()).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 yB(e){let r=iV[e].map((a)=>_E[a]).filter(Boolean),n=await Promise.all(r.map(async(a)=>{let i=await bE(a);return{check:a,available:i.available,timedOut:i.timedOut}}));for(let a of n)if(a.timedOut&&a.check.required)console.warn(`Warning: ${a.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((a)=>!a.available&&!a.timedOut&&a.check.required).map((a)=>({tool:a.check.name,installInstruction:vE(a.check)}));if(s.length===0)return;let o=[`
25
+ Missing required tools:`];for(let a of s)o.push(` ${a.tool} not installed`),o.push(` Install: ${a.installInstruction}`);throw Error(o.join(`
26
+ `))}var _E,iV,lV=4000;var wE=L(()=>{yE();_E={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)"}}},iV={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 EE;var $E=L(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-PR2299.629ae51",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var uc;var Kl=L(()=>{$E();uc=EE.version});import{mkdirSync as pV,readdirSync as mV,unlinkSync as hV,writeFileSync as gV}from"fs";import{join as Hl}from"path";function TB(){Us=!0}function fc(){return Us}function AB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function OB(e){TE=e,mr(`Step: ${e}`)}function NB(){RE=!0}function PB(){return RE}function IB(){if(kE)return;Wl=!0}function CB(){Wl=!1,kE=!0}function jB(){return Wl}function mr(e){if(Us)process.stderr.write(`[debug] ${e}
27
+ `)}function bV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=vV.has(r.toLowerCase())?"[REDACTED]":n;return t}function OE(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Bl(e,t,r=0){if(r>$V)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Bl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Bl(s,o,r+1);return n}if(typeof t==="string"){if(wV.test(e))return"[REDACTED]";return t.replace(AE,OE)}return t}function Yl(e){return e.replace(EV,"Bearer [REDACTED]").replace(SV,"[REDACTED_AWS_KEY]").replace(xV,"$1[REDACTED]").replace(RV,"$1$2=[REDACTED]").replace(AE,OE)}function kV(e){return Yl(e)}function SE(e,t=_V){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Bl("",n))}catch{}if(r=Yl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function pc(e){if(!Us)return;let t=kV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?bV(e.requestHeaders):void 0,requestBody:SE(e.requestBody),responseBody:SE(e.responseBody)};dc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=fr(r);dc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),mr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function TV(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${uc}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${fr(t)})`)}e.push(""),e.push("Active account:");try{let t=vn();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: ${fr(t)})`)}e.push(""),e.push("External tools:");try{let t=await Gl();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: ${fr(t)})`)}return e}async function AV(){return(await TV()).join(`
28
+ `)}async function qB(){if(!Us||lc!==void 0)return;try{lc=await AV()}catch(e){let t=fr(e);lc=`(could not build environment report: ${t})`,mr(`environment snapshot failed: ${t}`)}}function NE(e){if(xE.has(e))return{flag:e};for(let t of xE){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 OV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(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 NV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function PV(e){let t=[];for(let n of NV(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 IV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Yl(OV(e).join(" "))}`),r.push(""),r.push(lc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),dc.length===0)r.push(" (none)");else dc.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: ${TE??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
29
29
  `)}
30
- `}function NV(e,t){let r;try{r=dV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")mr(`could not list ${e} for log rotation: ${pr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{fV(Hl(e,r[s]))}catch(o){if(o.code!=="ENOENT")mr(`could not remove old log ${r[s]}: ${pr(o)}`)}}function NB(){return zo}function IB(e,t){if(!Ds)return null;let r=Hl(Jl(),"logs");try{lV(r,{recursive:!0})}catch(i){return zo=pr(i),mr(`could not create log directory ${r}: ${zo}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${OV(e)}.log`,o=Hl(r,s);try{pV(o,AV(e,t),"utf8")}catch(i){return zo=pr(i),mr(`could not write log file ${o}: ${zo}`),null}return NV(r,hV),o}var hV=10,mV=2048,Ds=!1,RE=!1,Wl=!1,kE=!1,TE,uc,lc,gV,_V,OE,vV=32,$V,bV,wV,EV,xE,zo;var Xl=F(()=>{jl();pc();bE();Kl();lc=[];gV=new Set(["authorization","cookie","set-cookie","x-api-key","x-approval-dispatch-token"]);_V=/^(api[_-]?key|apikey|password|token|secret|access[_-]?key(_id)?|secret[_-]?access[_-]?key|session|session[_-]?token|authorization|ssh[_-]?key|private[_-]?key|device[_-]?code|dispatch[_-]?token|client[_-]?secret)$/i,OE=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;$V=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,bV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,wV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,EV=/([?&])(X-Amz-Signature|X-Amz-Security-Token|X-Amz-Credential|Signature|AWSAccessKeyId)=[^&\s"']+/gi;xE=new Set(["-k","--key","--password","--api-key"])});import{chmodSync as IV,copyFileSync as PV,existsSync as Ql,mkdirSync as CV,statSync as jV}from"fs";import{homedir as hc}from"os";import{join as Ms}from"path";function DV(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 Jl(){return process.env.NEMAR_CONFIG_DIR||Ms(hc(),".config","nemar")}function LV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Ms(e,"config.json");if(Ql(t))return;let r=[];if(process.platform==="darwin")r.push(Ms(hc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Ms(hc(),"AppData","Roaming");r.push(Ms(n,"nemar-nodejs","config.json"))}r.push(Ms(hc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Ql(n))try{CV(e,{recursive:!0}),PV(n,t),console.error(`[nemar] Config migrated from ${n} to ${t}
30
+ `}function CV(e,t){let r;try{r=mV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")mr(`could not list ${e} for log rotation: ${fr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{hV(Hl(e,r[s]))}catch(o){if(o.code!=="ENOENT")mr(`could not remove old log ${r[s]}: ${fr(o)}`)}}function DB(){return Go}function MB(e,t){if(!Us)return null;let r=Hl(Jl(),"logs");try{pV(r,{recursive:!0})}catch(a){return Go=fr(a),mr(`could not create log directory ${r}: ${Go}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${PV(e)}.log`,o=Hl(r,s);try{gV(o,IV(e,t),"utf8")}catch(a){return Go=fr(a),mr(`could not write log file ${o}: ${Go}`),null}return CV(r,yV),o}var yV=10,_V=2048,Us=!1,RE=!1,Wl=!1,kE=!1,TE,lc,dc,vV,wV,AE,$V=32,EV,SV,xV,RV,xE,Go;var Xl=L(()=>{jl();mc();wE();Kl();dc=[];vV=new Set(["authorization","cookie","set-cookie","x-api-key","x-approval-dispatch-token"]);wV=/^(api[_-]?key|apikey|password|token|secret|access[_-]?key(_id)?|secret[_-]?access[_-]?key|session|session[_-]?token|authorization|ssh[_-]?key|private[_-]?key|device[_-]?code|dispatch[_-]?token|client[_-]?secret)$/i,AE=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;EV=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,SV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,xV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,RV=/([?&])(X-Amz-Signature|X-Amz-Security-Token|X-Amz-Credential|Signature|AWSAccessKeyId)=[^&\s"']+/gi;xE=new Set(["-k","--key","--password","--api-key"])});import{chmodSync as jV,copyFileSync as qV,existsSync as Ql,mkdirSync as DV,statSync as MV}from"fs";import{homedir as hc}from"os";import{join as Fs}from"path";function UV(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 Jl(){return process.env.NEMAR_CONFIG_DIR||Fs(hc(),".config","nemar")}function VV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Fs(e,"config.json");if(Ql(t))return;let r=[];if(process.platform==="darwin")r.push(Fs(hc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Fs(hc(),"AppData","Roaming");r.push(Fs(n,"nemar-nodejs","config.json"))}r.push(Fs(hc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Ql(n))try{DV(e,{recursive:!0}),qV(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 xt(){let e=Jl();if(Go&&IE===e)return Go;if(LV(e),Go=new Ha({projectName:"nemar",configFileMode:Zl,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}),IE=e,!PE.has(e))PE.add(e),UV(Go.path),VV(),zV();return Go}function UV(e){if(process.platform==="win32")return;if(!Ql(e))return;try{if((jV(e).mode&511)!==Zl)IV(e,Zl)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function VV(){let e=xt(),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 FV){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 zV(){let e=xt(),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(qV.has(DV(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 xt().get("activeAccount")}function gn(){return xt().get("accounts")||{}}function mn(){let e={apiUrl:Ls},t=Ko();if(!t)return e;return gn()[t]||e}function VB(e,t){let r=xt(),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 zB(e){let t=Ko();if(!t)return;let r=gn();if(r[t])delete r[t][e],xt().set("accounts",r)}function GB(){let e=xt(),t=Ko();if(!t){e.clear();return}let r=gn();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 KB(){xt().clear()}function HB(){return!!mn().apiKey}function BB(){return xt().path}function WB(){let e=gn(),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 YB(e){return e.username?.trim()||e.email}function GV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(gn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){mr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function XB(e,t){let r=xt(),n=gn(),s;if(n[e])s=e;else if(t.email)s=GV(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 JB(e){let t=e.trim();if(!t)return"unchanged";let r=xt(),n=Ko();if(!n||n===t)return"unchanged";let s=gn(),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 QB(e){let t=xt(),r=gn();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",Zl=384,qV,MV,FB,Go=null,IE=null,PE,FV;var pc=F(()=>{Vw();jn();sc();Xl();qV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);MV=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),FB=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(MV).optional(),orcidVerified:Ue().optional(),role:v().optional(),accountKind:qn.optional(),pendingEmailChange:v().email().optional()});PE=new Set;FV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var KV,HV,r6,BV,n6,WV,CE,s6,o6=8,i6=100,jE,a6,YV,c6;var qE=F(()=>{jn();sc();KV=["given_name","family_name","affiliation","city","country"],HV=["username","github_username","email","orcid"],r6=[...KV,...HV],BV={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()},n6=ne(BV),WV=Ve(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),CE=WV.options,s6=["exact","name","prefix","substring","fuzzy"],jE=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(),a6=ne({user:jE}).passthrough(),YV=ne({from:v().nullable(),to:v().nullable()}),c6=ne({message:v(),changed:kF(v(),YV),notes:Ze(v()).optional(),old_address_notified:Ue().optional(),user:jE}).passthrough()});var d6=120,f6=64,p6="unnamed machine",XV=25,DE,h6,Us,ME,m6,g6,y6,JV,QV,_6,ed,v6,$6,b6,w6,E6;var LE=F(()=>{jn();DE=Ve(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),h6={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"]),ME=Us.options,m6={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 ${XV} 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."},g6=ne({error:Us,message:v()}).passthrough(),y6=ne({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:fe().int(),interval:fe().int()}).passthrough(),JV=Xw("error",[ne({error:Pn("authorization_pending"),message:v()}).passthrough(),ne({error:Pn("slow_down"),message:v()}).passthrough()]),QV=Xw("error",[ne({error:Pn("expired_token"),reason:Us,message:v()}).passthrough(),ne({error:Pn("access_denied"),reason:Us,message:v()}).passthrough(),ne({error:Pn("invalid_grant"),reason:Us,message:v()}).passthrough()]),_6=RF([JV,QV]),ed=ne({id:fe().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ue()}).passthrough(),v6=ne({api_key:v(),key:ed,user:ne({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ue(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),$6=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(),b6=ne({ok:Pn(!0),machine_name:v()}).passthrough(),w6=ne({keys:Ze(ed)}).passthrough(),E6=ne({api_key:v(),key:ed}).passthrough()});var ZV,UE,Ho="https://nemar.org/settings",R6,e9,t9,r9,k6,T6;var FE=F(()=>{jn();ZV=Ve(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),UE=ZV.options,R6={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."},e9=Ve(["orcid","email","github"]),t9=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(),r9=ne({kind:e9,value:v(),canonical_user_id:fe().int(),accounts:Ze(t9)}).passthrough(),k6=ne({groups:Ze(r9),group_count:fe().int(),flagged_count:fe().int()}).passthrough(),T6=ne({ok:Pn(!0),id:fe().int(),cleared:Ue()}).passthrough()});function A6(e){return Bo[e]}function N6(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Bo;var VE=F(()=>{Bo={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","mail.category.news.label":"News","mail.category.news.description":"New features, data and events.","mail.category.rfcs.label":"Requests for comments","mail.category.rfcs.description":"A new NEMAR request for comments is open for discussion.","mail.category.maintenance.label":"Maintenance","mail.category.maintenance.description":"Planned downtime and changes to the service.","mail.category.recall.label":"Recalls","mail.category.recall.description":"A dataset, release or credential NEMAR distributed has a problem you need to act on.","mail.recall.why":"Recalls cannot be turned off: they tell you to stop using, delete or replace something NEMAR distributed or issued, because continuing to use it can cause harm.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function j6(e){return typeof e==="string"&&n9.includes(e)}function q6(e){return typeof e==="string"&&zE.includes(e)}function D6(e){return Bo[`mail.category.${e}.label`]}function M6(e){return Bo[`mail.category.${e}.description`]}function L6(){return Bo["mail.recall.why"]}function o9(e){return e.replace(/\r\n?/g,`
33
- `).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function i9(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function U6(e){let t=new Set(o9(e).map((r)=>i9(r)?.text.trim().toLowerCase()).filter((r)=>Boolean(r)));return s9.filter((r)=>!t.has(r.toLowerCase()))}function F6(e){let t=e.trim(),r=a9.exec(t);if(r)return{kind:"dataset",datasetId:r[1],version:r[2]??null,text:t};if(c9.test(t))return{kind:"github",url:t,text:t};return null}var zE,n9,C6="recall",GE,s9,a9,c9,V6="A recall needs a reference: a dataset id with an optional version (nm000104 or nm000104@v1.2.0), or a nemarOrg or nemarDatasets issue, pull request or security advisory URL.";var KE=F(()=>{VE();zE=["news","rfcs","maintenance"],n9=[...zE,"recall"];GE=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];s9=["What is affected","What to do"];a9=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,c9=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function W6(e){return typeof e==="string"&&l9.includes(e)}var u9,K6,H6,B6,l9,d9="ci_check_unavailable",HE,BE,WE,Y6="X-Approval-Dispatch-Token",X6,J6="Search reflects this at once; the public dataset page and catalog list are cached at the edge and can keep showing the dataset for several minutes.";var YE=F(()=>{jn();u9=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,K6=v().regex(u9,"ORCID must be in format 0000-0000-0000-000X"),H6=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"]),l9=["bids_validation_pending","bids_validation_in_progress"];HE=[d9],BE=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],WE=["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 JE(e){if(XE)return;XE=!0;let t=Pt.yellow("\u2500".repeat(60)),r=Pt.yellow.bold("[MAINTENANCE]"),n=Pt.dim(`mode: ${e.mode}`),s=e.eta?`
32
+ [nemar] You can manually copy ${n} to ${t}`)}}function St(){let e=Jl();if(Ko&&PE===e)return Ko;if(VV(e),Ko=new Bi({projectName:"nemar",configFileMode:Zl,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}),PE=e,!IE.has(e))IE.add(e),zV(Ko.path),KV(),HV();return Ko}function zV(e){if(process.platform==="win32")return;if(!Ql(e))return;try{if((MV(e).mode&511)!==Zl)jV(e,Zl)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function KV(){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 a of GV){let i=e.get(a);if(i!==void 0)o[a]=i}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function HV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,a]of Object.entries(r)){let i=a?.apiUrl;if(!i)continue;if(LV.has(UV(i)))r[o]={...a,apiUrl:Vs},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${i} -> ${Vs}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...a}=t;try{e.store=a,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(i){console.error("API URL cleanup failed (config file unchanged):",i)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ho(){return St().get("activeAccount")}function bn(){return St().get("accounts")||{}}function vn(){let e={apiUrl:Vs},t=Ho();if(!t)return e;return bn()[t]||e}function WB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Vs};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function YB(e){let t=Ho();if(!t)return;let r=bn();if(r[t])delete r[t][e],St().set("accounts",r)}function XB(){let e=St(),t=Ho();if(!t){e.clear();return}let r=bn();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 JB(){St().clear()}function QB(){return!!vn().apiKey}function ZB(){return St().path}function e6(){let e=bn(),t=Ho();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 t6(e){return e.username?.trim()||e.email}function BV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(bn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){mr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function r6(e,t){let r=St(),n=bn(),s;if(n[e])s=e;else if(t.email)s=BV(t.email);let o=s?n[s]:void 0,a={...o??{apiUrl:Vs},...t};if(s&&s!==e)delete n[s];return n[e]=a,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function n6(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ho();if(!n||n===t)return"unchanged";let s=bn(),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 s6(e){let t=St(),r=bn();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 Vs="https://api.nemar.org",Zl=384,LV,FV,BB,Ko=null,PE=null,IE,GV;var mc=L(()=>{V$();_n();oc();Xl();LV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);FV=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),BB=Z({apiKey:_().optional(),apiUrl:_().url().default(Vs),username:_().optional(),email:_().email().optional(),githubUsername:_().optional(),sandboxCompleted:Ce().optional(),sandboxDatasetId:_().optional(),dismissedNoticeIds:Ye(ne()).optional(),serviceAccess:Ce().optional(),profileGaps:Ye(FV).optional(),orcidVerified:Ce().optional(),role:_().optional(),accountKind:Mn.optional(),pendingEmailChange:_().email().optional()});IE=new Set;GV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var WV,YV,c6,XV,u6,JV,CE,l6,d6=8,f6=100,jE,p6,QV,m6;var qE=L(()=>{_n();oc();WV=["given_name","family_name","affiliation","city","country"],YV=["username","github_username","email","orcid"],c6=[...WV,...YV],XV={given_name:_().max(200).optional(),family_name:_().max(200).optional(),affiliation:_().max(500).optional(),city:_().max(200).optional(),country:_().max(200).optional(),username:_().max(100).optional(),github_username:_().max(100).optional(),email:_().max(320).optional(),orcid:_().max(40).optional()},u6=Z(XV),JV=Fe(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),CE=JV.options,l6=["exact","name","prefix","substring","fuzzy"],jE=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Mn.optional(),email_verified:ne().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:ne().int().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),description:_().nullable().optional(),signup_source:_().nullable().optional(),created_at:_(),updated_at:_().nullable().optional(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),deleted_at:_().nullable().optional(),service_access:ne().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:ne().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional(),identity_conflict:ne().int().nullable().optional(),username_auto_assigned:ne().int().nullable().optional(),sandbox_completed:ne().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:ne().int().optional(),active_tokens:ne().int().optional(),linked_identities:Ye(_()).optional()}).passthrough(),p6=Z({user:jE}).passthrough(),QV=Z({from:_().nullable(),to:_().nullable()}),m6=Z({message:_(),changed:OF(_(),QV),notes:Ye(_()).optional(),old_address_notified:Ce().optional(),user:jE}).passthrough()});function _6(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<32&&r!==9&&r!==10||r===127)return!0}return!1}var y6=20,ZV=1000,v6,e9,DE,b6,w6=500,$6=200,ME,E6,t9,S6;var LE=L(()=>{_n();v6=Z({purpose:_().max(ZV*4).optional().default(""),accept_terms_version:_().max(64).optional().default("")}),e9=Fe(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),DE=e9.options,b6=Z({ok:gn(!0),already_requested:Ce(),requested_at:_().nullable().optional(),email_sent:Ce().optional(),admins_notified:ne().int().nullable().optional()}).passthrough(),ME=Z({id:ne().int(),username:_().nullable(),email:_(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),orcid:_().nullable().optional(),account_kind:_().optional(),compute_access:_(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_purpose:_().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional()}).passthrough(),E6=Z({accounts:Ye(ME),next_after:ne().int().nullable().optional()}).passthrough(),t9=Z({granted:Ce(),cpu_milli:ne().int(),gpu_milli:ne().int(),reason:_().nullable().optional(),policy_version:ne().int().nullable().optional()}).passthrough(),S6=Z({decision:_(),from:_(),to:_(),account:ME,allocation:t9.optional(),email_sent:Ce().optional()}).passthrough()});var k6=120,T6=64,A6="unnamed machine",r9=25,UE,O6,zs,FE,N6,P6,I6,n9,s9,C6,ed,j6,q6,D6,M6,L6;var VE=L(()=>{_n();UE=Fe(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),O6={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."},zs=Fe(["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"]),FE=zs.options,N6={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 ${r9} 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."},P6=Z({error:zs,message:_()}).passthrough(),I6=Z({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:ne().int(),interval:ne().int()}).passthrough(),n9=X$("error",[Z({error:gn("authorization_pending"),message:_()}).passthrough(),Z({error:gn("slow_down"),message:_()}).passthrough()]),s9=X$("error",[Z({error:gn("expired_token"),reason:zs,message:_()}).passthrough(),Z({error:gn("access_denied"),reason:zs,message:_()}).passthrough(),Z({error:gn("invalid_grant"),reason:zs,message:_()}).passthrough()]),C6=AF([n9,s9]),ed=Z({id:ne().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:Ce()}).passthrough(),j6=Z({api_key:_(),key:ed,user:Z({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:Ce(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),q6=Z({user_code:_(),machine_name:_(),requested_at:_(),expires_in:ne().int(),account:Z({username:_().nullable(),email_masked:_()}).passthrough(),refusal:Z({code:zs,message:_()}).passthrough().nullable()}).passthrough(),D6=Z({ok:gn(!0),machine_name:_()}).passthrough(),M6=Z({keys:Ye(ed)}).passthrough(),L6=Z({api_key:_(),key:ed}).passthrough()});var o9,zE,Bo="https://nemar.org/settings",V6,a9,i9,c9,z6,G6;var GE=L(()=>{_n();o9=Fe(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),zE=o9.options,V6={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, ${Bo}).`,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, ${Bo}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Bo}), 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, ${Bo}).`,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, ${Bo}).`,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."},a9=Fe(["orcid","email","github"]),i9=Z({id:ne().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:Ce(),dataset_count:ne().int(),identity_conflict:ne().int(),canonical:Ce()}).passthrough(),c9=Z({kind:a9,value:_(),canonical_user_id:ne().int(),accounts:Ye(i9)}).passthrough(),z6=Z({groups:Ye(c9),group_count:ne().int(),flagged_count:ne().int()}).passthrough(),G6=Z({ok:gn(!0),id:ne().int(),cleared:Ce()}).passthrough()});function H6(e){return Wo[e]}function B6(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Wo;var KE=L(()=>{Wo={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","compute_access.section.title":"Compute access","compute_access.section.lede":"A separate grant from upload access. An admin reviews each request against export-control and local-jurisdiction rules and the purpose you state, and a grant lets you use compute within the limits an administrator sets.","compute_access.state.none":"Not requested","compute_access.state.requested":"Requested","compute_access.state.active":"Active","compute_access.state.suspended":"Suspended","compute_access.state.denied":"Not granted","compute_access.state.revoked":"Ended","compute_access.request.cta":"Request compute access","compute_access.request.form_body":"Tell us what you plan to compute. An admin reviews this alongside your name, affiliation and location, then answers once. You also accept the compute terms.","compute_access.request.purpose_label":"What do you intend to compute?","compute_access.request.purpose_hint":"Describe what you intend to compute in 20-1000 characters","compute_access.request.terms_label":"I accept the compute terms","compute_access.requested.title":"Your compute request is with an admin","compute_access.requested.lede":"An admin is reviewing your request.","compute_access.requested.lede_dated":"An admin is reviewing your request from {date}.","compute_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","compute_access.granted.body":"Compute access is active. Your balances are on your compute page, and you submit jobs with the `nemar compute` command line.","compute_access.granted.link":"Open your compute page","compute_access.closed.body":"This request has been answered and cannot be asked again. If you think that is a mistake, contact support and an admin will take another look.","compute_access.suspended.body":"Your compute access is paused. Contact support to find out why or to ask for it to be lifted.","compute_access.terms_unpublished.body":"Compute access is not open yet: the compute terms are not published. Please check back later.","compute_access.docs_link":"How compute access works","compute_page.frozen.body":"Your pools are frozen, so new jobs are refused. Contact support to find out why.","compute_page.units_note":"Amounts are service units (SU).","compute_page.available_note":"Available is granted minus held minus charged and can be negative after an overrun.","compute_page.queue_note":"It describes the queue of the whole platform, not yours, and it is a recent average, not a promise.","compute_page.usage_note":"Net charge by UTC day of the charge, not the day a job was created. A day with no charge has no bar.","compute_page.unreported_note":"NEMAR has not heard from the cluster about this job for a while. It may still finish.","compute_admin.page.title":"Compute","compute_admin.page.lede":"Compute access requests, and a read-only view of pools, usage, flagged jobs and reconciliation. A grant opens an allocation the person can spend, so each request is decided by a person, one at a time.","compute_admin.page.cli_note":"Owner policy, legal holds, record reads, moving a charge, pool grants and adjustments, and canceling a job are done with the nemar admin compute command in the command line, not here.","compute_admin.page.order_note":"Accounts are listed in the order they were created, not the order they asked in.","compute_admin.view.nav":"Compute views","compute_admin.view.requests":"Requests","compute_admin.view.pools":"Pools","compute_admin.view.usage":"Usage","compute_admin.view.flagged":"Flagged jobs","compute_admin.view.drift":"Reconciliation","compute_admin.state.nav":"Filter requests by state","compute_admin.state.requested":"Requested","compute_admin.state.active":"Active","compute_admin.state.suspended":"Suspended","compute_admin.state.denied":"Denied","compute_admin.state.revoked":"Revoked","compute_admin.state.all":"All","compute_admin.requests.none":"No accounts in this view.","compute_admin.pager.next":"Next page","compute_admin.pager.first":"First page","compute_admin.row.not_set":"not set","compute_admin.row.no_username":"no username","compute_admin.row.account_kind":"{kind} account","compute_admin.row.stated_country":"Stated country","compute_admin.row.stated_country_hint":"Check this against the export-control rules before granting. This page does not rule on it.","compute_admin.row.city":"City","compute_admin.row.affiliation":"Affiliation","compute_admin.row.email":"Email","compute_admin.row.orcid":"ORCID iD","compute_admin.row.requested":"Requested","compute_admin.row.terms":"Terms accepted","compute_admin.row.terms_value":"{version}, {date}","compute_admin.row.purpose":"Stated purpose","compute_admin.row.show_full_purpose":"Show full purpose","compute_admin.row.granted":"Granted {date} by account #{id}","compute_admin.row.not_notified":"No administrator has been emailed about this request yet.","compute_admin.row.open_in_users":"Open in Users","compute_admin.action.grant":"Grant","compute_admin.action.grant_again":"Grant again","compute_admin.action.lift_suspension":"Lift suspension","compute_admin.action.deny":"Deny","compute_admin.action.suspend":"Suspend","compute_admin.action.revoke":"Revoke","compute_admin.self_grant.disabled":"You cannot grant your own compute access. Ask another administrator or an owner.","compute_admin.dialog.title.grant":"Grant compute access?","compute_admin.dialog.title.deny":"Deny this request?","compute_admin.dialog.title.suspend":"Suspend compute access?","compute_admin.dialog.title.revoke":"Revoke compute access?","compute_admin.dialog.consequence.grant":"Opens the owner\u2019s default allocation once for this account (a repeat grant adds nothing), unfreezes the account\u2019s pools, and allows the person to use compute when it is available. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.deny":"Closes this request. The person cannot ask again; only an administrator can grant later. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.suspend":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. A grant lifts the suspension. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.revoke":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. Only a new grant restores access. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.reason_label":"Reason (optional)","compute_admin.dialog.reason_hint":"Recorded in the audit log. The person is not sent it.","compute_admin.dialog.reason_count":"{count} of {max}","compute_admin.dialog.ack_export_review":"Confirm that you have reviewed this person\u2019s name, affiliation and stated country against the export-control rules","compute_admin.dialog.type_word":"Type {word} to confirm","compute_admin.dialog.cancel":"Cancel","compute_admin.result.working":"Working","compute_admin.result.granted":"Granted.","compute_admin.result.granted_opened":"Granted. Opened {cpu} CPU SU and {gpu} GPU SU.","compute_admin.result.granted_zero_default":"Granted. The owner\u2019s default allocation is zero, so nothing was opened.","compute_admin.result.granted_already":"Granted. An earlier grant already opened the default allocation, so nothing more was opened.","compute_admin.result.granted_other":"Granted. The allocation answered: {reason}.","compute_admin.result.denied":"Denied.","compute_admin.result.suspended":"Suspended. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.revoked":"Revoked. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.email_not_sent":"The decision stands, but the person could not be emailed. Tell them.","compute_admin.result.state_changed":"Someone else may have decided this first. The row shows the current state.","compute_admin.result.unconfirmed":"The result is not confirmed. The row shows what the server says now.","compute_admin.result.check_email":"The decision is in place, but the answer was lost, so check that the person was emailed and tell them if not.","compute_admin.result.stale":"This account was not found. Reload the page.","compute_admin.result.reread_failed":"The current state could not be read. Reload the page before deciding again.","compute_admin.result.signed_out":"You are signed out. Sign in again, then retry.","compute_admin.error.malformed":"The server sent an answer this page could not read.","compute_admin.error.unreachable":"The server could not be reached. Check your connection and try again.","compute_admin.error.redirect":"The server answered in a way this page cannot follow. Try again later.","compute_admin.error.origin":"This page was not accepted as the source of the request. Reload and try again.","compute_admin.error.rate_limited":"Too many requests. Wait a moment, then try again.","compute_admin.error.timeout":"The server did not answer in time. Try again.","compute_admin.error.failed":"The request failed ({status}). Try again.","compute_admin.error.generic":"Something went wrong. Try again.","compute_admin.error.bad_id":"That is not an account id.","compute_admin.error.bad_decision":"That is not a decision.","compute_admin.error.reason_too_long":"A reason is at most {max} characters.","compute_admin.error.bad_quarter":"A quarter is written like 2026Q4.","compute_admin.section.failed":"Could not load {what}: {reason}","compute_admin.col.holder":"Holder","compute_admin.col.pool":"Pool","compute_admin.col.granted":"Granted (SU)","compute_admin.col.held":"Held (SU)","compute_admin.col.charged":"Charged (SU)","compute_admin.col.available":"Available (SU)","compute_admin.col.frozen":"Frozen","compute_admin.col.updated":"Updated","compute_admin.col.partition":"Partition","compute_admin.col.source":"Front door","compute_admin.col.users":"Distinct people","compute_admin.col.jobs":"Jobs","compute_admin.col.job":"Job","compute_admin.col.account":"Account","compute_admin.col.state":"State","compute_admin.col.flags":"Flags","compute_admin.col.failure":"Failure","compute_admin.col.created":"Created","compute_admin.col.ended":"Ended","compute_admin.col.slurm":"Scheduler job","compute_admin.col.elapsed":"Elapsed (s)","compute_admin.col.resources":"Nodes, CPUs, GPUs","compute_admin.col.ingested":"Ingested","compute_admin.ref.account":"account #{id}","compute_admin.ref.no_account":"no account","compute_admin.pools.platform":"Platform budgets","compute_admin.pools.partner":"Partner pools","compute_admin.pools.account":"Account pools","compute_admin.pools.none_platform":"No platform budgets are recorded.","compute_admin.pools.none":"No pools are recorded in this group.","compute_admin.pools.truncated":"Showing the first {shown} pools of this group; more exist.","compute_admin.pools.frozen":"Frozen","compute_admin.pools.open":"Open","compute_admin.usage.quarter":"Quarter","compute_admin.usage.counts_note":"These are counts of people and jobs, not service units. A person is counted once however many jobs they ran, and jobs that skipped the reservation or could not be attributed are left out.","compute_admin.usage.totals":"Total","compute_admin.usage.none":"No jobs were recorded in this quarter.","compute_admin.flag.nav":"Filter jobs by flag","compute_admin.flag.unreserved":"Unreserved","compute_admin.flag.unattributed":"Unattributed","compute_admin.flag.mismatch":"Mismatch","compute_admin.flag.overrun":"Overrun","compute_admin.flag.meaning.unreserved":"The job skipped the reservation. Its charge went to a partner pool and not to a person.","compute_admin.flag.meaning.unattributed":"The job skipped the reservation and its owner maps to no active account.","compute_admin.flag.meaning.mismatch":"NEMAR\u2019s record and the scheduler\u2019s accounting disagree for this job, or a partner\u2019s report for it was refused or could not be checked, or a partner job used more than its hold and was capped.","compute_admin.flag.meaning.overrun":"The job used more than its hold, and the excess is recorded as an overrun in the ledger.","compute_admin.flag.followup":"Moving the charge of an unreserved job to a person is an owner action in the command line.","compute_admin.flagged.none":"No jobs carry this flag. That is a fact about this read only.","compute_admin.flagged.platform_failure":"NEMAR\u2019s fault","compute_admin.flagged.partner":"Partner: {state}, {flag}","compute_admin.drift.paused":"Reconciliation is paused while compute is off. An empty list below does not mean nothing is unmatched.","compute_admin.drift.pause_unknown":"Whether reconciliation is running is not known, so an empty list does not mean nothing is unmatched.","compute_admin.drift.status":"Status","compute_admin.drift.compute_on":"Compute is on.","compute_admin.drift.compute_off":"Compute is off.","compute_admin.drift.tapis":"Scheduler gateway: token {token}, health {health}.","compute_admin.drift.attention":"Needs a person to look","compute_admin.drift.attention_none":"No attention count is positive.","compute_admin.drift.unmatched":"Accounting rows no job claims","compute_admin.drift.unmatched_shown":"Showing the newest {shown} of {total}.","compute_admin.drift.unmatched_none":"No accounting rows are waiting for a job.","compute_admin.drift.not_priced":"not priced","compute_admin.drift.mismatch":"Jobs flagged mismatch","compute_admin.drift.mismatch_more":"See the Flagged jobs view for the rest","compute_admin.unavailable.title":"Not available yet","compute_admin.unavailable.usage_by_day":"Service units charged by day, partition and front door across the platform are not served by any admin read yet.","compute_admin.unavailable.drift_difference":"The difference between NEMAR\u2019s ledger and the supercomputer\u2019s accounting, per job or per day, and the tolerance it is measured against are not served by any admin read yet. No row is marked over tolerance because this page has no tolerance to apply.","compute_admin.unavailable.link":"Tracking issue","compute_admin.badge.awaiting_decision":"awaiting decision","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.compute_access":"to request compute access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.compute_access":"compute access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.affiliation.label":"Affiliation","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.affiliation.set_on.web":"Settings","gap.field.affiliation.set_on.cli":"nemar auth profile set-affiliation","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","mail.category.news.label":"News","mail.category.news.description":"New features, data and events.","mail.category.rfcs.label":"Requests for comments","mail.category.rfcs.description":"A new NEMAR request for comments is open for discussion.","mail.category.maintenance.label":"Maintenance","mail.category.maintenance.description":"Planned downtime and changes to the service.","mail.category.recall.label":"Recalls","mail.category.recall.description":"A dataset, release or credential NEMAR distributed has a problem you need to act on.","mail.recall.why":"Recalls cannot be turned off: they tell you to stop using, delete or replace something NEMAR distributed or issued, because continuing to use it can cause harm.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.compute_access.cta":"Ask for it with `nemar compute request-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function J6(e){return typeof e==="string"&&u9.includes(e)}function Q6(e){return typeof e==="string"&&HE.includes(e)}function Z6(e){return Wo[`mail.category.${e}.label`]}function eW(e){return Wo[`mail.category.${e}.description`]}function tW(){return Wo["mail.recall.why"]}function d9(e){return e.replace(/\r\n?/g,`
33
+ `).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function f9(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function rW(e){let t=new Set(d9(e).map((r)=>f9(r)?.text.trim().toLowerCase()).filter((r)=>Boolean(r)));return l9.filter((r)=>!t.has(r.toLowerCase()))}function nW(e){let t=e.trim(),r=p9.exec(t);if(r)return{kind:"dataset",datasetId:r[1],version:r[2]??null,text:t};if(m9.test(t))return{kind:"github",url:t,text:t};return null}var HE,u9,X6="recall",BE,l9,p9,m9,sW="A recall needs a reference: a dataset id with an optional version (nm000104 or nm000104@v1.2.0), or a nemarOrg or nemarDatasets issue, pull request or security advisory URL.";var WE=L(()=>{KE();HE=["news","rfcs","maintenance"],u9=[...HE,"recall"];BE=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];l9=["What is affected","What to do"];p9=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,m9=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function lW(e){return typeof e==="string"&&g9.includes(e)}var h9,iW,cW,uW,g9,y9="ci_check_unavailable",YE,XE,JE,dW="X-Approval-Dispatch-Token",fW,pW="Search reflects this at once; the public dataset page and catalog list are cached at the edge and can keep showing the dataset for several minutes.";var QE=L(()=>{_n();h9=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,iW=_().regex(h9,"ORCID must be in format 0000-0000-0000-000X"),cW=Fe(["found","no_public_name","lookup_failed"]),uW=Fe(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),g9=["bids_validation_pending","bids_validation_in_progress"];YE=[y9],XE=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],JE=["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"],fW=Fe(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function eS(e){if(ZE)return;ZE=!0;let t=Pt.yellow("\u2500".repeat(60)),r=Pt.yellow.bold("[MAINTENANCE]"),n=Pt.dim(`mode: ${e.mode}`),s=e.eta?`
34
34
  ${Pt.dim(`eta: ${e.eta}`)}`:"";process.stderr.write(`${t}
35
35
  ${r} ${e.message}
36
36
  ${n}${s}
37
37
  ${t}
38
- `)}var XE=!1;var QE=F(()=>{Fl()});function ZE(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(rd)return td;return mn().apiUrl||td}async function fW(e,t={},r=!1,n){let s=`${ZE()}${e}`,o={"Content-Type":"application/json","X-CLI-Version":cc,...t.headers};if(r){let p=mn();if(!p.apiKey&&r===!0)throw new hr(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(dc())fc({method:i,url:s,status:null,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new hr(0,`Network error: Could not connect to ${ZE()}`,{originalError:p instanceof Error?p.message:String(p)})}let d;try{d=await u.text()}catch(p){if(dc())fc({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 hr(0,"Failed to read response body",{httpStatus:u.status,originalError:p instanceof Error?p.message:String(p)})}if(dc())fc({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 hr(u.status,`Invalid response from server (status ${u.status})`)}if(!u.ok){if(u.status===503&&(l.mode==="read-only"||l.mode==="full")){let Rt=typeof l.message==="string"?l.message:"NEMAR is in maintenance mode. Please retry shortly.",lt=typeof l.eta==="string"?l.eta:null,jt=new Cl(l.mode,Rt,lt,l.details);throw JE(jt),jt}let p=typeof l.block_reason==="string",f=Array.isArray(l.missing)?l.missing.filter((Rt)=>typeof Rt==="string"):void 0,h=typeof l.error==="string"&&(tE.includes(l.error)||UE.includes(l.error)),m=typeof l.error==="string"&&(DE.options.includes(l.error)||ME.includes(l.error)),y=typeof l.error==="string"&&Qw.includes(l.error),_=typeof l.error==="string"&&CE.includes(l.error),O=typeof l.error==="string"&&BE.includes(l.error),k=typeof l.error==="string"&&HE.includes(l.error),M=typeof l.error==="string"&&WE.includes(l.error),S=typeof l.error==="string"&&GE.includes(l.error),Se=p||S||k||M||h||m||y||_||O||f!==void 0&&typeof l.error==="string"&&eE.includes(l.error)?l.message||l.error:l.error||l.message;if(u.status===404&&l.error==="Not Found"&&typeof l.message==="string")Se=`${l.message}. This NEMAR backend does not support this command yet.`;let pt=new hr(u.status,Se||"Request failed",l.details,typeof l.step==="string"?l.step:void 0,p?l.block_reason:void 0,f);if(typeof l.error==="string")pt.code=l.error;if(typeof l.reason==="string")pt.reason=l.reason;throw pt.rawBody=l,pt}if(n){let p=n.safeParse(l);if(!p.success)throw new hr(u.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return l}var td="https://api.nemar.org",rd;var eS=F(()=>{qE();LE();FE();KE();YE();sc();pc();Xl();QE();Kl();jl();rd=td.includes("workers.dev")});pc();import{open as v9,rm as $9}from"fs/promises";eS();var tS="NEMAR_DATA_HOSTS",f9="NEMAR_DATA_HOSTS_ONLY",p9="https://private.nemar.org",h9="https://private-test.nemar.org",m9=/^[a-z]{2,3}[0-9]{6}$/;function rS(e){return m9.test(e)}function g9(e){return e}function nS(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function sS(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:"&&nS(r.hostname))return r.origin;return null}function oS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=sS(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function iS(e){return e.env??process.env}function y9(e={}){let t=iS(e),r=e.isDevBuild??rd,n=t[f9]==="1"?[]:[r?h9:p9],{origins:s}=oS(t[tS]);return[...n,...s.filter((o)=>!n.includes(o))].map(g9)}function mW(e={}){return oS(iS(e)[tS]).rejected}function mc(e,t={}){let r=sS(e);if(r===null)return null;return y9(t).find((n)=>n===r)??null}function aS(e,t={}){return mc(e,t)!==null}function gW(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return mc(r.origin,t)}function cS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&nS(e.hostname)&&new URL(t).protocol==="http:"}var _9="NEMAR_DATA_HOST_TIMEOUT_MS";function nd(e,t=process.env){let r=t[_9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function sd(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 uS=3,dS=60000,b9=262144,fS=255,pS=/^[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 hS(e){return e.length<=fS&&pS.test(e)}function w9(e){if(e.length>fS)return null;let t=pS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function E9(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(!rS(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=mc(e,r);if(n===null)return{ok:!1,message:`The host setting ${Ct(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 Ct(e,t=200){let r=e.replace(/[^\x20-\x7e]/g,"?");return r.length>t?`${r.slice(0,t)}...`:r}function S9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function mS(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 gS(e,t,r,n,s,o){if(!aS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let i=S9(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 (${sd(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>=uS)return{kind:"failed",message:`More than ${uS} 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(!cS(p,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};i=p,a=!0}}async function yS(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 x9(e,t,r,n,s){if(!hS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=w9(t);return yS(nd(dS,e.options?.env),async(i,a)=>{let c=await gS(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:mS(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 ${Ct(l,20)} bytes but its key says ${o}.`};a();let p,f=0,h=0;try{p=await v9(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 gc(`More bytes arrived than the key's ${o}.`);if(await p.write(_),f-h>=b9)h=f,s(f)}if(await p.close(),p=void 0,o!==null&&f!==o)throw new gc(`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 $9(n,{force:!0}).catch(()=>{}),m instanceof gc)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 (${sd(m)}).`}}})}class gc extends Error{constructor(e){super(e);this.name="SizeError"}}async function R9(e,t,r){if(!hS(t))return{state:"unknown",message:"The key is not one a data host serves."};return yS(nd(dS,e.options?.env),async(n)=>{let s=await gS(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:mS(o,!1)}})}class yc extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function _S(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 yc("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 yc(p);n.push(p)}},c=async()=>{let d=await a("host"),l=await a("dataset");return E9(d,l,t.options)},u=async(d,l)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${Ct(d)} The remote has not been prepared.`);return}let p=Promise.resolve(),f=await x9(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 ${Ct(d)} ${Ct(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]=lS(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 ${Ct(h.message)}`);break}case"PREPARE":{let h=await c();if(!h.ok){s=null,await e.send(`PREPARE-FAILURE ${Ct(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]=lS(f,2);if(h==="STORE")await e.send(`TRANSFER-FAILURE STORE ${Ct(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 ${Ct(f)} The remote has not been prepared.`);break}let h=await R9(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 ${Ct(f)} ${h.message}`);break}case"REMOVE":await e.send(`REMOVE-FAILURE ${Ct(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 yc)return 1;throw h}}}function lS(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*k9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
38
+ `)}var ZE=!1;var tS=L(()=>{Fl()});function rS(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(rd)return td;return vn().apiUrl||td}async function AW(e,t={},r=!1,n,s="json",o){let a=`${rS()}${e}`,i={"Content-Type":"application/json","X-CLI-Version":uc,...t.headers};if(r){let p=vn();if(!p.apiKey&&r===!0)throw new pr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)i.Authorization=`Bearer ${p.apiKey}`}let c=t.method||"GET",u=typeof t.body==="string"?t.body:void 0,l=Date.now(),d;try{let p=[...t.signal?[t.signal]:[],...o===void 0?[]:[AbortSignal.timeout(o)]];d=await fetch(a,{...t,headers:i,...p.length===0?{}:{signal:p.length===1?p[0]:AbortSignal.any(p)}})}catch(p){if(fc())pc({method:c,url:a,status:null,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,`Network error: Could not connect to ${rS()}`,{originalError:p instanceof Error?p.message:String(p)})}let m;try{m=await d.text()}catch(p){if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,"Failed to read response body",{httpStatus:d.status,originalError:p instanceof Error?p.message:String(p)})}if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,responseBody:m});if(s==="text"&&d.ok)return{text:m,headers:d.headers};let f;try{f=JSON.parse(m)}catch{throw new pr(d.status,`Invalid response from server (status ${d.status})`)}if(!d.ok){if(d.status===503&&(f.mode==="read-only"||f.mode==="full")){let hr=typeof f.message==="string"?f.message:"NEMAR is in maintenance mode. Please retry shortly.",wn=typeof f.eta==="string"?f.eta:null,Ln=new Cl(f.mode,hr,wn,f.details);throw eS(Ln),Ln}let p=typeof f.block_reason==="string",h=Array.isArray(f.missing)?f.missing.filter((hr)=>typeof hr==="string"):void 0,y=typeof f.error==="string"&&(tE.includes(f.error)||zE.includes(f.error)),v=typeof f.error==="string"&&(UE.options.includes(f.error)||FE.includes(f.error)),A=typeof f.error==="string"&&Q$.includes(f.error),k=typeof f.error==="string"&&CE.includes(f.error),M=typeof f.error==="string"&&XE.includes(f.error),S=typeof f.error==="string"&&YE.includes(f.error),$e=typeof f.error==="string"&&JE.includes(f.error),je=typeof f.error==="string"&&BE.includes(f.error),Ct=p||je||S||$e||y||v||A||k||M||h!==void 0&&typeof f.error==="string"&&eE.includes(f.error)||h!==void 0&&typeof f.error==="string"&&DE.includes(f.error)?f.message||f.error:f.error||f.message;if(d.status===404&&f.error==="Not Found"&&typeof f.message==="string")Ct=`${f.message}. This NEMAR backend does not support this command yet.`;let Ve=new pr(d.status,Ct||"Request failed",f.details,typeof f.step==="string"?f.step:void 0,p?f.block_reason:void 0,h);if(typeof f.error==="string")Ve.code=f.error;if(typeof f.reason==="string")Ve.reason=f.reason;Ve.rawBody=f;let xt=Number(d.headers.get("retry-after"));if(d.headers.get("retry-after")!==null&&Number.isFinite(xt)&&xt>=0)Ve.retryAfterSeconds=xt;throw Ve}if(n){let p=n.safeParse(f);if(!p.success)throw new pr(d.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return f}var td="https://api.nemar.org",rd;var nS=L(()=>{qE();LE();VE();GE();WE();QE();oc();mc();Xl();tS();Kl();jl();rd=td.includes("workers.dev")});mc();import{open as x9,rm as R9}from"fs/promises";nS();var sS="NEMAR_DATA_HOSTS",_9="NEMAR_DATA_HOSTS_ONLY",v9="https://private.nemar.org",b9="https://private-test.nemar.org",w9=/^[a-z]{2,3}[0-9]{6}$/;function oS(e){return w9.test(e)}function $9(e){return e}function aS(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function iS(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:"&&aS(r.hostname))return r.origin;return null}function cS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=iS(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function uS(e){return e.env??process.env}function E9(e={}){let t=uS(e),r=e.isDevBuild??rd,n=t[_9]==="1"?[]:[r?b9:v9],{origins:s}=cS(t[sS]);return[...n,...s.filter((o)=>!n.includes(o))].map($9)}function PW(e={}){return cS(uS(e)[sS]).rejected}function gc(e,t={}){let r=iS(e);if(r===null)return null;return E9(t).find((n)=>n===r)??null}function lS(e,t={}){return gc(e,t)!==null}function IW(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return gc(r.origin,t)}function dS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&aS(e.hostname)&&new URL(t).protocol==="http:"}var S9="NEMAR_DATA_HOST_TIMEOUT_MS";function nd(e,t=process.env){let r=t[S9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function sd(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 fS=3,mS=60000,k9=262144,hS=255,gS=/^[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 yS(e){return e.length<=hS&&gS.test(e)}function T9(e){if(e.length>hS)return null;let t=gS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function A9(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(!oS(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=gc(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 O9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function _S(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 vS(e,t,r,n,s,o){if(!lS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let a=O9(e,t),i=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(a.origin===e.origin)u.Authorization=`Bearer ${r}`;let l;try{l=await fetch(a,{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 (${sd(f)}).`}}if(l.status<300||l.status>=400)return{kind:"response",response:l,redirected:i};if(await l.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:l,redirected:i};if(c>=fS)return{kind:"failed",message:`More than ${fS} redirects.`};let d=l.headers.get("location");if(!d)return{kind:"failed",message:"A redirect named no address."};let m;try{m=new URL(d,a)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!dS(m,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};a=m,i=!0}}async function bS(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 N9(e,t,r,n,s){if(!yS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=T9(t);return bS(nd(mS,e.options?.env),async(a,i)=>{let c=await vS(e,t,r,"GET",!0,a);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:l}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:_S(u.status,l)};let d=u.headers.get("content-length");if(o!==null&&d!==null&&Number(d)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${It(d,20)} bytes but its key says ${o}.`};i();let m,f=0,p=0;try{m=await x9(n,"w");let h=u.body.getReader();while(!0){let{done:y,value:v}=await h.read();if(y)break;if(i(),f+=v.byteLength,o!==null&&f>o)throw await h.cancel().catch(()=>{}),new yc(`More bytes arrived than the key's ${o}.`);if(await m.write(v),f-p>=k9)p=f,s(f)}if(await m.close(),m=void 0,o!==null&&f!==o)throw new yc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==p)s(f);return{ok:!0,bytes:f}}catch(h){if(await m?.close().catch(()=>{}),await R9(n,{force:!0}).catch(()=>{}),h instanceof yc)return{ok:!1,message:h.message};if(a.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${sd(h)}).`}}})}class yc extends Error{constructor(e){super(e);this.name="SizeError"}}async function P9(e,t,r){if(!yS(t))return{state:"unknown",message:"The key is not one a data host serves."};return bS(nd(mS,e.options?.env),async(n)=>{let s=await vS(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:_S(o,!1)}})}class _c extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function wS(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,a=async()=>{let l=n.shift();if(l!==void 0)return l;let d=await r.next();return d.done?null:d.value},i=async(l)=>{await e.send(`GETCONFIG ${l}`);while(!0){let d=await r.next();if(d.done)throw new _c("git-annex closed the connection");let m=d.value;if(m==="VALUE"||m.startsWith("VALUE ")){let f=m.slice(5).trimStart();return f===""?void 0:f}if(m.startsWith("ERROR"))throw new _c(m);n.push(m)}},c=async()=>{let l=await i("host"),d=await i("dataset");return A9(l,d,t.options)},u=async(l,d)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${It(l)} The remote has not been prepared.`);return}let m=Promise.resolve(),f=await N9(s,l,o,d,(p)=>{m=m.then(()=>e.send(`PROGRESS ${p}`))});if(await m,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${l}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${It(l)} ${It(f.message)}`)};await e.send("VERSION 1");while(!0){let l=await a();if(l===null)return 0;if(l.trim()==="")continue;let[d,...m]=pS(l,1),f=m[0]??"";try{switch(d){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let p=await c();await e.send(p.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${It(p.message)}`);break}case"PREPARE":{let p=await c();if(!p.ok){s=null,await e.send(`PREPARE-FAILURE ${It(p.message)}`);break}let h=t.loadApiKey();if(!h){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=p.settings,o=h,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[p,h,...y]=pS(f,2);if(p==="STORE")await e.send(`TRANSFER-FAILURE STORE ${It(h??"")} This remote is read-only for now.`);else if(p==="RETRIEVE"&&h&&y[0])await u(h,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 p=await P9(s,f,o);if(p.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(p.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} ${p.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(p){if(p instanceof _c)return 1;throw p}}}function pS(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*I9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
39
39
  `);while(n>=0)yield t.slice(0,n).replace(/\r$/,""),t=t.slice(n+1),n=t.indexOf(`
40
- `)}if(t+=e.decode(),t!=="")yield t}var od=Bun.stdout.writer(),T9=await _S({lines:k9(),send:async(e)=>{od.write(`${e}
41
- `),await od.flush()}},{loadApiKey:()=>mn().apiKey||void 0});await od.end();process.exit(T9);
40
+ `)}if(t+=e.decode(),t!=="")yield t}var od=Bun.stdout.writer(),C9=await wS({lines:I9(),send:async(e)=>{od.write(`${e}
41
+ `),await od.flush()}},{loadApiKey:()=>vn().apiKey||void 0});await od.end();process.exit(C9);