@iistools/grove-mcp 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grove-mcp.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ var ck=Object.create;var{getPrototypeOf:uk,defineProperty:zg,getOwnPropertyNames:lk}=Object;var Pg=Object.prototype.hasOwnProperty;function dk(e){return this[e]}var pk,fk,rp=(e,t,r)=>{var o=e!=null&&typeof e==="object";if(o){var n=t?pk??=new WeakMap:fk??=new WeakMap,s=n.get(e);if(s)return s}r=e!=null?ck(uk(e)):{};let i=t||!e||!e.__esModule||!Pg.call(e,"default")?zg(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of lk(e))if(!Pg.call(i,a))zg(i,a,{get:dk.bind(e,a),enumerable:!0})}if(o)n.set(e,i);return i};var L=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var la=L(function(Ib){Object.defineProperty(Ib,"__esModule",{value:!0});Ib.regexpCode=Ib.getEsmExportName=Ib.getProperty=Ib.safeStringify=Ib.stringify=Ib.strConcat=Ib.addCodeArg=Ib.str=Ib._=Ib.nil=Ib._Code=Ib.Name=Ib.IDENTIFIER=Ib._CodeOrName=void 0;class ql{}Ib._CodeOrName=ql;Ib.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cs extends ql{constructor(e){super();if(!Ib.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}}}Ib.Name=cs;class hr extends ql{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},{})}}Ib._Code=hr;Ib.nil=new hr("");function Pb(e,...t){let r=[e[0]],o=0;while(o<t.length)Vm(r,t[o]),r.push(e[++o]);return new hr(r)}Ib._=Pb;var Fm=new hr("+");function Tb(e,...t){let r=[ua(e[0])],o=0;while(o<t.length)r.push(Fm),Vm(r,t[o]),r.push(Fm,ua(e[++o]));return u1(r),new hr(r)}Ib.str=Tb;function Vm(e,t){if(t instanceof hr)e.push(...t._items);else if(t instanceof cs)e.push(t);else e.push(p1(t))}Ib.addCodeArg=Vm;function u1(e){let t=1;while(t<e.length-1){if(e[t]===Fm){let r=l1(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function l1(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 d1(e,t){return t.emptyStr()?e:e.emptyStr()?t:Tb`${e}${t}`}Ib.strConcat=d1;function p1(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ua(Array.isArray(e)?e.join(","):e)}function f1(e){return new hr(ua(e))}Ib.stringify=f1;function ua(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ib.safeStringify=ua;function m1(e){return typeof e=="string"&&Ib.IDENTIFIER.test(e)?new hr(`.${e}`):Pb`[${e}]`}Ib.getProperty=m1;function h1(e){if(typeof e=="string"&&Ib.IDENTIFIER.test(e))return new hr(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Ib.getEsmExportName=h1;function g1(e){return new hr(e.toString())}Ib.regexpCode=g1});var Km=L(function(Nb){Object.defineProperty(Nb,"__esModule",{value:!0});Nb.ValueScope=Nb.ValueScopeName=Nb.Scope=Nb.varKinds=Nb.UsedValueState=void 0;var je=la();class Ob extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Ll;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Ll||(Nb.UsedValueState=Ll={}));Nb.varKinds={const:new je.Name("const"),let:new je.Name("let"),var:new je.Name("var")};class Hm{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof je.Name?e:this.name(e)}name(e){return new je.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}}}Nb.Scope=Hm;class Gm extends je.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=je._`.${new je.Name(t)}[${r}]`}}Nb.ValueScopeName=Gm;var I1=je._`\n`;class Cb extends Hm{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?I1:je.nil}}get(){return this._scope}name(e){return new Gm(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:n}=o,s=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[n];if(i){let u=i.get(s);if(u)return u}else i=this._values[n]=new Map;i.set(s,o);let a=this._scope[n]||(this._scope[n]=[]),c=a.length;return a[c]=t.ref,o.setValue(t,{property:n,itemIndex:c}),o}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 je._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(o)=>{if(o.value===void 0)throw Error(`CodeGen: name "${o}" has no value`);return o.value.code},t,r)}_reduceValues(e,t,r={},o){let n=je.nil;for(let s in e){let i=e[s];if(!i)continue;let a=r[s]=r[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Ll.Started);let u=t(c);if(u){let l=this.opts.es5?Nb.varKinds.var:Nb.varKinds.const;n=je._`${n}${l} ${c} = ${u};${this.opts._n}`}else if(u=o===null||o===void 0?void 0:o(c))n=je._`${n}${u}${this.opts._n}`;else throw new Ob(c);a.set(c,Ll.Completed)})}return n}}Nb.ValueScope=Cb});var be=L(function(Mt){Object.defineProperty(Mt,"__esModule",{value:!0});Mt.or=Mt.and=Mt.not=Mt.CodeGen=Mt.operators=Mt.varKinds=Mt.ValueScopeName=Mt.ValueScope=Mt.Scope=Mt.Name=Mt.regexpCode=Mt.stringify=Mt.getProperty=Mt.nil=Mt.strConcat=Mt.str=Mt._=void 0;var re=la(),et=Km(),So=la();Object.defineProperty(Mt,"_",{enumerable:!0,get:function(){return So._}});Object.defineProperty(Mt,"str",{enumerable:!0,get:function(){return So.str}});Object.defineProperty(Mt,"strConcat",{enumerable:!0,get:function(){return So.strConcat}});Object.defineProperty(Mt,"nil",{enumerable:!0,get:function(){return So.nil}});Object.defineProperty(Mt,"getProperty",{enumerable:!0,get:function(){return So.getProperty}});Object.defineProperty(Mt,"stringify",{enumerable:!0,get:function(){return So.stringify}});Object.defineProperty(Mt,"regexpCode",{enumerable:!0,get:function(){return So.regexpCode}});Object.defineProperty(Mt,"Name",{enumerable:!0,get:function(){return So.Name}});var Hl=Km();Object.defineProperty(Mt,"Scope",{enumerable:!0,get:function(){return Hl.Scope}});Object.defineProperty(Mt,"ValueScope",{enumerable:!0,get:function(){return Hl.ValueScope}});Object.defineProperty(Mt,"ValueScopeName",{enumerable:!0,get:function(){return Hl.ValueScopeName}});Object.defineProperty(Mt,"varKinds",{enumerable:!0,get:function(){return Hl.varKinds}});Mt.operators={GT:new re._Code(">"),GTE:new re._Code(">="),LT:new re._Code("<"),LTE:new re._Code("<="),EQ:new re._Code("==="),NEQ:new re._Code("!=="),NOT:new re._Code("!"),OR:new re._Code("||"),AND:new re._Code("&&"),ADD:new re._Code("+")};class bo{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Ab extends bo{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?et.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${o};`+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 re._CodeOrName?this.rhs.names:{}}}class Wm extends bo{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 re.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ls(this.rhs,e,t),this}get names(){let e=this.lhs instanceof re.Name?{}:{...this.lhs.names};return Zl(e,this.rhs)}}class jb extends Wm{constructor(e,t,r,o){super(e,r,o);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class qb extends bo{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Mb extends bo{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Lb extends bo{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Db extends bo{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 re._CodeOrName?this.code.names:{}}}class Gl extends bo{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,o=r.length;while(o--){let n=r[o];if(n.optimizeNames(e,t))continue;N1(e,n.names),r.splice(o,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>gn(e,t.names),{})}}class $o extends Gl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ub extends Gl{}class da extends $o{}da.kind="else";class Gr extends $o{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 da(r):r}if(t){if(e===!1)return t instanceof Gr?t:t.nodes;if(this.nodes.length)return this;return new Gr(Gb(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=ls(this.condition,e,t),this}get names(){let e=super.names;if(Zl(e,this.condition),this.else)gn(e,this.else.names);return e}}Gr.kind="if";class us extends $o{}us.kind="for";class Fb 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 gn(super.names,this.iteration.names)}}class Vb extends us{constructor(e,t,r,o){super();this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){let t=e.es5?et.varKinds.var:this.varKind,{name:r,from:o,to:n}=this;return`for(${t} ${r}=${o}; ${r}<${n}; ${r}++)`+super.render(e)}get names(){let e=Zl(super.names,this.from);return Zl(e,this.to)}}class Jm extends us{constructor(e,t,r,o){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=o}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 gn(super.names,this.iterable.names)}}class Dl extends $o{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)}}Dl.kind="func";class Ul extends Gl{render(e){return"return "+super.render(e)}}Ul.kind="return";class Zb extends $o{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,o;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(o=this.finally)===null||o===void 0||o.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)gn(e,this.catch.names);if(this.finally)gn(e,this.finally.names);return e}}class Fl extends $o{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Fl.kind="catch";class Vl extends $o{render(e){return"finally"+super.render(e)}}Vl.kind="finally";class Hb{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
3
+ `:""},this._extScope=e,this._scope=new et.Scope({parent:e}),this._nodes=[new Ub]}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,o){let n=this._scope.toName(t);if(r!==void 0&&o)this._constants[n.str]=r;return this._leafNode(new Ab(e,n,r)),n}const(e,t,r){return this._def(et.varKinds.const,e,t,r)}let(e,t,r){return this._def(et.varKinds.let,e,t,r)}var(e,t,r){return this._def(et.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Wm(e,t,r))}add(e,t){return this._leafNode(new jb(e,Mt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==re.nil)this._leafNode(new Db(e));return this}object(...e){let t=["{"];for(let[r,o]of e){if(t.length>1)t.push(",");if(t.push(r),r!==o||this.opts.es5)t.push(":"),re.addCodeArg(t,o)}return t.push("}"),new re._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 da)}endIf(){return this._endBlockNode(Gr,da)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Fb(e),t)}forRange(e,t,r,o,n=this.opts.es5?et.varKinds.var:et.varKinds.let){let s=this._scope.toName(e);return this._for(new Vb(n,s,t,r),()=>o(s))}forOf(e,t,r,o=et.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let s=t instanceof re.Name?t:this.var("_arr",t);return this.forRange("_i",0,re._`${s}.length`,(i)=>{this.var(n,re._`${s}[${i}]`),r(n)})}return this._for(new Jm("of",o,n,t),()=>r(n))}forIn(e,t,r,o=this.opts.es5?et.varKinds.var:et.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,re._`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new Jm("in",o,n,t),()=>r(n))}endFor(){return this._endBlockNode(us)}label(e){return this._leafNode(new qb(e))}break(e){return this._leafNode(new Mb(e))}return(e){let t=new Ul;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Ul)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let o=new Zb;if(this._blockNode(o),this.code(e),t){let n=this.name("e");this._currNode=o.catch=new Fl(n),t(n)}if(r)this._currNode=o.finally=new Vl,this.code(r);return this._endBlockNode(Fl,Vl)}throw(e){return this._leafNode(new Lb(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=re.nil,r,o){if(this._blockNode(new Dl(e,t,r)),o)this.code(o).endFunc();return this}endFunc(){return this._endBlockNode(Dl)}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}}Mt.CodeGen=Hb;function gn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Zl(e,t){return t instanceof re._CodeOrName?gn(e,t.names):e}function ls(e,t,r){if(e instanceof re.Name)return o(e);if(!n(e))return e;return new re._Code(e._items.reduce((s,i)=>{if(i instanceof re.Name)i=o(i);if(i instanceof re._Code)s.push(...i._items);else s.push(i);return s},[]));function o(s){let i=r[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function n(s){return s instanceof re._Code&&s._items.some((i)=>i instanceof re.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function N1(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Gb(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:re._`!${Bm(e)}`}Mt.not=Gb;var x1=Kb(Mt.operators.AND);function A1(...e){return e.reduce(x1)}Mt.and=A1;var j1=Kb(Mt.operators.OR);function q1(...e){return e.reduce(j1)}Mt.or=q1;function Kb(e){return(t,r)=>t===re.nil?r:r===re.nil?t:re._`${Bm(t)} ${e} ${Bm(r)}`}function Bm(e){return e instanceof re.Name?e:re._`(${e})`}});var Te=L(function(o$){Object.defineProperty(o$,"__esModule",{value:!0});o$.checkStrictMode=o$.getErrorPath=o$.Type=o$.useFunc=o$.setEvaluated=o$.evaluatedPropsToName=o$.mergeEvaluated=o$.eachItem=o$.unescapeJsonPointer=o$.escapeJsonPointer=o$.escapeFragment=o$.unescapeFragment=o$.schemaRefOrVal=o$.schemaHasRulesButRef=o$.schemaHasRules=o$.checkUnknownRules=o$.alwaysValidSchema=o$.toHash=void 0;var he=be(),Yb=la();function U1(e){let t={};for(let r of e)t[r]=!0;return t}o$.toHash=U1;function F1(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Xb(e,t),!Qb(t,e.self.RULES.all)}o$.alwaysValidSchema=F1;function Xb(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let n=o.RULES.keywords;for(let s in t)if(!n[s])r$(e,`unknown keyword: "${s}"`)}o$.checkUnknownRules=Xb;function Qb(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o$.schemaHasRules=Qb;function V1(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o$.schemaHasRulesButRef=V1;function Z1({topSchemaRef:e,schemaPath:t},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return he._`${r}`}return he._`${e}${t}${he.getProperty(o)}`}o$.schemaRefOrVal=Z1;function H1(e){return e$(decodeURIComponent(e))}o$.unescapeFragment=H1;function G1(e){return encodeURIComponent(Xm(e))}o$.escapeFragment=G1;function Xm(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}o$.escapeJsonPointer=Xm;function e$(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o$.unescapeJsonPointer=e$;function K1(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o$.eachItem=K1;function Bb({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(n,s,i,a)=>{let c=i===void 0?s:i instanceof he.Name?(s instanceof he.Name?e(n,s,i):t(n,s,i),i):s instanceof he.Name?(t(n,i,s),s):r(s,i);return a===he.Name&&!(c instanceof he.Name)?o(n,c):c}}o$.mergeEvaluated={props:Bb({mergeNames:(e,t,r)=>e.if(he._`${r} !== true && ${t} !== undefined`,()=>{e.if(he._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,he._`${r} || {}`).code(he._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(he._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,he._`${r} || {}`),Qm(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:t$}),items:Bb({mergeNames:(e,t,r)=>e.if(he._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,he._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(he._`${r} !== true`,()=>e.assign(r,t===!0?!0:he._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function t$(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",he._`{}`);if(t!==void 0)Qm(e,r,t);return r}o$.evaluatedPropsToName=t$;function Qm(e,t,r){Object.keys(r).forEach((o)=>e.assign(he._`${t}${he.getProperty(o)}`,!0))}o$.setEvaluated=Qm;var Wb={};function J1(e,t){return e.scopeValue("func",{ref:t,code:Wb[t.code]||(Wb[t.code]=new Yb._Code(t.code))})}o$.useFunc=J1;var Ym;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ym||(o$.Type=Ym={}));function B1(e,t,r){if(e instanceof he.Name){let o=t===Ym.Num;return r?o?he._`"[" + ${e} + "]"`:he._`"['" + ${e} + "']"`:o?he._`"/" + ${e}`:he._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?he.getProperty(e).toString():"/"+Xm(e)}o$.getErrorPath=B1;function r$(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}o$.checkStrictMode=r$});var er=L(function(s$){Object.defineProperty(s$,"__esModule",{value:!0});var xe=be(),fA={data:new xe.Name("data"),valCxt:new xe.Name("valCxt"),instancePath:new xe.Name("instancePath"),parentData:new xe.Name("parentData"),parentDataProperty:new xe.Name("parentDataProperty"),rootData:new xe.Name("rootData"),dynamicAnchors:new xe.Name("dynamicAnchors"),vErrors:new xe.Name("vErrors"),errors:new xe.Name("errors"),this:new xe.Name("this"),self:new xe.Name("self"),scope:new xe.Name("scope"),json:new xe.Name("json"),jsonPos:new xe.Name("jsonPos"),jsonLen:new xe.Name("jsonLen"),jsonPart:new xe.Name("jsonPart")};s$.default=fA});var pa=L(function(u$){Object.defineProperty(u$,"__esModule",{value:!0});u$.extendErrors=u$.resetErrorsCount=u$.reportExtraError=u$.reportError=u$.keyword$DataError=u$.keywordError=void 0;var oe=be(),wo=Te(),Nt=er();u$.keywordError={message:({keyword:e})=>oe.str`must pass "${e}" keyword validation`};u$.keyword$DataError={message:({keyword:e,schemaType:t})=>t?oe.str`"${e}" keyword must be ${t} ($data)`:oe.str`"${e}" keyword is invalid ($data)`};function hA(e,t=u$.keywordError,r,o){let{it:n}=e,{gen:s,compositeRule:i,allErrors:a}=n,c=c$(e,t,r);if(o!==null&&o!==void 0?o:i||a)i$(s,c);else a$(n,oe._`[${c}]`)}u$.reportError=hA;function gA(e,t=u$.keywordError,r){let{it:o}=e,{gen:n,compositeRule:s,allErrors:i}=o,a=c$(e,t,r);if(i$(n,a),!(s||i))a$(o,Nt.default.vErrors)}u$.reportExtraError=gA;function _A(e,t){e.assign(Nt.default.errors,t),e.if(oe._`${Nt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(oe._`${Nt.default.vErrors}.length`,t),()=>e.assign(Nt.default.vErrors,null)))}u$.resetErrorsCount=_A;function yA({gen:e,keyword:t,schemaValue:r,data:o,errsCount:n,it:s}){if(n===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",n,Nt.default.errors,(a)=>{if(e.const(i,oe._`${Nt.default.vErrors}[${a}]`),e.if(oe._`${i}.instancePath === undefined`,()=>e.assign(oe._`${i}.instancePath`,oe.strConcat(Nt.default.instancePath,s.errorPath))),e.assign(oe._`${i}.schemaPath`,oe.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(oe._`${i}.schema`,r),e.assign(oe._`${i}.data`,o)})}u$.extendErrors=yA;function i$(e,t){let r=e.const("err",t);e.if(oe._`${Nt.default.vErrors} === null`,()=>e.assign(Nt.default.vErrors,oe._`[${r}]`),oe._`${Nt.default.vErrors}.push(${r})`),e.code(oe._`${Nt.default.errors}++`)}function a$(e,t){let{gen:r,validateName:o,schemaEnv:n}=e;if(n.$async)r.throw(oe._`new ${e.ValidationError}(${t})`);else r.assign(oe._`${o}.errors`,t),r.return(!1)}var _n={keyword:new oe.Name("keyword"),schemaPath:new oe.Name("schemaPath"),params:new oe.Name("params"),propertyName:new oe.Name("propertyName"),message:new oe.Name("message"),schema:new oe.Name("schema"),parentSchema:new oe.Name("parentSchema")};function c$(e,t,r){let{createErrors:o}=e.it;if(o===!1)return oe._`{}`;return vA(e,t,r)}function vA(e,t,r={}){let{gen:o,it:n}=e,s=[SA(n,r),bA(e,r)];return $A(e,t,s),o.object(...s)}function SA({errorPath:e},{instancePath:t}){let r=t?oe.str`${e}${wo.getErrorPath(t,wo.Type.Str)}`:e;return[Nt.default.instancePath,oe.strConcat(Nt.default.instancePath,r)]}function bA({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let n=o?t:oe.str`${t}/${e}`;if(r)n=oe.str`${n}${wo.getErrorPath(r,wo.Type.Str)}`;return[_n.schemaPath,n]}function $A(e,{params:t,message:r},o){let{keyword:n,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;if(o.push([_n.keyword,n],[_n.params,typeof t=="function"?t(e):t||oe._`{}`]),c.messages)o.push([_n.message,typeof r=="function"?r(e):r]);if(c.verbose)o.push([_n.schema,i],[_n.parentSchema,oe._`${l}${d}`],[Nt.default.data,s]);if(u)o.push([_n.propertyName,u])}});var g$=L(function(m$){Object.defineProperty(m$,"__esModule",{value:!0});m$.boolOrEmptySchema=m$.topBoolOrEmptySchema=void 0;var d$=pa(),p$=be(),PA=er(),TA={message:"boolean schema is false"};function IA(e){let{gen:t,schema:r,validateName:o}=e;if(r===!1)f$(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(PA.default.data);else t.assign(p$._`${o}.errors`,null),t.return(!0)}m$.topBoolOrEmptySchema=IA;function kA(e,t){let{gen:r,schema:o}=e;if(o===!1)r.var(t,!1),f$(e);else r.var(t,!0)}m$.boolOrEmptySchema=kA;function f$(e,t){let{gen:r,data:o}=e;d$.reportError({gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},TA,void 0,t)}});var th=L(function(_$){Object.defineProperty(_$,"__esModule",{value:!0});_$.getRules=_$.isJSONType=void 0;var CA=["string","number","integer","boolean","null","object","array"],NA=new Set(CA);function xA(e){return typeof e=="string"&&NA.has(e)}_$.isJSONType=xA;function AA(){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:{}}}_$.getRules=AA});var rh=L(function(b$){Object.defineProperty(b$,"__esModule",{value:!0});b$.shouldUseRule=b$.shouldUseGroup=b$.schemaHasRulesForType=void 0;function qA({schema:e,self:t},r){let o=t.RULES.types[r];return o&&o!==!0&&v$(e,o)}b$.schemaHasRulesForType=qA;function v$(e,t){return t.rules.some((r)=>S$(e,r))}b$.shouldUseGroup=v$;function S$(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((o)=>e[o]!==void 0))}b$.shouldUseRule=S$});var fa=L(function(T$){Object.defineProperty(T$,"__esModule",{value:!0});T$.reportTypeError=T$.checkDataTypes=T$.checkDataType=T$.coerceAndCheckDataType=T$.getJSONTypes=T$.getSchemaTypes=T$.DataType=void 0;var w$=th(),R$=rh(),E$=pa(),W=be(),Jl=Te(),ds;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ds||(T$.DataType=ds={}));function DA(e){let t=z$(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}T$.getSchemaTypes=DA;function z$(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(w$.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}T$.getJSONTypes=z$;function UA(e,t){let{gen:r,data:o,opts:n}=e,s=FA(t,n.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&R$.schemaHasRulesForType(e,t[0]));if(i){let a=nh(t,o,n.strictNumbers,ds.Wrong);r.if(a,()=>{if(s.length)VA(e,t,s);else sh(e)})}return i}T$.coerceAndCheckDataType=UA;var P$=new Set(["string","number","integer","boolean","null"]);function FA(e,t){return t?e.filter((r)=>P$.has(r)||t==="array"&&r==="array"):[]}function VA(e,t,r){let{gen:o,data:n,opts:s}=e,i=o.let("dataType",W._`typeof ${n}`),a=o.let("coerced",W._`undefined`);if(s.coerceTypes==="array")o.if(W._`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,W._`${n}[0]`).assign(i,W._`typeof ${n}`).if(nh(t,n,s.strictNumbers),()=>o.assign(a,n)));o.if(W._`${a} !== undefined`);for(let u of r)if(P$.has(u)||u==="array"&&s.coerceTypes==="array")c(u);o.else(),sh(e),o.endIf(),o.if(W._`${a} !== undefined`,()=>{o.assign(n,a),ZA(e,a)});function c(u){switch(u){case"string":o.elseIf(W._`${i} == "number" || ${i} == "boolean"`).assign(a,W._`"" + ${n}`).elseIf(W._`${n} === null`).assign(a,W._`""`);return;case"number":o.elseIf(W._`${i} == "boolean" || ${n} === null
4
+ || (${i} == "string" && ${n} && ${n} == +${n})`).assign(a,W._`+${n}`);return;case"integer":o.elseIf(W._`${i} === "boolean" || ${n} === null
5
+ || (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,W._`+${n}`);return;case"boolean":o.elseIf(W._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf(W._`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf(W._`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf(W._`${i} === "string" || ${i} === "number"
6
+ || ${i} === "boolean" || ${n} === null`).assign(a,W._`[${n}]`)}}}function ZA({gen:e,parentData:t,parentDataProperty:r},o){e.if(W._`${t} !== undefined`,()=>e.assign(W._`${t}[${r}]`,o))}function oh(e,t,r,o=ds.Correct){let n=o===ds.Correct?W.operators.EQ:W.operators.NEQ,s;switch(e){case"null":return W._`${t} ${n} null`;case"array":s=W._`Array.isArray(${t})`;break;case"object":s=W._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i(W._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return W._`typeof ${t} ${n} ${e}`}return o===ds.Correct?s:W.not(s);function i(a=W.nil){return W.and(W._`typeof ${t} == "number"`,a,r?W._`isFinite(${t})`:W.nil)}}T$.checkDataType=oh;function nh(e,t,r,o){if(e.length===1)return oh(e[0],t,r,o);let n,s=Jl.toHash(e);if(s.array&&s.object){let i=W._`typeof ${t} != "object"`;n=s.null?i:W._`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else n=W.nil;if(s.number)delete s.integer;for(let i in s)n=W.and(n,oh(i,t,r,o));return n}T$.checkDataTypes=nh;var HA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?W._`{type: ${e}}`:W._`{type: ${t}}`};function sh(e){let t=GA(e);E$.reportError(t,HA)}T$.reportTypeError=sh;function GA(e){let{gen:t,data:r,schema:o}=e,n=Jl.schemaRefOrVal(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:e}}});var x$=L(function(C$){Object.defineProperty(C$,"__esModule",{value:!0});C$.assignDefaults=void 0;var tr=be(),O$=Te();function QA(e,t){let{properties:r,items:o}=e.schema;if(t==="object"&&r)for(let n in r)k$(e,n,r[n].default);else if(t==="array"&&Array.isArray(o))o.forEach((n,s)=>k$(e,s,n.default))}C$.assignDefaults=QA;function k$(e,t,r){let{gen:o,compositeRule:n,data:s,opts:i}=e;if(r===void 0)return;let a=tr._`${s}${tr.getProperty(t)}`;if(n){O$.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=tr._`${a} === undefined`;if(i.useDefaults==="empty")c=tr._`${c} || ${a} === null || ${a} === ""`;o.if(c,tr._`${a} = ${tr.stringify(r)}`)}});var rr=L(function(M$){Object.defineProperty(M$,"__esModule",{value:!0});M$.validateUnion=M$.validateArray=M$.usePattern=M$.callValidateCode=M$.schemaProperties=M$.allSchemaProperties=M$.noPropertyInData=M$.propertyInData=M$.isOwnProperty=M$.hasPropFunc=M$.reportMissingProp=M$.checkMissingProp=M$.checkReportMissingProp=void 0;var _e=be(),ps=Te(),Ro=er(),A$=Te();function ej(e,t){let{gen:r,data:o,it:n}=e;r.if(ah(r,o,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:_e._`${t}`},!0),e.error()})}M$.checkReportMissingProp=ej;function tj({gen:e,data:t,it:{opts:r}},o,n){return _e.or(...o.map((s)=>_e.and(ah(e,t,s,r.ownProperties),_e._`${n} = ${s}`)))}M$.checkMissingProp=tj;function rj(e,t){e.setParams({missingProperty:t},!0),e.error()}M$.reportMissingProp=rj;function j$(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:_e._`Object.prototype.hasOwnProperty`})}M$.hasPropFunc=j$;function ih(e,t,r){return _e._`${j$(e)}.call(${t}, ${r})`}M$.isOwnProperty=ih;function oj(e,t,r,o){let n=_e._`${t}${_e.getProperty(r)} !== undefined`;return o?_e._`${n} && ${ih(e,t,r)}`:n}M$.propertyInData=oj;function ah(e,t,r,o){let n=_e._`${t}${_e.getProperty(r)} === undefined`;return o?_e.or(n,_e.not(ih(e,t,r))):n}M$.noPropertyInData=ah;function q$(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}M$.allSchemaProperties=q$;function nj(e,t){return q$(t).filter((r)=>!ps.alwaysValidSchema(e,t[r]))}M$.schemaProperties=nj;function sj({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:s},it:i},a,c,u){let l=u?_e._`${e}, ${t}, ${o}${n}`:t,d=[[Ro.default.instancePath,_e.strConcat(Ro.default.instancePath,s)],[Ro.default.parentData,i.parentData],[Ro.default.parentDataProperty,i.parentDataProperty],[Ro.default.rootData,Ro.default.rootData]];if(i.opts.dynamicRef)d.push([Ro.default.dynamicAnchors,Ro.default.dynamicAnchors]);let f=_e._`${l}, ${r.object(...d)}`;return c!==_e.nil?_e._`${a}.call(${c}, ${f})`:_e._`${a}(${f})`}M$.callValidateCode=sj;var ij=_e._`new RegExp`;function aj({gen:e,it:{opts:t}},r){let o=t.unicodeRegExp?"u":"",{regExp:n}=t.code,s=n(r,o);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:_e._`${n.code==="new RegExp"?ij:A$.useFunc(e,n)}(${r}, ${o})`})}M$.usePattern=aj;function cj(e){let{gen:t,data:r,keyword:o,it:n}=e,s=t.name("valid");if(n.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){let c=t.const("len",_e._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:o,dataProp:u,dataPropType:ps.Type.Num},s),t.if(_e.not(s),a)})}}M$.validateArray=cj;function uj(e){let{gen:t,schema:r,keyword:o,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>ps.alwaysValidSchema(n,c))&&!n.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:o,schemaProp:u,compositeRule:!0},a);if(t.assign(i,_e._`${i} || ${a}`),!e.mergeValidEvaluated(l,a))t.if(_e.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}M$.validateUnion=uj});var G$=L(function(Z$){Object.defineProperty(Z$,"__esModule",{value:!0});Z$.validateKeywordUsage=Z$.validSchemaType=Z$.funcKeywordCode=Z$.macroKeywordCode=void 0;var Ae=be(),yn=er(),U$=rr(),F$=pa();function $j(e,t){let{gen:r,keyword:o,schema:n,parentSchema:s,it:i}=e,a=t.macro.call(i.self,n,s,i),c=V$(r,o,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:Ae.nil,errSchemaPath:`${i.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Z$.macroKeywordCode=$j;function wj(e,t){var r;let{gen:o,keyword:n,schema:s,parentSchema:i,$data:a,it:c}=e;Ej(c,t);let u=!a&&t.compile?t.compile.call(c.self,s,i,c):t.validate,l=V$(o,n,u),d=o.let("valid");e.block$data(d,f),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function f(){if(t.errors===!1){if(g(),t.modifying)D$(e);y(()=>e.error())}else{let m=t.async?h():_();if(t.modifying)D$(e);y(()=>Rj(e,m))}}function h(){let m=o.let("ruleErrs",null);return o.try(()=>g(Ae._`await `),(S)=>o.assign(d,!1).if(Ae._`${S} instanceof ${c.ValidationError}`,()=>o.assign(m,Ae._`${S}.errors`),()=>o.throw(S))),m}function _(){let m=Ae._`${l}.errors`;return o.assign(m,null),g(Ae.nil),m}function g(m=t.async?Ae._`await `:Ae.nil){let S=c.opts.passContext?yn.default.this:yn.default.self,v=!(("compile"in t)&&!a||t.schema===!1);o.assign(d,Ae._`${m}${U$.callValidateCode(e,l,S,v)}`,t.modifying)}function y(m){var S;o.if(Ae.not((S=t.valid)!==null&&S!==void 0?S:d),m)}}Z$.funcKeywordCode=wj;function D$(e){let{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,Ae._`${o.parentData}[${o.parentDataProperty}]`))}function Rj(e,t){let{gen:r}=e;r.if(Ae._`Array.isArray(${t})`,()=>{r.assign(yn.default.vErrors,Ae._`${yn.default.vErrors} === null ? ${t} : ${yn.default.vErrors}.concat(${t})`).assign(yn.default.errors,Ae._`${yn.default.vErrors}.length`),F$.extendErrors(e)},()=>e.error())}function Ej({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function V$(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:Ae.stringify(r)})}function zj(e,t,r=!1){return!t.length||t.some((o)=>o==="array"?Array.isArray(e):o==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==o||r&&typeof e>"u")}Z$.validSchemaType=zj;function Pj({schema:e,opts:t,self:r,errSchemaPath:o},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw Error("ajv implementation error");let i=n.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 ${s}: ${i.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}Z$.validateKeywordUsage=Pj});var B$=L(function(K$){Object.defineProperty(K$,"__esModule",{value:!0});K$.extendSubschemaMode=K$.extendSubschemaData=K$.getSubschema=void 0;var ut=be(),Bl=Te();function Oj(e,{keyword:t,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:s,topSchemaRef:i}){if(t!==void 0&&o!==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:ut._`${e.schemaPath}${ut.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:ut._`${e.schemaPath}${ut.getProperty(t)}${ut.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${Bl.escapeFragment(r)}`}}if(o!==void 0){if(n===void 0||s===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:i,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}K$.getSubschema=Oj;function Cj(e,t,{dataProp:r,dataPropType:o,data:n,dataTypes:s,propertyName:i}){if(n!==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:l,opts:d}=t,f=a.let("data",ut._`${t.data}${ut.getProperty(r)}`,!0);c(f),e.errorPath=ut.str`${u}${Bl.getErrorPath(r,o,d.jsPropertySyntax)}`,e.parentDataProperty=ut._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(n!==void 0){let u=n instanceof ut.Name?n:a.let("data",n,!0);if(c(u),i!==void 0)e.propertyName=i}if(s)e.dataTypes=s;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]}}K$.extendSubschemaData=Cj;function Nj(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:s}){if(o!==void 0)e.compositeRule=o;if(n!==void 0)e.createErrors=n;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=r}K$.extendSubschemaMode=Nj});var ch=L(function(sJ,W$){W$.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 o,n,s;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=o;n--!==0;){var i=s[n];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var X$=L(function(iJ,Y$){var Eo=Y$.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Wl(t,o,n,e,"",e)};Eo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Eo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Eo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Eo.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 Wl(e,t,r,o,n,s,i,a,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,n,s,i,a,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in Eo.arrayKeywords)for(var f=0;f<d.length;f++)Wl(e,t,r,d[f],n+"/"+l+"/"+f,s,n,l,o,f)}else if(l in Eo.propsKeywords){if(d&&typeof d=="object")for(var h in d)Wl(e,t,r,d[h],n+"/"+l+"/"+jj(h),s,n,l,o,h)}else if(l in Eo.keywords||e.allKeys&&!(l in Eo.skipKeywords))Wl(e,t,r,d,n+"/"+l,s,n,l,o)}r(o,n,s,i,a,c,u)}}function jj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ma=L(function(ow){Object.defineProperty(ow,"__esModule",{value:!0});ow.getSchemaRefs=ow.resolveUrl=ow.normalizeId=ow._getFullPath=ow.getFullPath=ow.inlineRef=void 0;var Q$=Te(),qj=ch(),Mj=X$(),Lj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Dj(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!uh(e);if(!t)return!1;return ew(e)<=t}ow.inlineRef=Dj;var Uj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function uh(e){for(let t in e){if(Uj.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(uh))return!0;if(typeof r=="object"&&uh(r))return!0}return!1}function ew(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,Lj.has(r))continue;if(typeof e[r]=="object")Q$.eachItem(e[r],(o)=>t+=ew(o));if(t===1/0)return 1/0}return t}function tw(e,t="",r){if(r!==!1)t=fs(t);let o=e.parse(t);return rw(e,o)}ow.getFullPath=tw;function rw(e,t){return e.serialize(t).split("#")[0]+"#"}ow._getFullPath=rw;var Fj=/#\/?$/;function fs(e){return e?e.replace(Fj,""):""}ow.normalizeId=fs;function Vj(e,t,r){return r=fs(r),e.resolve(t,r)}ow.resolveUrl=Vj;var Zj=/^[a-z_][-a-z0-9._]*$/i;function Hj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=fs(e[r]||t),s={"":n},i=tw(o,n,!1),a={},c=new Set;return Mj(e,{allKeys:!0},(d,f,h,_)=>{if(_===void 0)return;let g=i+f,y=s[_];if(typeof d[r]=="string")y=m.call(this,d[r]);S.call(this,d.$anchor),S.call(this,d.$dynamicAnchor),s[f]=y;function m(v){let w=this.opts.uriResolver.resolve;if(v=fs(y?w(y,v):v),c.has(v))throw l(v);c.add(v);let P=this.refs[v];if(typeof P=="string")P=this.refs[P];if(typeof P=="object")u(d,P.schema,v);else if(v!==fs(g))if(v[0]==="#")u(d,a[v],v),a[v]=d;else this.refs[v]=g;return v}function S(v){if(typeof v=="string"){if(!Zj.test(v))throw Error(`invalid anchor "${v}"`);m.call(this,`#${v}`)}}}),a;function u(d,f,h){if(f!==void 0&&!qj(d,f))throw l(h)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}ow.getSchemaRefs=Hj});var gs=L(function(vw){Object.defineProperty(vw,"__esModule",{value:!0});vw.getData=vw.KeywordCxt=vw.validateFunctionCode=void 0;var Xl=g$(),Yl=fa(),hs=rh(),zo=fa(),cw=x$(),Er=G$(),ms=B$(),V=be(),ye=er(),uw=ma(),yt=Te(),Rr=pa();function Yj(e){if(pw(e)){if(fw(e),dw(e)){eq(e);return}}lw(e,()=>Xl.topBoolOrEmptySchema(e))}vw.validateFunctionCode=Yj;function lw({gen:e,validateName:t,schema:r,schemaEnv:o,opts:n},s){if(n.code.es5)e.func(t,V._`${ye.default.data}, ${ye.default.valCxt}`,o.$async,()=>{e.code(V._`"use strict"; ${sw(r,n)}`),Qj(e,n),e.code(s)});else e.func(t,V._`${ye.default.data}, ${Xj(n)}`,o.$async,()=>e.code(sw(r,n)).code(s))}function Xj(e){return V._`{${ye.default.instancePath}="", ${ye.default.parentData}, ${ye.default.parentDataProperty}, ${ye.default.rootData}=${ye.default.data}${e.dynamicRef?V._`, ${ye.default.dynamicAnchors}={}`:V.nil}}={}`}function Qj(e,t){e.if(ye.default.valCxt,()=>{if(e.var(ye.default.instancePath,V._`${ye.default.valCxt}.${ye.default.instancePath}`),e.var(ye.default.parentData,V._`${ye.default.valCxt}.${ye.default.parentData}`),e.var(ye.default.parentDataProperty,V._`${ye.default.valCxt}.${ye.default.parentDataProperty}`),e.var(ye.default.rootData,V._`${ye.default.valCxt}.${ye.default.rootData}`),t.dynamicRef)e.var(ye.default.dynamicAnchors,V._`${ye.default.valCxt}.${ye.default.dynamicAnchors}`)},()=>{if(e.var(ye.default.instancePath,V._`""`),e.var(ye.default.parentData,V._`undefined`),e.var(ye.default.parentDataProperty,V._`undefined`),e.var(ye.default.rootData,ye.default.data),t.dynamicRef)e.var(ye.default.dynamicAnchors,V._`{}`)})}function eq(e){let{schema:t,opts:r,gen:o}=e;lw(e,()=>{if(r.$comment&&t.$comment)hw(e);if(sq(e),o.let(ye.default.vErrors,null),o.let(ye.default.errors,0),r.unevaluated)tq(e);mw(e),cq(e)});return}function tq(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",V._`${r}.evaluated`),t.if(V._`${e.evaluated}.dynamicProps`,()=>t.assign(V._`${e.evaluated}.props`,V._`undefined`)),t.if(V._`${e.evaluated}.dynamicItems`,()=>t.assign(V._`${e.evaluated}.items`,V._`undefined`))}function sw(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?V._`/*# sourceURL=${r} */`:V.nil}function rq(e,t){if(pw(e)){if(fw(e),dw(e)){oq(e,t);return}}Xl.boolOrEmptySchema(e,t)}function dw({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 pw(e){return typeof e.schema!="boolean"}function oq(e,t){let{schema:r,gen:o,opts:n}=e;if(n.$comment&&r.$comment)hw(e);iq(e),aq(e);let s=o.const("_errs",ye.default.errors);mw(e,s),o.var(t,V._`${s} === ${ye.default.errors}`)}function fw(e){yt.checkUnknownRules(e),nq(e)}function mw(e,t){if(e.opts.jtd)return iw(e,[],!1,t);let r=Yl.getSchemaTypes(e.schema),o=Yl.coerceAndCheckDataType(e,r);iw(e,r,!o,t)}function nq(e){let{schema:t,errSchemaPath:r,opts:o,self:n}=e;if(t.$ref&&o.ignoreKeywordsWithRef&&yt.schemaHasRulesButRef(t,n.RULES))n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function sq(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)yt.checkStrictMode(e,"default is ignored in the schema root")}function iq(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=uw.resolveUrl(e.opts.uriResolver,e.baseId,t)}function aq(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function hw({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:n}){let s=r.$comment;if(n.$comment===!0)e.code(V._`${ye.default.self}.logger.log(${s})`);else if(typeof n.$comment=="function"){let i=V.str`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(V._`${ye.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function cq(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:n,opts:s}=e;if(r.$async)t.if(V._`${ye.default.errors} === 0`,()=>t.return(ye.default.data),()=>t.throw(V._`new ${n}(${ye.default.vErrors})`));else{if(t.assign(V._`${o}.errors`,ye.default.vErrors),s.unevaluated)uq(e);t.return(V._`${ye.default.errors} === 0`)}}function uq({gen:e,evaluated:t,props:r,items:o}){if(r instanceof V.Name)e.assign(V._`${t}.props`,r);if(o instanceof V.Name)e.assign(V._`${t}.items`,o)}function iw(e,t,r,o){let{gen:n,schema:s,data:i,allErrors:a,opts:c,self:u}=e,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!yt.schemaHasRulesButRef(s,l))){n.block(()=>_w(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)lq(e,t);n.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){if(!hs.shouldUseGroup(s,f))return;if(f.type){if(n.if(zo.checkDataType(f.type,i,c.strictNumbers)),aw(e,f),t.length===1&&t[0]===f.type&&r)n.else(),zo.reportTypeError(e);n.endIf()}else aw(e,f);if(!a)n.if(V._`${ye.default.errors} === ${o||0}`)}}function aw(e,t){let{gen:r,schema:o,opts:{useDefaults:n}}=e;if(n)cw.assignDefaults(e,t.type);r.block(()=>{for(let s of t.rules)if(hs.shouldUseRule(o,s))_w(e,s.keyword,s.definition,t.type)})}function lq(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(dq(e,t),!e.opts.allowUnionTypes)pq(e,t);fq(e,e.dataTypes)}function dq(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!gw(e.dataTypes,r))lh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),hq(e,t)}function pq(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))lh(e,"use allowUnionTypes to allow union type keyword")}function fq(e,t){let r=e.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&hs.shouldUseRule(e.schema,n)){let{type:s}=n.definition;if(s.length&&!s.some((i)=>mq(t,i)))lh(e,`missing type "${s.join(",")}" for keyword "${o}"`)}}}function mq(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function gw(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function hq(e,t){let r=[];for(let o of e.dataTypes)if(gw(t,o))r.push(o);else if(t.includes("integer")&&o==="number")r.push("integer");e.dataTypes=r}function lh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,yt.checkStrictMode(e,t,e.opts.strictTypes)}class dh{constructor(e,t,r){if(Er.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=yt.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",yw(this.$data,e));else if(this.schemaCode=this.schemaValue,!Er.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",ye.default.errors)}result(e,t,r){this.failResult(V.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(V.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(V._`${t} !== undefined && (${V.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?Rr.reportExtraError:Rr.reportError)(this,this.def.error,t)}$dataError(){Rr.reportError(this,this.def.$dataError||Rr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Rr.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=V.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=V.nil,t=V.nil){if(!this.$data)return;let{gen:r,schemaCode:o,schemaType:n,def:s}=this;if(r.if(V.or(V._`${o} === undefined`,t)),e!==V.nil)r.assign(e,!0);if(n.length||s.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==V.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:o,it:n}=this;return V.or(s(),i());function s(){if(r.length){if(!(t instanceof V.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return V._`${zo.checkDataTypes(a,t,n.opts.strictNumbers,zo.DataType.Wrong)}`}return V.nil}function i(){if(o.validateSchema){let a=e.scopeValue("validate$data",{ref:o.validateSchema});return V._`!${a}(${t})`}return V.nil}}subschema(e,t){let r=ms.getSubschema(this.it,e);ms.extendSubschemaData(r,this.it,e),ms.extendSubschemaMode(r,e);let o={...this.it,...r,items:void 0,props:void 0};return rq(o,t),o}mergeEvaluated(e,t){let{it:r,gen:o}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=yt.mergeEvaluated.props(o,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=yt.mergeEvaluated.items(o,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:o}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return o.if(t,()=>this.mergeEvaluated(e,V.Name)),!0}}vw.KeywordCxt=dh;function _w(e,t,r,o){let n=new dh(e,r,t);if("code"in r)r.code(n,o);else if(n.$data&&r.validate)Er.funcKeywordCode(n,r);else if("macro"in r)Er.macroKeywordCode(n,r);else if(r.compile||r.validate)Er.funcKeywordCode(n,r)}var gq=/^\/(?:[^~]|~0|~1)*$/,_q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function yw(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let n,s;if(e==="")return ye.default.rootData;if(e[0]==="/"){if(!gq.test(e))throw Error(`Invalid JSON-pointer: ${e}`);n=e,s=ye.default.rootData}else{let u=_q.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=t)throw Error(c("property/index",l));return o[t-l]}if(l>t)throw Error(c("data",l));if(s=r[t-l],!n)return s}let i=s,a=n.split("/");for(let u of a)if(u)s=V._`${s}${V.getProperty(yt.unescapeJsonPointer(u))}`,i=V._`${i} && ${s}`;return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}vw.getData=yw});var ha=L(function($w){Object.defineProperty($w,"__esModule",{value:!0});class bw extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}$w.default=bw});var ys=L(function(Rw){Object.defineProperty(Rw,"__esModule",{value:!0});var _s=ma();class ww extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`);this.missingRef=_s.resolveUrl(e,t,r),this.missingSchema=_s.normalizeId(_s.getFullPath(e,this.missingRef))}}Rw.default=ww});var _a=L(function(Pw){Object.defineProperty(Pw,"__esModule",{value:!0});Pw.resolveSchema=Pw.getCompilingSchema=Pw.resolveRef=Pw.compileSchema=Pw.SchemaEnv=void 0;var tt=be(),$q=ha(),vn=er(),rt=ma(),Ql=Te(),Ew=gs();class ga{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:rt.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={}}}Pw.SchemaEnv=ga;function fh(e){let t=zw.call(this,e);if(t)return t;let r=rt.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:s}=this.opts,i=new tt.CodeGen(this.scope,{es5:o,lines:n,ownProperties:s}),a;if(e.$async)a=i.scopeValue("Error",{ref:$q.default,code:tt._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:vn.default.data,parentData:vn.default.parentData,parentDataProperty:vn.default.parentDataProperty,dataNames:[vn.default.data],dataPathArr:[tt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:tt.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:tt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:tt._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),Ew.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let d=i.toString();if(l=`${i.scopeRefs(vn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let h=Function(`${vn.default.self}`,`${vn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async)h.$async=!0;if(this.opts.code.source===!0)h.source={validateName:c,validateCode:d,scopeValues:i._values};if(this.opts.unevaluated){let{props:_,items:g}=u;if(h.evaluated={props:_ instanceof tt.Name?void 0:_,items:g instanceof tt.Name?void 0:g,dynamicProps:_ instanceof tt.Name,dynamicItems:g instanceof tt.Name},h.source)h.source.evaluated=tt.stringify(h.evaluated)}return e.validate=h,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)}}Pw.compileSchema=fh;function wq(e,t,r){var o;r=rt.resolveUrl(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let s=zq.call(this,e,r);if(s===void 0){let i=(o=e.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;if(i)s=new ga({schema:i,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[r]=Rq.call(this,s)}Pw.resolveRef=wq;function Rq(e){if(rt.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:fh.call(this,e)}function zw(e){for(let t of this._compilations)if(Eq(t,e))return t}Pw.getCompilingSchema=zw;function Eq(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function zq(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ed.call(this,e,t)}function ed(e,t){let r=this.opts.uriResolver.parse(t),o=rt._getFullPath(this.opts.uriResolver,r),n=rt.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===n)return ph.call(this,r,e);let s=rt.normalizeId(o),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=ed.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return ph.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)fh.call(this,i);if(s===rt.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)n=rt.resolveUrl(this.opts.uriResolver,n,u);return new ga({schema:a,schemaId:c,root:e,baseId:n})}return ph.call(this,r,i)}Pw.resolveSchema=ed;var Pq=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ph(e,{baseId:t,schema:r,root:o}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[Ql.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Pq.has(a)&&u)t=rt.resolveUrl(this.opts.uriResolver,t,u)}let s;if(typeof r!="boolean"&&r.$ref&&!Ql.schemaHasRulesButRef(r,this.RULES)){let a=rt.resolveUrl(this.opts.uriResolver,t,r.$ref);s=ed.call(this,o,a)}let{schemaId:i}=this.opts;if(s=s||new ga({schema:r,schemaId:i,root:o,baseId:t}),s.schema!==s.root.schema)return s;return}});var Iw=L(function(pJ,Cq){Cq.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 vh=L(function(fJ,jw){var Nq=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),hh=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),xq=RegExp.prototype.test.bind(/^\d*$/u),Sn=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),gh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Ow=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),_h=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),Aq=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Lt=Array(256);for(let t=0;t<256;t++)Lt[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function It(e){if(e<2048)return Lt[192|e>>6]+Lt[128|e&63];if(e<65536)return Lt[224|e>>12]+Lt[128|e>>6&63]+Lt[128|e&63];return Lt[240|e>>18]+Lt[128|e>>12&63]+Lt[128|e>>6&63]+Lt[128|e&63]}function jq(e){let t="",r=0,o=0;for(o=0;o<e.length;o++){if(r=e[o].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(r=e[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}var qq=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),Mq=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),Lq=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),Dq=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Uq(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(Lq(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&Sn(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function kw(e){let t=-1,r=0,o=-1,n=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(o===-1)o=a;if(n++,n>r)r=n,t=o}else o=-1,n=0;if(r<2)return e.join(":");let s=e.slice(0,t).join(":"),i=e.slice(t+r).join(":");return s+"::"+i}function Fq(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),o=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(o.length===1&&o[0]==="")o.length=0}let n=r.concat(o),s=0;for(let a=0;a<n.length;a++){let c=n[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==n.length-1||t!==-1&&o.length===0||!hh(c))return;s+=2;continue}if(!qq(c))return;n[a]=parseInt(c,16).toString(16),s++}if(t===-1){if(s!==8)return;return kw(n)}if(s>=8)return;let i=n.slice(0,r.length);for(let a=s;a<8;a++)i.push("0");for(let a=r.length;a<n.length;a++)i.push(n[a]);return kw(i)}function mh(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let o=t?e.slice(1,-1):e;if(t&&Mq(o))return o=o.toLowerCase(),{host:`[${o}]`,escapedHost:o,isIPV6:!1,isIPVFuture:!0};if(Vq(o,":")<2)return{host:e,isIPV6:!1,error:t};let n="",s=o.indexOf("%");if(s!==-1){let a=o.slice(s,s+3).toLowerCase()==="%25"?3:1;if(n=o.slice(s+a),!Uq(n))return{host:e,isIPV6:!1,error:!0};o=o.slice(0,s)}let i=Fq(o);if(i===void 0)return{host:e,isIPV6:!1,error:!0};return{host:i+(n?"%"+n:""),escapedHost:i+(n?"%25"+n:""),isIPV6:!0}}function Vq(e,t){let r=0;for(let o=0;o<e.length;o++)if(e[o]===t)r++;return r}function Zq(e){let t=e,r=[],o=-1,n=0;while(n=t.length){if(n===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(n===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(n===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((o=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")}var Hq={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gq=/[@/?#:]/g,Kq=/[@/?#]/g;function Cw(e,t){let r=t?Kq:Gq;return r.lastIndex=0,e.replace(r,(o)=>Hq[o])}function Nw(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let o=0;o<e.length;o++){if(e[o]==="%"&&o+2<e.length){let n=e.slice(o+1,o+3);if(Sn(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));if(t&&gh(i))r+=i;else r+="%"+s;o+=2;continue}}r+=e[o]}return r}function Jq(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if(o==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Sn(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));if(i!=="."&&gh(i))t+=i;else t+="%"+s;r+=2;continue}}if(Ow(o))t+=o;else{let n=e.charCodeAt(r);if(n<128)t+=Aw(n)?o:Lt[n];else if(n<55296||n>57343)t+=It(n);else if(n<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=It(65536+(n-55296<<10)+(s-56320)),r++;else t+=It(65533)}else t+=It(65533)}}return t}function Bq(e,t=!1){let r="",o=t&&e[0]!=="/";for(let n=0;n<e.length;n++){let s=e[n];if(s==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Sn(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(s==="/")o=!1;if(Ow(s)&&(s!==":"||!o))r+=s;else{let i=e.charCodeAt(n);if(i<128)r+=Lt[i];else if(i<55296||i>57343)r+=It(i);else if(i<=56319&&n+1<e.length){let a=e.charCodeAt(n+1);if(a>=56320&&a<=57343)r+=It(65536+(i-55296<<10)+(a-56320)),n++;else r+=It(65533)}else r+=It(65533)}}return r}function yh(e,t){let r="";for(let o=0;o<e.length;o++){let n=e[o];if(n==="%"&&o+2<e.length){let s=e.slice(o+1,o+3);if(Sn(s)){r+="%"+s.toUpperCase(),o+=2;continue}}if(t(n))r+=n;else{let s=e.charCodeAt(o);if(s<128)r+=Lt[s];else if(s<55296||s>57343)r+=It(s);else if(s<=56319&&o+1<e.length){let i=e.charCodeAt(o+1);if(i>=56320&&i<=57343)r+=It(65536+(s-55296<<10)+(i-56320)),o++;else r+=It(65533)}else r+=It(65533)}}return r}function xw(e){return yh(e,Aq)}function Wq(e){return yh(e,_h)}function Yq(e){return yh(e,_h)}function Aw(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Xq(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];if(o==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Sn(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));if(gh(i))t+=i;else t+="%"+s;r+=2;continue}}if(_h(o))t+=o;else{let n=e.charCodeAt(r);if(n<128)t+=Aw(n)?o:Lt[n];else if(n<55296||n>57343)t+=It(n);else if(n<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=It(65536+(n-55296<<10)+(s-56320)),r++;else t+=It(65533)}else t+=It(65533)}}return t}function Qq(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(Sn(o)){t+="%"+o.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function eM(e){let t=[];if(e.userinfo!==void 0)t.push(xw(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!hh(r)){let o=mh(r);if(o.isIPV6!==!0&&o.isIPVFuture!==!0)r=Nw(r,!0),o=mh(r);if(o.isIPV6===!0||o.isIPVFuture===!0)r=`[${o.escapedHost}]`;else r=Cw(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!xq(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}jw.exports={nonSimpleDomain:Dq,recomposeAuthority:eM,reescapeHostDelimiters:Cw,normalizePercentEncoding:Nw,normalizePathEncoding:Jq,serializePathEncoding:Bq,normalizeQueryFragmentEncoding:Xq,encodeUserinfo:xw,encodeQuery:Wq,encodeFragment:Yq,escapePreservingEscapes:Qq,removeDotSegments:Zq,isIPv4:hh,isUUID:Nq,normalizeIPv6:mh,stringArrayToHexStripped:jq}});var Uw=L(function(mJ,Dw){var{isUUID:tM}=vh(),rM=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,oM=["http","https","ws","wss","urn","urn:uuid"];function nM(e){return oM.indexOf(e)!==-1}function Sh(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 qw(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Mw(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 sM(e){return e.secure=Sh(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function iM(e){if(e.port===(Sh(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=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function aM(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(rM);if(r&&r[0]===e.path){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${o}:${t.nid||e.nid}`,s=bh(n);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function cM(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),n=`${r}:${t.nid||o}`,s=bh(n);if(s)e=s.serialize(e,t);let i=e,a=e.nss;return i.path=`${o||t.nid}:${a}`,t.skipEscape=!0,i}function uM(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!tM(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function lM(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Lw={scheme:"http",domainHost:!0,parse:qw,serialize:Mw},dM={scheme:"https",domainHost:Lw.domainHost,parse:qw,serialize:Mw},td={scheme:"ws",domainHost:!0,parse:sM,serialize:iM},pM={scheme:"wss",domainHost:td.domainHost,parse:td.parse,serialize:td.serialize},fM={scheme:"urn",parse:aM,serialize:cM,skipNormalize:!0},mM={scheme:"urn:uuid",parse:uM,serialize:lM,skipNormalize:!0},rd={http:Lw,https:dM,ws:td,wss:pM,urn:fM,"urn:uuid":mM};Object.setPrototypeOf(rd,null);function bh(e){return e&&(rd[e]||rd[e.toLowerCase()])||void 0}Dw.exports={wsIsSecure:Sh,SCHEMES:rd,isValidSchemeName:nM,getSchemeHandler:bh}});var Qw=L(function(hJ,sd){var{normalizeIPv6:Gw,removeDotSegments:va,recomposeAuthority:hM,normalizePercentEncoding:$h,normalizePathEncoding:gM,serializePathEncoding:Fw,normalizeQueryFragmentEncoding:Vw,encodeQuery:_M,encodeFragment:yM,reescapeHostDelimiters:vM,isIPv4:Kw,nonSimpleDomain:SM}=vh(),{SCHEMES:Jw,getSchemeHandler:wh}=Uw(),Bw=/^[A-Za-z][A-Za-z0-9+.-]*$/u;function Zw(e){let t=unescape(String(e));if(!Bw.test(t))throw TypeError("URI scheme is malformed.");return t}function bM(e,t){if(typeof e==="string")e=IM(e,t);else if(typeof e==="object")e=nd(bn(e,t),t);return e}function $M(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=od(e,o),{parsed:l,malformedAuthorityOrPort:d,malformedPercentEncoding:f,malformedSchemeSpecific:h,malformedHost:_,malformedScheme:g}=od(t,o);if(s||d||i||f||a||h||c||_||u||g)throw Error(n.error||l.error||"URI is malformed.");let y=Ww(n,l,o,!0),m=wh(r&&r.scheme||y.scheme),S=y.host,v=S!==void 0&&S!==""&&(Kw(S)||Gw(S).isIPV6);Yw(y,r||{},m,v);let w=S&&S.indexOf("%")!==-1&&!/\P{ASCII}/u.test(S);if(y.error&&!w)throw Error(y.error);return o.skipEscape=!0,bn(y,o)}function Ww(e,t,r,o){let n={};if(!o)e=nd(bn(e,r),r),t=nd(bn(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=va(t.path||""),n.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=va(t.path||""),n.query=t.query;else{if(!t.path)if(n.path=e.path,t.query!==void 0)n.query=t.query;else n.query=e.query;else{if(t.path[0]==="/")n.path=va(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)n.path="/"+t.path;else if(!e.path)n.path=t.path;else n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;n.path=va(n.path)}n.query=t.query}n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function wM(e,t,r){let o=Hw(e,r),n=Hw(t,r);return o!==void 0&&n!==void 0&&o===n}function bn(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:""},o=Object.assign({},t),n=[];if(r.scheme)r.scheme=Zw(r.scheme);let s=wh(o.scheme||r.scheme);if(s&&s.serialize)s.serialize(r,o);let i=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!o.skipEscape&&r.scheme===void 0&&!i;if(r.path!==void 0)if(!o.skipEscape)r.path=Fw(r.path,a);else r.path=$h(r.path);if(o.reference!=="suffix"&&r.scheme)r.scheme=Zw(r.scheme),n.push(r.scheme,":");let c=hM(r);if(c!==void 0){if(o.reference!=="suffix")n.push("//");if(n.push(c),r.path&&r.path[0]!=="/")n.push("/")}if(r.path!==void 0){let u=r.path;if(!o.absolutePath&&(!s||!s.absolutePath))u=va(u);if(a)u=Fw(u,!0);if(c===void 0&&u[0]==="/"&&u[1]==="/")u="/%2F"+u.slice(2);n.push(u)}if(r.query!==void 0)n.push("?",_M(r.query));if(r.fragment!==void 0)n.push("#",yM(r.fragment));return n.join("")}var RM=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,EM=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,zM=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function PM(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function ya(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Rh(e){return e[0]==="["&&e[e.length-1]==="]"}function TM(e){let t=e[4];return ya(e[3])||t!==void 0&&!Rh(t)&&ya(t)||ya(e[6])||ya(e[7])||ya(e[8])}function Yw(e,t,r,o){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Rh(e.host)&&(t.domainHost||r&&r.domainHost)&&o===!1&&SM(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(n){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+n,!0}return!1}function od(e,t){let r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,s=!1,i=!1,a=!1,c=!1,u=!1,l=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let d=e.match(EM);if(d!==null&&d[1].indexOf("\\")!==-1)o.error="URI authority must not contain a literal backslash.",n=!0;let f=e.match(zM);if(f!==null){let _=f[1],g=_.replace(/[\t\n\r]/g,"");if(g.length>=2){if(g.slice(0,2)!=="//")o.error=o.error||"URI authority must not contain a literal backslash.",n=!0;else if(_.length!==g.length)o.error=o.error||"URI authority introducer must not contain whitespace.",n=!0}}let h=e.match(RM);if(h){if(o.scheme=h[1],o.userinfo=h[3],o.host=h[4],o.port=parseInt(h[5],10),o.path=h[6]||"",o.query=h[7],o.fragment=h[8],o.scheme!==void 0){let y=unescape(o.scheme);if(Bw.test(y))o.scheme=y.toLowerCase();else o.error=o.error||"URI scheme is malformed.",u=!0}if(s=TM(h),s)o.error=o.error||"URI contains malformed percent-encoding.";if(isNaN(o.port))o.port=h[5];let _=PM(o,h);if(_!==void 0)o.error=o.error||_,n=!0;if(o.host)if(Kw(o.host)===!1){let m=Rh(o.host),S=o.host.indexOf("[")!==-1||o.host.indexOf("]")!==-1,v=Gw(o.host);if(l=v.isIPV6||v.isIPVFuture===!0,c=S&&(!m||v.error===!0),o.host=l?v.host:v.host.toLowerCase(),c)o.error=o.error||"URI host is malformed.",n=!0}else l=!0;if(o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path)o.reference="same-document";else if(o.scheme===void 0)o.reference="relative";else if(o.fragment===void 0)o.reference="absolute";else o.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==o.reference)o.error=o.error||"URI is not a "+r.reference+" reference.";let g=wh(r.scheme||o.scheme);if(!c)a=Yw(o,r,g,l);if(e.indexOf("%")!==-1&&o.host!==void 0&&!c){let y=l?o.host:$h(o.host,!0);if(!l)y=$h(y.toLowerCase());o.host=vM(y,l)}if(!g||g&&!g.skipNormalize){if(o.path)o.path=gM(o.path);if(o.query)o.query=Vw(o.query);if(o.fragment)o.fragment=Vw(o.fragment)}if(g&&g.parse){if(g.parse(o,r),g===Jw.urn&&o.nid===void 0)i=!0}}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:u}}function nd(e,t){return od(e,t).parsed}function IM(e,t){return Xw(e,t).normalized}function Xw(e,t){let{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:n,malformedSchemeSpecific:s,malformedHost:i,malformedScheme:a}=od(e,t);return{normalized:o||n||s||i||a?e:bn(r,t),malformedAuthorityOrPort:o,malformedPercentEncoding:n,malformedSchemeSpecific:s,malformedHost:i,malformedScheme:a}}function Hw(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:bn(e,t)}catch{return}let{normalized:o,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=Xw(r,t);return n||s||i||a||c?void 0:o}var Eh={SCHEMES:Jw,normalize:bM,resolve:$M,resolveComponent:Ww,equal:wM,serialize:bn,parse:nd};sd.exports=Eh;sd.exports.default=Eh;sd.exports.fastUri=Eh});var rR=L(function(tR){Object.defineProperty(tR,"__esModule",{value:!0});var eR=Qw();eR.code='require("ajv/dist/runtime/uri").default';tR.default=eR});var Ph=L(function(Kr){Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CodeGen=Kr.Name=Kr.nil=Kr.stringify=Kr.str=Kr._=Kr.KeywordCxt=void 0;var OM=gs();Object.defineProperty(Kr,"KeywordCxt",{enumerable:!0,get:function(){return OM.KeywordCxt}});var Ss=be();Object.defineProperty(Kr,"_",{enumerable:!0,get:function(){return Ss._}});Object.defineProperty(Kr,"str",{enumerable:!0,get:function(){return Ss.str}});Object.defineProperty(Kr,"stringify",{enumerable:!0,get:function(){return Ss.stringify}});Object.defineProperty(Kr,"nil",{enumerable:!0,get:function(){return Ss.nil}});Object.defineProperty(Kr,"Name",{enumerable:!0,get:function(){return Ss.Name}});Object.defineProperty(Kr,"CodeGen",{enumerable:!0,get:function(){return Ss.CodeGen}});var CM=ha(),aR=ys(),cR=th(),zr=_a(),uR=be(),Pr=ma(),Po=fa(),vs=Te(),oR=Iw(),NM=rR(),lR=(e,t)=>new RegExp(e,t);lR.code="new RegExp";var xM=["removeAdditional","useDefaults","coerceTypes"],AM=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jM={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."},qM={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},nR=200;function MM(e){var t,r,o,n,s,i,a,c,u,l,d,f,h,_,g,y,m,S,v,w,P,R,b,E,C;let D=e.strict,N=(t=e.code)===null||t===void 0?void 0:t.optimize,F=N===!0||N===void 0?1:N||0,Y=(o=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:lR,X=(n=e.uriResolver)!==null&&n!==void 0?n:NM.default;return{strictSchema:(i=(s=e.strictSchema)!==null&&s!==void 0?s:D)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:D)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:D)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:D)!==null&&f!==void 0?f:"log",strictRequired:(_=(h=e.strictRequired)!==null&&h!==void 0?h:D)!==null&&_!==void 0?_:!1,code:e.code?{...e.code,optimize:F,regExp:Y}:{optimize:F,regExp:Y},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:nR,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:nR,meta:(m=e.meta)!==null&&m!==void 0?m:!0,messages:(S=e.messages)!==null&&S!==void 0?S:!0,inlineRefs:(v=e.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(w=e.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(R=e.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(b=e.validateFormats)!==null&&b!==void 0?b:!0,unicodeRegExp:(E=e.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(C=e.int32range)!==null&&C!==void 0?C:!0,uriResolver:X}}class id{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...MM(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new uR.ValueScope({scope:{},prefixes:AM,es5:t,lines:r}),this.logger=ZM(e.logger);let o=e.validateFormats;if(e.validateFormats=!1,this.RULES=cR.getRules(),sR.call(this,jM,e,"NOT SUPPORTED"),sR.call(this,qM,e,"DEPRECATED","warn"),this._metaOpts=FM.call(this),e.formats)DM.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)UM.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);LM.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,o=oR;if(r==="id")o={...oR},o.id=o.$id,delete o.$id;if(t&&e)this.addMetaSchema(o,o[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 o=r(t);if(!("$async"in r))this.errors=r.errors;return o}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 o.call(this,e,t);async function o(u,l){await n.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||s.call(this,d)}async function n(u){if(u&&!this.getSchema(u))await o.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof aR.default))throw l;return i.call(this,l),await a.call(this,l.missingSchema),s.call(this,u)}}function i({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function a(u){let l=await c.call(this,u);if(!this.refs[u])await n.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,o=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,r,o);return this}let n;if(typeof e==="object"){let{schemaId:s}=this.opts;if(n=e[s],n!==void 0&&typeof n!="string")throw Error(`schema ${s} must be string`)}return t=Pr.normalizeId(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!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 o=this.validate(r,e);if(!o&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw Error(n)}return o}getSchema(e){let t;while(typeof(t=iR.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,o=new zr.SchemaEnv({schema:{},schemaId:r});if(t=zr.resolveSchema.call(this,o,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=iR.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=Pr.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(GM.call(this,r,t),!t)return vs.eachItem(r,(n)=>zh.call(this,n)),this;JM.call(this,t);let o={...t,type:Po.getJSONTypes(t.type),schemaType:Po.getJSONTypes(t.schemaType)};return vs.eachItem(r,o.type.length===0?(n)=>zh.call(this,n,o):(n)=>o.type.forEach((s)=>zh.call(this,n,o,s))),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 o=r.rules.findIndex((n)=>n.keyword===e);if(o>=0)r.rules.splice(o,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((o)=>`${r}${o.instancePath} ${o.message}`).reduce((o,n)=>o+t+n)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of t){let n=o.split("/").slice(1),s=e;for(let i of n)s=s[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=s[i];if(c&&u)s[i]=dR(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let o=e[r];if(!t||t.test(r)){if(typeof o=="string")delete e[r];else if(o&&!o.meta)this._cache.delete(o.schema),delete e[r]}}}_addSchema(e,t,r,o=this.opts.validateSchema,n=this.opts.addUsedSchema){let s,{schemaId:i}=this.opts;if(typeof e=="object")s=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=Pr.normalizeId(s||r);let c=Pr.getSchemaRefs.call(this,e,r);if(a=new zr.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),n&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(o)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 zr.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{zr.compileSchema.call(this,e)}finally{this.opts=t}}}id.ValidationError=CM.default;id.MissingRefError=aR.default;Kr.default=id;function sR(e,t,r,o="error"){for(let n in e){let s=n;if(s in t)this.logger[o](`${r}: option ${n}. ${e[s]}`)}}function iR(e){return e=Pr.normalizeId(e),this.schemas[e]||this.refs[e]}function LM(){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 DM(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function UM(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 FM(){let e={...this.opts};for(let t of xM)delete e[t];return e}var VM={log(){},warn(){},error(){}};function ZM(e){if(e===!1)return VM;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 HM=/^[a-z_$][a-z0-9_$:-]*$/i;function GM(e,t){let{RULES:r}=this;if(vs.eachItem(e,(o)=>{if(r.keywords[o])throw Error(`Keyword ${o} is already defined`);if(!HM.test(o))throw Error(`Keyword ${o} 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 zh(e,t,r){var o;let n=t===null||t===void 0?void 0:t.post;if(r&&n)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=n?s.post:s.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},s.rules.push(i);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Po.getJSONTypes(t.type),schemaType:Po.getJSONTypes(t.schemaType)}};if(t.before)KM.call(this,i,a,t.before);else i.rules.push(a);s.all[e]=a,(o=t.implements)===null||o===void 0||o.forEach((c)=>this.addKeyword(c))}function KM(e,t,r){let o=e.rules.findIndex((n)=>n.keyword===r);if(o>=0)e.rules.splice(o,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function JM(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=dR(t);e.validateSchema=this.compile(t,!0)}var BM={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dR(e){return{anyOf:[e,BM]}}});var fR=L(function(pR){Object.defineProperty(pR,"__esModule",{value:!0});var XM={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};pR.default=XM});var ld=L(function(hR){Object.defineProperty(hR,"__esModule",{value:!0});hR.callRef=hR.getValidate=void 0;var eL=ys(),cd=rr(),qe=be(),bs=er(),ud=_a(),To=Te(),tL={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:o}=e,{baseId:n,schemaEnv:s,validateName:i,opts:a,self:c}=o,{root:u}=s;if((r==="#"||r==="#/")&&n===u.baseId)return d();let l=ud.resolveRef.call(c,u,n,r);if(l===void 0)throw new eL.default(o.opts.uriResolver,n,r);if(l instanceof ud.SchemaEnv)return f(l);return h(l);function d(){if(s===u)return ad(e,i,s,s.$async);let _=t.scopeValue("root",{ref:u});return ad(e,qe._`${_}.validate`,u,u.$async)}function f(_){let g=mR(e,_);ad(e,g,_,_.$async)}function h(_){let g=t.scopeValue("schema",a.code.source===!0?{ref:_,code:qe.stringify(_)}:{ref:_}),y=t.name("valid"),m=e.subschema({schema:_,dataTypes:[],schemaPath:qe.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(m),e.ok(y)}}};function mR(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):qe._`${r.scopeValue("wrapper",{ref:t})}.validate`}hR.getValidate=mR;function ad(e,t,r,o){let{gen:n,it:s}=e,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?bs.default.this:qe.nil;if(o)l();else d();function l(){if(!a.$async)throw Error("async schema referenced by sync schema");let _=n.let("valid");n.try(()=>{if(n.code(qe._`await ${cd.callValidateCode(e,t,u)}`),h(t),!i)n.assign(_,!0)},(g)=>{if(n.if(qe._`!(${g} instanceof ${s.ValidationError})`,()=>n.throw(g)),f(g),!i)n.assign(_,!1)}),e.ok(_)}function d(){e.result(cd.callValidateCode(e,t,u),()=>h(t),()=>f(t))}function f(_){let g=qe._`${_}.errors`;n.assign(bs.default.vErrors,qe._`${bs.default.vErrors} === null ? ${g} : ${bs.default.vErrors}.concat(${g})`),n.assign(bs.default.errors,qe._`${bs.default.vErrors}.length`)}function h(_){var g;if(!s.opts.unevaluated)return;let y=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)s.props=To.mergeEvaluated.props(n,y.props,s.props)}else{let m=n.var("props",qe._`${_}.evaluated.props`);s.props=To.mergeEvaluated.props(n,m,s.props,qe.Name)}if(s.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)s.items=To.mergeEvaluated.items(n,y.items,s.items)}else{let m=n.var("items",qe._`${_}.evaluated.items`);s.items=To.mergeEvaluated.items(n,m,s.items,qe.Name)}}}hR.callRef=ad;hR.default=tL});var Th=L(function(_R){Object.defineProperty(_R,"__esModule",{value:!0});var nL=fR(),sL=ld(),iL=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",nL.default,sL.default];_R.default=iL});var vR=L(function(yR){Object.defineProperty(yR,"__esModule",{value:!0});var ko=be(),Io=ko.operators,dd={maximum:{okStr:"<=",ok:Io.LTE,fail:Io.GT},minimum:{okStr:">=",ok:Io.GTE,fail:Io.LT},exclusiveMaximum:{okStr:"<",ok:Io.LT,fail:Io.GTE},exclusiveMinimum:{okStr:">",ok:Io.GT,fail:Io.LTE}},cL={message:({keyword:e,schemaCode:t})=>ko.str`must be ${dd[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>ko._`{comparison: ${dd[e].okStr}, limit: ${t}}`},uL={keyword:Object.keys(dd),type:"number",schemaType:"number",$data:!0,error:cL,code(e){let{keyword:t,data:r,schemaCode:o}=e;e.fail$data(ko._`${r} ${dd[t].fail} ${o} || isNaN(${r})`)}};yR.default=uL});var bR=L(function(SR){Object.defineProperty(SR,"__esModule",{value:!0});var Tr=be(),dL={message:({schemaCode:e})=>Tr.str`must be multiple of ${e}`,params:({schemaCode:e})=>Tr._`{multipleOf: ${e}}`},pL={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dL,code(e){let{gen:t,data:r,schemaCode:o,it:n}=e,s=n.opts.multipleOfPrecision,i=t.let("res"),a=s?Tr._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:Tr._`${i} !== parseInt(${i})`;e.fail$data(Tr._`(${o} === 0 || (${i} = ${r}/${o}, ${a}))`)}};SR.default=pL});var RR=L(function(wR){Object.defineProperty(wR,"__esModule",{value:!0});function $R(e){let t=e.length,r=0,o=0,n;while(o<t)if(r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t){if(n=e.charCodeAt(o),(n&64512)===56320)o++}return r}wR.default=$R;$R.code='require("ajv/dist/runtime/ucs2length").default'});var PR=L(function(zR){Object.defineProperty(zR,"__esModule",{value:!0});var Dt=be(),ER=Te(),hL=RR(),gL={message({keyword:e,schemaCode:t}){return Dt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>Dt._`{limit: ${e}}`},_L={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gL,code(e){let{keyword:t,data:r,schemaCode:o,it:n}=e,s=t==="maxLength"?Dt.operators.GT:Dt.operators.LT,i=n.opts.unicode===!1?Dt._`${r}.length`:Dt._`${ER.useFunc(e.gen,hL.default)}(${r})`;e.fail$data(Dt._`${i} ${s} ${o}`)}};zR.default=_L});var OR=L(function(kR){Object.defineProperty(kR,"__esModule",{value:!0});var TR=rr(),IR=Te(),or=be(),vL={message:({schemaCode:e})=>or.str`must match pattern "${e}"`,params:({schemaCode:e})=>or._`{pattern: ${e}}`},SL={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:vL,code(e){let{gen:t,data:r,$data:o,schema:n,schemaCode:s,it:i}=e,a=i.opts.unicodeRegExp?"u":"";if(o){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?or._`new RegExp`:IR.useFunc(t,c),l=t.let("valid");t.try(()=>t.assign(l,or._`${u}(${s}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data(or._`!${l}`)}else{let c=TR.usePattern(e,n);e.fail$data(or._`!${c}.test(${r})`)}}};kR.default=SL});var NR=L(function(CR){Object.defineProperty(CR,"__esModule",{value:!0});var Ir=be(),$L={message({keyword:e,schemaCode:t}){return Ir.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Ir._`{limit: ${e}}`},wL={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:$L,code(e){let{keyword:t,data:r,schemaCode:o}=e,n=t==="maxProperties"?Ir.operators.GT:Ir.operators.LT;e.fail$data(Ir._`Object.keys(${r}).length ${n} ${o}`)}};CR.default=wL});var jR=L(function(AR){Object.defineProperty(AR,"__esModule",{value:!0});var kr=rr(),Or=be(),xR=Te(),EL={message:({params:{missingProperty:e}})=>Or.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Or._`{missingProperty: ${e}}`},zL={keyword:"required",type:"object",schemaType:"array",$data:!0,error:EL,code(e){let{gen:t,schema:r,schemaCode:o,data:n,$data:s,it:i}=e,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else l();if(a.strictRequired){let h=e.parentSchema.properties,{definedProperties:_}=e.it;for(let g of r)if((h===null||h===void 0?void 0:h[g])===void 0&&!_.has(g)){let y=i.schemaEnv.baseId+i.errSchemaPath,m=`required property "${g}" is not defined at "${y}" (strictRequired)`;xR.checkStrictMode(i,m,i.opts.strictRequired)}}function u(){if(c||s)e.block$data(Or.nil,d);else for(let h of r)kr.checkReportMissingProp(e,h)}function l(){let h=t.let("missing");if(c||s){let _=t.let("valid",!0);e.block$data(_,()=>f(h,_)),e.ok(_)}else t.if(kr.checkMissingProp(e,r,h)),kr.reportMissingProp(e,h),t.else()}function d(){t.forOf("prop",o,(h)=>{e.setParams({missingProperty:h}),t.if(kr.noPropertyInData(t,n,h,a.ownProperties),()=>e.error())})}function f(h,_){e.setParams({missingProperty:h}),t.forOf(h,o,()=>{t.assign(_,kr.propertyInData(t,n,h,a.ownProperties)),t.if(Or.not(_),()=>{e.error(),t.break()})},Or.nil)}}};AR.default=zL});var MR=L(function(qR){Object.defineProperty(qR,"__esModule",{value:!0});var Cr=be(),TL={message({keyword:e,schemaCode:t}){return Cr.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Cr._`{limit: ${e}}`},IL={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:TL,code(e){let{keyword:t,data:r,schemaCode:o}=e,n=t==="maxItems"?Cr.operators.GT:Cr.operators.LT;e.fail$data(Cr._`${r}.length ${n} ${o}`)}};qR.default=IL});var pd=L(function(DR){Object.defineProperty(DR,"__esModule",{value:!0});var LR=ch();LR.code='require("ajv/dist/runtime/equal").default';DR.default=LR});var VR=L(function(FR){Object.defineProperty(FR,"__esModule",{value:!0});var $s=fa(),Ce=be(),UR=Te(),CL=pd(),NL={message:({params:{i:e,j:t}})=>Ce.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Ce._`{i: ${e}, j: ${t}}`},xL={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:NL,code(e){let{gen:t,data:r,$data:o,schema:n,parentSchema:s,schemaCode:i,it:a}=e;if(!o&&!n)return;let c=t.let("valid"),u=s.items?$s.getSchemaTypes(s.items):[];e.block$data(c,l,Ce._`${i} === false`),e.ok(c);function l(){let _=t.let("i",Ce._`${r}.length`),g=t.let("j");e.setParams({i:_,j:g}),t.assign(c,!0),t.if(Ce._`${_} > 1`,()=>(d()?f:h)(_,g))}function d(){return u.length>0&&!u.some((_)=>_==="object"||_==="array")}function f(_,g){let y=t.name("item"),m=$s.checkDataTypes(u,y,a.opts.strictNumbers,$s.DataType.Wrong),S=t.const("indices",Ce._`{}`);t.for(Ce._`;${_}--;`,()=>{if(t.let(y,Ce._`${r}[${_}]`),t.if(m,Ce._`continue`),u.length>1)t.if(Ce._`typeof ${y} == "string"`,Ce._`${y} += "_"`);t.if(Ce._`typeof ${S}[${y}] == "number"`,()=>{t.assign(g,Ce._`${S}[${y}]`),e.error(),t.assign(c,!1).break()}).code(Ce._`${S}[${y}] = ${_}`)})}function h(_,g){let y=UR.useFunc(t,CL.default),m=t.name("outer");t.label(m).for(Ce._`;${_}--;`,()=>t.for(Ce._`${g} = ${_}; ${g}--;`,()=>t.if(Ce._`${y}(${r}[${_}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(m)})))}}};FR.default=xL});var GR=L(function(HR){Object.defineProperty(HR,"__esModule",{value:!0});var ws=be(),ZR=Te(),jL=pd(),qL={message:"must be equal to constant",params:({schemaCode:e})=>ws._`{allowedValue: ${e}}`},ML={keyword:"const",$data:!0,error:qL,code(e){let{gen:t,data:r,$data:o,schemaCode:n,schema:s}=e;if(o||s&&typeof s=="object")e.fail$data(ws._`!${ZR.useFunc(t,jL.default)}(${r}, ${n})`);else e.fail(ws._`${s} !== ${r}`)}};HR.default=ML});var BR=L(function(JR){Object.defineProperty(JR,"__esModule",{value:!0});var Nr=be(),KR=Te(),DL=pd(),UL={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Nr._`{allowedValues: ${e}}`},FL={keyword:"enum",schemaType:"array",$data:!0,error:UL,code(e){let{gen:t,data:r,$data:o,schema:n,schemaCode:s,it:i}=e;if(!o&&n.length===0)throw Error("enum must have non-empty array");let a=n.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=KR.useFunc(t,DL.default),l;if(a||o)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(n))throw Error("ajv implementation error");let h=t.const("vSchema",s);l=Nr.or(...n.map((_,g)=>f(h,g)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",s,(h)=>t.if(Nr._`${u()}(${r}, ${h})`,()=>t.assign(l,!0).break()))}function f(h,_){let g=n[_];return typeof g==="object"&&g!==null?Nr._`${u()}(${r}, ${h}[${_}])`:Nr._`${r} === ${g}`}}};JR.default=FL});var Ih=L(function(WR){Object.defineProperty(WR,"__esModule",{value:!0});var ZL=vR(),HL=bR(),GL=PR(),KL=OR(),JL=NR(),BL=jR(),WL=MR(),YL=VR(),XL=GR(),QL=BR(),e2=[ZL.default,HL.default,GL.default,KL.default,JL.default,BL.default,WL.default,YL.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},XL.default,QL.default];WR.default=e2});var kh=L(function(XR){Object.defineProperty(XR,"__esModule",{value:!0});XR.validateAdditionalItems=void 0;var Ut=be(),Rs=Te(),r2={message:({params:{len:e}})=>Ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ut._`{limit: ${e}}`},o2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:r2,code(e){let{parentSchema:t,it:r}=e,{items:o}=t;if(!Array.isArray(o)){Rs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}YR(e,o)}};function YR(e,t){let{gen:r,schema:o,data:n,keyword:s,it:i}=e;i.items=!0;let a=r.const("len",Ut._`${n}.length`);if(o===!1)e.setParams({len:t.length}),e.pass(Ut._`${a} <= ${t.length}`);else if(typeof o=="object"&&!Rs.alwaysValidSchema(i,o)){let u=r.var("valid",Ut._`${a} <= ${t.length}`);r.if(Ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(l)=>{if(e.subschema({keyword:s,dataProp:l,dataPropType:Rs.Type.Num},u),!i.allErrors)r.if(Ut.not(u),()=>r.break())})}}XR.validateAdditionalItems=YR;XR.default=o2});var Oh=L(function(rE){Object.defineProperty(rE,"__esModule",{value:!0});rE.validateTuple=void 0;var fd=be(),Oo=Te(),eE=rr(),s2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return tE(e,"additionalItems",t);if(r.items=!0,Oo.alwaysValidSchema(r,t))return;e.ok(eE.validateArray(e))}};function tE(e,t,r=e.schema){let{gen:o,parentSchema:n,data:s,keyword:i,it:a}=e;if(l(n),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Oo.mergeEvaluated.items(o,r.length,a.items);let c=o.name("valid"),u=o.const("len",fd._`${s}.length`);r.forEach((d,f)=>{if(Oo.alwaysValidSchema(a,d))return;o.if(fd._`${u} > ${f}`,()=>e.subschema({keyword:i,schemaProp:f,dataProp:f},c)),e.ok(c)});function l(d){let{opts:f,errSchemaPath:h}=a,_=r.length,g=_===d.minItems&&(_===d.maxItems||d[t]===!1);if(f.strictTuples&&!g){let y=`"${i}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;Oo.checkStrictMode(a,y,f.strictTuples)}}}rE.validateTuple=tE;rE.default=s2});var iE=L(function(sE){Object.defineProperty(sE,"__esModule",{value:!0});var nE=Oh(),a2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>nE.validateTuple(e,"items")};sE.default=a2});var dE=L(function(lE){Object.defineProperty(lE,"__esModule",{value:!0});var md=be(),aE=Te(),cE=rr(),uE=kh(),u2={message:({params:{len:e}})=>md.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>md._`{limit: ${e}}`},l2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:u2,code(e){let{schema:t,parentSchema:r,it:o}=e,{prefixItems:n}=r;if(o.items=!0,aE.alwaysValidSchema(o,t))return;if(n)uE.validateAdditionalItems(e,n);else e.ok(cE.validateArray(e))}};lE.default=l2});var fE=L(function(pE){Object.defineProperty(pE,"__esModule",{value:!0});var Ke=be(),Co=Te(),p2={message:({params:{min:e,max:t}})=>t===void 0?Ke.str`must contain at least ${e} valid item(s)`:Ke.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Ke._`{minContains: ${e}}`:Ke._`{minContains: ${e}, maxContains: ${t}}`},f2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:p2,code(e){let{gen:t,schema:r,parentSchema:o,data:n,it:s}=e,i,a,{minContains:c,maxContains:u}=o;if(s.opts.next)i=c===void 0?1:c,a=u;else i=1;let l=t.const("len",Ke._`${n}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){Co.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Co.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Co.alwaysValidSchema(s,r)){let g=Ke._`${l} >= ${i}`;if(a!==void 0)g=Ke._`${g} && ${l} <= ${a}`;e.pass(g);return}s.items=!0;let d=t.name("valid");if(a===void 0&&i===1)h(d,()=>t.if(d,()=>t.break()));else if(i===0){if(t.let(d,!0),a!==void 0)t.if(Ke._`${n}.length > 0`,f)}else t.let(d,!1),f();e.result(d,()=>e.reset());function f(){let g=t.name("_valid"),y=t.let("count",0);h(g,()=>t.if(g,()=>_(y)))}function h(g,y){t.forRange("i",0,l,(m)=>{e.subschema({keyword:"contains",dataProp:m,dataPropType:Co.Type.Num,compositeRule:!0},g),y()})}function _(g){if(t.code(Ke._`${g}++`),a===void 0)t.if(Ke._`${g} >= ${i}`,()=>t.assign(d,!0).break());else if(t.if(Ke._`${g} > ${a}`,()=>t.assign(d,!1).break()),i===1)t.assign(d,!0);else t.if(Ke._`${g} >= ${i}`,()=>t.assign(d,!0))}}};pE.default=f2});var hd=L(function(_E){Object.defineProperty(_E,"__esModule",{value:!0});_E.validateSchemaDeps=_E.validatePropertyDeps=_E.error=void 0;var Es=be(),mE=Te(),xr=rr();_E.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:o}})=>Es._`{property: ${e},
7
+ missingProperty: ${o},
8
+ depsCount: ${t},
9
+ deps: ${r}}`};var h2={keyword:"dependencies",type:"object",schemaType:"object",error:_E.error,code(e){let[t,r]=g2(e);hE(e,t),gE(e,r)}};function g2({schema:e}){let t={},r={};for(let o in e){if(o==="__proto__")continue;let n=Array.isArray(e[o])?t:r;n[o]=e[o]}return[t,r]}function hE(e,t=e.schema){let{gen:r,data:o,it:n}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=xr.propertyInData(r,o,i,n.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),n.allErrors)r.if(c,()=>{for(let u of a)xr.checkReportMissingProp(e,u)});else r.if(Es._`${c} && (${xr.checkMissingProp(e,a,s)})`),xr.reportMissingProp(e,s),r.else()}}_E.validatePropertyDeps=hE;function gE(e,t=e.schema){let{gen:r,data:o,keyword:n,it:s}=e,i=r.name("valid");for(let a in t){if(mE.alwaysValidSchema(s,t[a]))continue;r.if(xr.propertyInData(r,o,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:n,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}_E.validateSchemaDeps=gE;_E.default=h2});var $E=L(function(bE){Object.defineProperty(bE,"__esModule",{value:!0});var gd=be(),SE=Te(),v2={message:"property name must be valid",params:({params:e})=>gd._`{propertyName: ${e.propertyName}}`},S2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:v2,code(e){let{gen:t,schema:r,data:o,it:n}=e;if(SE.alwaysValidSchema(n,r))return;let s=t.name("valid");t.forIn("key",o,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if(gd.not(s),()=>{if(e.error(!0),!n.allErrors)t.break()})}),e.ok(s)}};bE.default=S2});var Ch=L(function(wE){Object.defineProperty(wE,"__esModule",{value:!0});var No=rr(),ot=be(),$2=er(),xo=Te(),w2={message:"must NOT have additional properties",params:({params:e})=>ot._`{additionalProperty: ${e.additionalProperty}}`},R2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:w2,code(e){let{gen:t,schema:r,parentSchema:o,data:n,errsCount:s,it:i}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&xo.alwaysValidSchema(i,r))return;let u=No.allSchemaProperties(o.properties),l=No.allSchemaProperties(o.patternProperties);d(),e.ok(ot._`${s} === ${$2.default.errors}`);function d(){t.forIn("key",n,(y)=>{if(!u.length&&!l.length)_(y);else t.if(f(y),()=>_(y))})}function f(y){let m;if(u.length>8){let S=xo.schemaRefOrVal(i,o.properties,"properties");m=No.isOwnProperty(t,S,y)}else if(u.length)m=ot.or(...u.map((S)=>ot._`${y} === ${S}`));else m=ot.nil;if(l.length)m=ot.or(m,...l.map((S)=>ot._`${No.usePattern(e,S)}.test(${y})`));return ot.not(m)}function h(y){t.code(ot._`delete ${n}[${y}]`)}function _(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!xo.alwaysValidSchema(i,r)){let m=t.name("valid");if(c.removeAdditional==="failing")g(y,m,!1),t.if(ot.not(m),()=>{e.reset(),h(y)});else if(g(y,m),!a)t.if(ot.not(m),()=>t.break())}}function g(y,m,S){let v={keyword:"additionalProperties",dataProp:y,dataPropType:xo.Type.Str};if(S===!1)Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(v,m)}}};wE.default=R2});var PE=L(function(zE){Object.defineProperty(zE,"__esModule",{value:!0});var EE=gs(),_d=rr(),zs=Te(),RE=Ch(),z2={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:n,it:s}=e;if(s.opts.removeAdditional==="all"&&o.additionalProperties===void 0)RE.default.code(new EE.KeywordCxt(s,RE.default,"additionalProperties"));let i=_d.allSchemaProperties(r);for(let d of i)s.definedProperties.add(d);if(s.opts.unevaluated&&i.length&&s.props!==!0)s.props=zs.mergeEvaluated.props(t,zs.toHash(i),s.props);let a=i.filter((d)=>!zs.alwaysValidSchema(s,r[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a){if(u(d))l(d);else{if(t.if(_d.propertyInData(t,n,d,s.opts.ownProperties)),l(d),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};zE.default=z2});var IE=L(function(TE){Object.defineProperty(TE,"__esModule",{value:!0});var yd=rr(),Ao=be(),vd=Te(),Sd=Te(),T2={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:n,it:s}=e,{opts:i}=s,a=yd.allSchemaProperties(r),c=a.filter((g)=>vd.alwaysValidSchema(s,r[g]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&n.properties,l=t.name("valid");if(s.props!==!0&&!(s.props instanceof Ao.Name))s.props=Sd.evaluatedPropsToName(t,s.props);let{props:d}=s;f();function f(){for(let g of a){if(u)h(g);if(s.allErrors)_(g);else t.var(l,!0),_(g),t.if(l)}}function h(g){for(let y in u)if(new RegExp(g).test(y))vd.checkStrictMode(s,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function _(g){t.forIn("key",o,(y)=>{t.if(Ao._`${yd.usePattern(e,g)}.test(${y})`,()=>{let m=c.includes(g);if(!m)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:Sd.Type.Str},l);if(s.opts.unevaluated&&d!==!0)t.assign(Ao._`${d}[${y}]`,!0);else if(!m&&!s.allErrors)t.if(Ao.not(l),()=>t.break())})})}}};TE.default=T2});var CE=L(function(OE){Object.defineProperty(OE,"__esModule",{value:!0});var kE=Te(),k2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:o}=e;if(kE.alwaysValidSchema(o,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};OE.default=k2});var AE=L(function(xE){Object.defineProperty(xE,"__esModule",{value:!0});var NE=rr(),C2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:NE.validateUnion,error:{message:"must match a schema in anyOf"}};xE.default=C2});var ME=L(function(qE){Object.defineProperty(qE,"__esModule",{value:!0});var jo=be(),jE=Te(),x2={message:"must match exactly one schema in oneOf",params:({params:e})=>jo._`{passingSchemas: ${e.passing}}`},A2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:x2,code(e){let{gen:t,schema:r,parentSchema:o,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;let s=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(){s.forEach((l,d)=>{let f;if(jE.alwaysValidSchema(n,l))t.var(c,!0);else f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(jo._`${c} && ${i}`).assign(i,!1).assign(a,jo._`[${a}, ${d}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,d),f)e.mergeEvaluated(f,jo.Name)})})}}};qE.default=A2});var UE=L(function(DE){Object.defineProperty(DE,"__esModule",{value:!0});var LE=Te(),q2={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let n=t.name("valid");r.forEach((s,i)=>{if(LE.alwaysValidSchema(o,s))return;let a=e.subschema({keyword:"allOf",schemaProp:i},n);e.ok(n),e.mergeEvaluated(a)})}};DE.default=q2});var ZE=L(function(VE){Object.defineProperty(VE,"__esModule",{value:!0});var qo=be(),bd=Te(),L2={message:({params:e})=>qo.str`must match "${e.ifClause}" schema`,params:({params:e})=>qo._`{failingKeyword: ${e.ifClause}}`},D2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:L2,code(e){let{gen:t,parentSchema:r,it:o}=e;if(r.then===void 0&&r.else===void 0)bd.checkStrictMode(o,'"if" without "then" and "else" is ignored');let n=FE(o,"then"),s=FE(o,"else");if(!n&&!s)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),n&&s){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,u("then",l),u("else",l))}else if(n)t.if(a,u("then"));else t.if(qo.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function u(l,d){return()=>{let f=e.subschema({keyword:l},a);if(t.assign(i,a),e.mergeValidEvaluated(f,i),d)t.assign(d,qo._`${l}`);else e.setParams({ifClause:l})}}}};function FE(e,t){let r=e.schema[t];return r!==void 0&&!bd.alwaysValidSchema(e,r)}VE.default=D2});var KE=L(function(GE){Object.defineProperty(GE,"__esModule",{value:!0});var HE=Te(),F2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)HE.checkStrictMode(r,`"${e}" without "if" is ignored`)}};GE.default=F2});var Nh=L(function(JE){Object.defineProperty(JE,"__esModule",{value:!0});var Z2=kh(),H2=iE(),G2=Oh(),K2=dE(),J2=fE(),B2=hd(),W2=$E(),Y2=Ch(),X2=PE(),Q2=IE(),eD=CE(),tD=AE(),rD=ME(),oD=UE(),nD=ZE(),sD=KE();function iD(e=!1){let t=[eD.default,tD.default,rD.default,oD.default,nD.default,sD.default,W2.default,Y2.default,B2.default,X2.default,Q2.default];if(e)t.push(H2.default,K2.default);else t.push(Z2.default,G2.default);return t.push(J2.default),t}JE.default=iD});var xh=L(function(YE){Object.defineProperty(YE,"__esModule",{value:!0});YE.dynamicAnchor=void 0;var Ps=be(),cD=er(),$d=_a(),BE=ld(),uD={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>WE(e,e.schema)};function WE(e,t){let{gen:r,it:o}=e;o.schemaEnv.root.dynamicAnchors[t]=!0;let n=Ps._`${cD.default.dynamicAnchors}${Ps.getProperty(t)}`,s=o.errSchemaPath==="#"?o.validateName:lD(e);r.if(Ps._`!${n}`,()=>r.assign(n,s))}YE.dynamicAnchor=WE;function lD(e){let{schemaEnv:t,schema:r,self:o}=e.it,{root:n,baseId:s,localRefs:i,meta:a}=t.root,{schemaId:c}=o.opts,u=new $d.SchemaEnv({schema:r,schemaId:c,root:n,baseId:s,localRefs:i,meta:a});return $d.compileSchema.call(o,u),BE.getValidate(e,u)}YE.default=uD});var Ah=L(function(ez){Object.defineProperty(ez,"__esModule",{value:!0});ez.dynamicRef=void 0;var wd=be(),pD=er(),Rd=ld(),fD={keyword:"$dynamicRef",schemaType:"string",code:(e)=>QE(e,e.schema)};function QE(e,t){let{gen:r,keyword:o,it:n}=e;if(t[0]!=="#")throw Error(`"${o}" only supports hash fragment reference`);let s=t.slice(1);if(n.allErrors)i();else{let c=r.let("valid",!1);i(c),e.ok(c)}function i(c){if(n.schemaEnv.root.dynamicAnchors[s]){let u=r.let("_v",wd._`${pD.default.dynamicAnchors}${wd.getProperty(s)}`);r.if(u,a(u,c),a(n.validateName,c))}else a(n.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{Rd.callRef(e,c),r.let(u,!0)}):()=>Rd.callRef(e,c)}}ez.dynamicRef=QE;ez.default=fD});var sz=L(function(nz){Object.defineProperty(nz,"__esModule",{value:!0});var rz=xh(),oz=Te(),hD={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)rz.dynamicAnchor(e,"");else oz.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};nz.default=hD});var cz=L(function(az){Object.defineProperty(az,"__esModule",{value:!0});var iz=Ah(),_D={keyword:"$recursiveRef",schemaType:"string",code:(e)=>iz.dynamicRef(e,e.schema)};az.default=_D});var lz=L(function(uz){Object.defineProperty(uz,"__esModule",{value:!0});var vD=xh(),SD=Ah(),bD=sz(),$D=cz(),wD=[vD.default,SD.default,bD.default,$D.default];uz.default=wD});var pz=L(function(dz){Object.defineProperty(dz,"__esModule",{value:!0});var Ed=hd(),ED={keyword:"dependentRequired",type:"object",schemaType:"object",error:Ed.error,code:(e)=>Ed.validatePropertyDeps(e)};dz.default=ED});var hz=L(function(mz){Object.defineProperty(mz,"__esModule",{value:!0});var fz=hd(),PD={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>fz.validateSchemaDeps(e)};mz.default=PD});var yz=L(function(_z){Object.defineProperty(_z,"__esModule",{value:!0});var gz=Te(),ID={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)gz.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};_z.default=ID});var Sz=L(function(vz){Object.defineProperty(vz,"__esModule",{value:!0});var OD=pz(),CD=hz(),ND=yz(),xD=[OD.default,CD.default,ND.default];vz.default=xD});var $z=L(function(bz){Object.defineProperty(bz,"__esModule",{value:!0});var kt=be(),zd=Te(),jD=er(),qD={message:"must NOT have unevaluated properties",params:({params:e})=>kt._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},MD={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:qD,code(e){let{gen:t,schema:r,data:o,errsCount:n,it:s}=e;if(!n)throw Error("ajv implementation error");let{allErrors:i,props:a}=s;if(a instanceof kt.Name)t.if(kt._`${a} !== true`,()=>t.forIn("key",o,(d)=>t.if(u(a,d),()=>c(d))));else if(a!==!0)t.forIn("key",o,(d)=>a===void 0?c(d):t.if(l(a,d),()=>c(d)));s.props=!0,e.ok(kt._`${n} === ${jD.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!i)t.break();return}if(!zd.alwaysValidSchema(s,r)){let f=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:zd.Type.Str},f),!i)t.if(kt.not(f),()=>t.break())}}function u(d,f){return kt._`!${d} || !${d}[${f}]`}function l(d,f){let h=[];for(let _ in d)if(d[_]===!0)h.push(kt._`${f} !== ${_}`);return kt.and(...h)}}};bz.default=MD});var Rz=L(function(wz){Object.defineProperty(wz,"__esModule",{value:!0});var Ft=be(),Pd=Te(),DD={message:({params:{len:e}})=>Ft.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ft._`{limit: ${e}}`},UD={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:DD,code(e){let{gen:t,schema:r,data:o,it:n}=e,s=n.items||0;if(s===!0)return;let i=t.const("len",Ft._`${o}.length`);if(r===!1)e.setParams({len:s}),e.fail(Ft._`${i} > ${s}`);else if(typeof r=="object"&&!Pd.alwaysValidSchema(n,r)){let c=t.var("valid",Ft._`${i} <= ${s}`);t.if(Ft.not(c),()=>a(c,s)),e.ok(c)}n.items=!0;function a(c,u){t.forRange("i",u,i,(l)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:Pd.Type.Num},c),!n.allErrors)t.if(Ft.not(c),()=>t.break())})}}};wz.default=UD});var zz=L(function(Ez){Object.defineProperty(Ez,"__esModule",{value:!0});var VD=$z(),ZD=Rz(),HD=[VD.default,ZD.default];Ez.default=HD});var Tz=L(function(Pz){Object.defineProperty(Pz,"__esModule",{value:!0});var Ee=be(),KD={message:({schemaCode:e})=>Ee.str`must match format "${e}"`,params:({schemaCode:e})=>Ee._`{format: ${e}}`},JD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:KD,code(e,t){let{gen:r,data:o,$data:n,schema:s,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;if(n)f();else h();function f(){let _=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=r.const("fDef",Ee._`${_}[${i}]`),y=r.let("fType"),m=r.let("format");r.if(Ee._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,Ee._`${g}.type || "string"`).assign(m,Ee._`${g}.validate`),()=>r.assign(y,Ee._`"string"`).assign(m,g)),e.fail$data(Ee.or(S(),v()));function S(){if(c.strictSchema===!1)return Ee.nil;return Ee._`${i} && !${m}`}function v(){let w=l.$async?Ee._`(${g}.async ? await ${m}(${o}) : ${m}(${o}))`:Ee._`${m}(${o})`,P=Ee._`(typeof ${m} == "function" ? ${w} : ${m}.test(${o}))`;return Ee._`${m} && ${m} !== true && ${y} === ${t} && !${P}`}}function h(){let _=d.formats[s];if(!_){S();return}if(_===!0)return;let[g,y,m]=v(_);if(g===t)e.pass(w());function S(){if(c.strictSchema===!1){d.logger.warn(P());return}throw Error(P());function P(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function v(P){let R=P instanceof RegExp?Ee.regexpCode(P):c.code.formats?Ee._`${c.code.formats}${Ee.getProperty(s)}`:void 0,b=r.scopeValue("formats",{key:s,ref:P,code:R});if(typeof P=="object"&&!(P instanceof RegExp))return[P.type||"string",P.validate,Ee._`${b}.validate`];return["string",P,b]}function w(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!l.$async)throw Error("async format in sync schema");return Ee._`await ${m}(${o})`}return typeof y=="function"?Ee._`${m}(${o})`:Ee._`${m}.test(${o})`}}}};Pz.default=JD});var jh=L(function(Iz){Object.defineProperty(Iz,"__esModule",{value:!0});var WD=Tz(),YD=[WD.default];Iz.default=YD});var qh=L(function(kz){Object.defineProperty(kz,"__esModule",{value:!0});kz.contentVocabulary=kz.metadataVocabulary=void 0;kz.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];kz.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Nz=L(function(Cz){Object.defineProperty(Cz,"__esModule",{value:!0});var eU=Th(),tU=Ih(),rU=Nh(),oU=lz(),nU=Sz(),sU=zz(),iU=jh(),Td=qh(),aU=[oU.default,eU.default,tU.default,(0,rU.default)(!0),iU.default,Td.metadataVocabulary,Td.contentVocabulary,nU.default,sU.default];Cz.default=aU});var qz=L(function(Az){Object.defineProperty(Az,"__esModule",{value:!0});Az.DiscrError=void 0;var xz;(function(e){e.Tag="tag",e.Mapping="mapping"})(xz||(Az.DiscrError=xz={}))});var Mh=L(function(Lz){Object.defineProperty(Lz,"__esModule",{value:!0});var nr=be(),Ts=qz(),Id=_a(),uU=ys(),Mz=Te(),lU={message:({params:{discrError:e,tagName:t}})=>e===Ts.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>nr._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},dU={keyword:"discriminator",type:"object",schemaType:"object",error:lU,code(e){let{gen:t,data:r,schema:o,parentSchema:n,it:s}=e,{oneOf:i}=n;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(o.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",nr._`${r}${nr.getProperty(a)}`);t.if(nr._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Ts.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let h=f();t.if(!1);for(let _ in h)t.elseIf(nr._`${u} === ${_}`),t.assign(c,d(h[_]));t.else(),e.error(!1,{discrError:Ts.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function d(h){let _=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:h},_);return e.mergeEvaluated(g,nr.Name),_}function f(){var h;let _={},g=m(n),y=!0;for(let w=0;w<i.length;w++){let P=i[w];if((P===null||P===void 0?void 0:P.$ref)&&!Mz.schemaHasRulesButRef(P,s.self.RULES)){let b=P.$ref;if(P=Id.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,b),P instanceof Id.SchemaEnv)P=P.schema;if(P===void 0)throw new uU.default(s.opts.uriResolver,s.baseId,b)}let R=(h=P===null||P===void 0?void 0:P.properties)===null||h===void 0?void 0:h[a];if(typeof R!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||m(P)),S(R,w)}if(!y)throw Error(`discriminator: "${a}" must be required`);return _;function m({required:w}){return Array.isArray(w)&&w.includes(a)}function S(w,P){if(w.const)v(w.const,P);else if(w.enum)for(let R of w.enum)v(R,P);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(w,P){if(typeof w!="string"||w in _)throw Error(`discriminator: "${a}" values must be unique strings`);_[w]=P}}}};Lz.default=dU});var Dz=L(function(bB,fU){fU.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 Uz=L(function($B,mU){mU.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 Fz=L(function(wB,hU){hU.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 Vz=L(function(RB,gU){gU.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 Zz=L(function(EB,_U){_U.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 Hz=L(function(zB,yU){yU.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 Gz=L(function(PB,vU){vU.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 Kz=L(function(TB,SU){SU.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 Bz=L(function(Jz){Object.defineProperty(Jz,"__esModule",{value:!0});var bU=Dz(),$U=Uz(),wU=Fz(),RU=Vz(),EU=Zz(),zU=Hz(),PU=Gz(),TU=Kz(),IU=["/properties"];function kU(e){return[bU,$U,wU,RU,EU,t(this,zU),PU,t(this,TU)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,o){return e?r.$dataMetaSchema(o,IU):o}}Jz.default=kU});var Wz=L(function(Vt,Dh){Object.defineProperty(Vt,"__esModule",{value:!0});Vt.MissingRefError=Vt.ValidationError=Vt.CodeGen=Vt.Name=Vt.nil=Vt.stringify=Vt.str=Vt._=Vt.KeywordCxt=Vt.Ajv2020=void 0;var CU=Ph(),NU=Nz(),xU=Mh(),AU=Bz(),Lh="https://json-schema.org/draft/2020-12/schema";class Sa extends CU.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),NU.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(xU.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;AU.default.call(this,e),this.refs["http://json-schema.org/schema"]=Lh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Lh)?Lh:void 0)}}Vt.Ajv2020=Sa;Dh.exports=Vt=Sa;Dh.exports.Ajv2020=Sa;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.default=Sa;var jU=gs();Object.defineProperty(Vt,"KeywordCxt",{enumerable:!0,get:function(){return jU.KeywordCxt}});var Is=be();Object.defineProperty(Vt,"_",{enumerable:!0,get:function(){return Is._}});Object.defineProperty(Vt,"str",{enumerable:!0,get:function(){return Is.str}});Object.defineProperty(Vt,"stringify",{enumerable:!0,get:function(){return Is.stringify}});Object.defineProperty(Vt,"nil",{enumerable:!0,get:function(){return Is.nil}});Object.defineProperty(Vt,"Name",{enumerable:!0,get:function(){return Is.Name}});Object.defineProperty(Vt,"CodeGen",{enumerable:!0,get:function(){return Is.CodeGen}});var qU=ha();Object.defineProperty(Vt,"ValidationError",{enumerable:!0,get:function(){return qU.default}});var MU=ys();Object.defineProperty(Vt,"MissingRefError",{enumerable:!0,get:function(){return MU.default}})});var iP=L(function(nP){Object.defineProperty(nP,"__esModule",{value:!0});nP.formatNames=nP.fastFormats=nP.fullFormats=void 0;function Ar(e,t){return{validate:e,compare:t}}nP.fullFormats={date:Ar(eP,Zh),time:Ar(Fh(!0),Hh),"date-time":Ar(Yz(!0),rP),"iso-time":Ar(Fh(),tP),"iso-date-time":Ar(Yz(),oP),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:GU,"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:QU,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:KU,int32:{type:"number",validate:WU},int64:{type:"number",validate:YU},float:{type:"number",validate:Qz},double:{type:"number",validate:Qz},password:!0,binary:!0};nP.fastFormats={...nP.fullFormats,date:Ar(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Zh),time:Ar(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Hh),"date-time":Ar(/^\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,rP),"iso-time":Ar(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tP),"iso-date-time":Ar(/^\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,oP),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};nP.formatNames=Object.keys(nP.fullFormats);function UU(e){return e%4===0&&(e%100!==0||e%400===0)}var FU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,VU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function eP(e){let t=FU.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],n=+t[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&UU(r)?29:VU[o])}function Zh(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Uh=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Fh(e){return function(r){let o=Uh.exec(r);if(!o)return!1;let n=+o[1],s=+o[2],i=+o[3],a=o[4],c=o[5]==="-"?-1:1,u=+(o[6]||0),l=+(o[7]||0);if(u>23||l>59||e&&!a)return!1;if(n<=23&&s<=59&&i<60)return!0;let d=s-l*c,f=n-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&i<61}}function Hh(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(!(r&&o))return;return r-o}function tP(e,t){if(!(e&&t))return;let r=Uh.exec(e),o=Uh.exec(t);if(!(r&&o))return;if(e=r[1]+r[2]+r[3],t=o[1]+o[2]+o[3],e>t)return 1;if(e<t)return-1;return 0}var Vh=/t|\s/i;function Yz(e){let t=Fh(e);return function(o){let n=o.split(Vh);return n.length===2&&eP(n[0])&&t(n[1])}}function rP(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(!(r&&o))return;return r-o}function oP(e,t){if(!(e&&t))return;let[r,o]=e.split(Vh),[n,s]=t.split(Vh),i=Zh(r,n);if(i===void 0)return;return i||Hh(o,s)}var ZU=/\/|:/,HU=/^(?:[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 GU(e){return ZU.test(e)&&HU.test(e)}var Xz=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function KU(e){return Xz.lastIndex=0,Xz.test(e)}var JU=-2147483648,BU=2147483647;function WU(e){return Number.isInteger(e)&&e<=BU&&e>=JU}function YU(e){return Number.isInteger(e)}function Qz(){return!0}var XU=/[^\\]\\Z/;function QU(e){if(XU.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var cP=L(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});var tF=Th(),rF=Ih(),oF=Nh(),nF=jh(),kd=qh(),sF=[tF.default,rF.default,(0,oF.default)(),nF.default,kd.metadataVocabulary,kd.contentVocabulary];aP.default=sF});var uP=L(function(DB,aF){aF.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 dP=L(function(Zt,Kh){Object.defineProperty(Zt,"__esModule",{value:!0});Zt.MissingRefError=Zt.ValidationError=Zt.CodeGen=Zt.Name=Zt.nil=Zt.stringify=Zt.str=Zt._=Zt.KeywordCxt=Zt.Ajv=void 0;var cF=Ph(),uF=cP(),lF=Mh(),lP=uP(),dF=["/properties"],Od="http://json-schema.org/draft-07/schema";class ba extends cF.default{_addVocabularies(){if(super._addVocabularies(),uF.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(lF.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(lP,dF):lP;this.addMetaSchema(e,Od,!1),this.refs["http://json-schema.org/schema"]=Od}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Od)?Od:void 0)}}Zt.Ajv=ba;Kh.exports=Zt=ba;Kh.exports.Ajv=ba;Object.defineProperty(Zt,"__esModule",{value:!0});Zt.default=ba;var pF=gs();Object.defineProperty(Zt,"KeywordCxt",{enumerable:!0,get:function(){return pF.KeywordCxt}});var ks=be();Object.defineProperty(Zt,"_",{enumerable:!0,get:function(){return ks._}});Object.defineProperty(Zt,"str",{enumerable:!0,get:function(){return ks.str}});Object.defineProperty(Zt,"stringify",{enumerable:!0,get:function(){return ks.stringify}});Object.defineProperty(Zt,"nil",{enumerable:!0,get:function(){return ks.nil}});Object.defineProperty(Zt,"Name",{enumerable:!0,get:function(){return ks.Name}});Object.defineProperty(Zt,"CodeGen",{enumerable:!0,get:function(){return ks.CodeGen}});var fF=ha();Object.defineProperty(Zt,"ValidationError",{enumerable:!0,get:function(){return fF.default}});var mF=ys();Object.defineProperty(Zt,"MissingRefError",{enumerable:!0,get:function(){return mF.default}})});var mP=L(function(fP){Object.defineProperty(fP,"__esModule",{value:!0});fP.formatLimitDefinition=void 0;var pP=dP(),nt=be(),Mo=nt.operators,Cd={formatMaximum:{okStr:"<=",ok:Mo.LTE,fail:Mo.GT},formatMinimum:{okStr:">=",ok:Mo.GTE,fail:Mo.LT},formatExclusiveMaximum:{okStr:"<",ok:Mo.LT,fail:Mo.GTE},formatExclusiveMinimum:{okStr:">",ok:Mo.GT,fail:Mo.LTE}},_F={message:({keyword:e,schemaCode:t})=>nt.str`should be ${Cd[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>nt._`{comparison: ${Cd[e].okStr}, limit: ${t}}`};fP.formatLimitDefinition={keyword:Object.keys(Cd),type:"string",schemaType:"string",$data:!0,error:_F,code(e){let{gen:t,data:r,schemaCode:o,keyword:n,it:s}=e,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new pP.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)u();else l();function u(){let f=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),h=t.const("fmt",nt._`${f}[${c.schemaCode}]`);e.fail$data(nt.or(nt._`typeof ${h} != "object"`,nt._`${h} instanceof RegExp`,nt._`typeof ${h}.compare != "function"`,d(h)))}function l(){let f=c.schema,h=a.formats[f];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw Error(`"${n}": format "${f}" does not define "compare" function`);let _=t.scopeValue("formats",{key:f,ref:h,code:i.code.formats?nt._`${i.code.formats}${nt.getProperty(f)}`:void 0});e.fail$data(d(_))}function d(f){return nt._`${f}.compare(${r}, ${o}) ${Cd[n].fail} 0`}},dependencies:["format"]};var yF=(e)=>(e.addKeyword(fP.formatLimitDefinition),e);fP.default=yF});var yP=L(function($a,_P){Object.defineProperty($a,"__esModule",{value:!0});var sr=iP(),SF=mP(),Os=be(),hP=new Os.Name("fullFormats"),bF=new Os.Name("fastFormats"),Bh=(e,t={keywords:!0})=>{if(Array.isArray(t))return gP(e,t,sr.fullFormats,hP),e;let[r,o]=t.mode==="fast"?[sr.fastFormats,bF]:[sr.fullFormats,hP],n=t.formats||sr.formatNames;if(gP(e,n,r,o),t.keywords)(0,SF.default)(e);return e};Bh.get=(e,t="full")=>{let o=(t==="fast"?sr.fastFormats:sr.fullFormats)[e];if(!o)throw Error(`Unknown format "${e}"`);return o};function gP(e,t,r,o){var n,s;(n=(s=e.opts.code).formats)!==null&&n!==void 0||(s.formats=Os._`require("ajv-formats/dist/formats").${o}`);for(let i of t)e.addFormat(i,r[i])}_P.exports=$a=Bh;Object.defineProperty($a,"__esModule",{value:!0});$a.default=Bh});var Cs=L(function(QB,vP){var kF=Number.MAX_SAFE_INTEGER||9007199254740991,OF=["major","premajor","minor","preminor","patch","prepatch","prerelease"];vP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:kF,RELEASE_TYPES:OF,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var wa=L(function(e5,SP){var CF=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};SP.exports=CF});var Ns=L(function(jr,bP){var{MAX_SAFE_COMPONENT_LENGTH:Xh,MAX_SAFE_BUILD_LENGTH:NF,MAX_LENGTH:xF}=Cs(),AF=wa();jr=bP.exports={};var jF=jr.re=[],qF=jr.safeRe=[],ne=jr.src=[],MF=jr.safeSrc=[],se=jr.t={},LF=0,Qh="[a-zA-Z0-9-]",DF=[["\\s",1],["\\d",xF],[Qh,NF]],UF=(e)=>{for(let[t,r]of DF)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},we=(e,t,r)=>{let o=UF(t),n=LF++;AF(e,n,t),se[e]=n,ne[n]=t,MF[n]=o,jF[n]=new RegExp(t,r?"g":void 0),qF[n]=new RegExp(o,r?"g":void 0)};we("NUMERICIDENTIFIER","0|[1-9]\\d*");we("NUMERICIDENTIFIERLOOSE","\\d+");we("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Qh}*`);we("MAINVERSION",`(${ne[se.NUMERICIDENTIFIER]})\\.(${ne[se.NUMERICIDENTIFIER]})\\.(${ne[se.NUMERICIDENTIFIER]})`);we("MAINVERSIONLOOSE",`(${ne[se.NUMERICIDENTIFIERLOOSE]})\\.(${ne[se.NUMERICIDENTIFIERLOOSE]})\\.(${ne[se.NUMERICIDENTIFIERLOOSE]})`);we("PRERELEASEIDENTIFIER",`(?:${ne[se.NONNUMERICIDENTIFIER]}|${ne[se.NUMERICIDENTIFIER]})`);we("PRERELEASEIDENTIFIERLOOSE",`(?:${ne[se.NONNUMERICIDENTIFIER]}|${ne[se.NUMERICIDENTIFIERLOOSE]})`);we("PRERELEASE",`(?:-(${ne[se.PRERELEASEIDENTIFIER]}(?:\\.${ne[se.PRERELEASEIDENTIFIER]})*))`);we("PRERELEASELOOSE",`(?:-?(${ne[se.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ne[se.PRERELEASEIDENTIFIERLOOSE]})*))`);we("BUILDIDENTIFIER",`${Qh}+`);we("BUILD",`(?:\\+(${ne[se.BUILDIDENTIFIER]}(?:\\.${ne[se.BUILDIDENTIFIER]})*))`);we("FULLPLAIN",`v?${ne[se.MAINVERSION]}${ne[se.PRERELEASE]}?${ne[se.BUILD]}?`);we("FULL",`^${ne[se.FULLPLAIN]}$`);we("LOOSEPLAIN",`[v=\\s]*${ne[se.MAINVERSIONLOOSE]}${ne[se.PRERELEASELOOSE]}?${ne[se.BUILD]}?`);we("LOOSE",`^${ne[se.LOOSEPLAIN]}$`);we("GTLT","((?:<|>)?=?)");we("XRANGEIDENTIFIERLOOSE",`${ne[se.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);we("XRANGEIDENTIFIER",`${ne[se.NUMERICIDENTIFIER]}|x|X|\\*`);we("XRANGEPLAIN",`[v=\\s]*(${ne[se.XRANGEIDENTIFIER]})(?:\\.(${ne[se.XRANGEIDENTIFIER]})(?:\\.(${ne[se.XRANGEIDENTIFIER]})(?:${ne[se.PRERELEASE]})?${ne[se.BUILD]}?)?)?`);we("XRANGEPLAINLOOSE",`[v=\\s]*(${ne[se.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ne[se.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ne[se.XRANGEIDENTIFIERLOOSE]})(?:${ne[se.PRERELEASELOOSE]})?${ne[se.BUILD]}?)?)?`);we("XRANGE",`^${ne[se.GTLT]}\\s*${ne[se.XRANGEPLAIN]}$`);we("XRANGELOOSE",`^${ne[se.GTLT]}\\s*${ne[se.XRANGEPLAINLOOSE]}$`);we("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Xh}})(?:\\.(\\d{1,${Xh}}))?(?:\\.(\\d{1,${Xh}}))?`);we("COERCE",`${ne[se.COERCEPLAIN]}(?:$|[^\\d])`);we("COERCEFULL",ne[se.COERCEPLAIN]+`(?:${ne[se.PRERELEASE]})?(?:${ne[se.BUILD]})?(?:$|[^\\d])`);we("COERCERTL",ne[se.COERCE],!0);we("COERCERTLFULL",ne[se.COERCEFULL],!0);we("LONETILDE","(?:~>?)");we("TILDETRIM",`(\\s*)${ne[se.LONETILDE]}\\s+`,!0);jr.tildeTrimReplace="$1~";we("TILDE",`^${ne[se.LONETILDE]}${ne[se.XRANGEPLAIN]}$`);we("TILDELOOSE",`^${ne[se.LONETILDE]}${ne[se.XRANGEPLAINLOOSE]}$`);we("LONECARET","(?:\\^)");we("CARETTRIM",`(\\s*)${ne[se.LONECARET]}\\s+`,!0);jr.caretTrimReplace="$1^";we("CARET",`^${ne[se.LONECARET]}${ne[se.XRANGEPLAIN]}$`);we("CARETLOOSE",`^${ne[se.LONECARET]}${ne[se.XRANGEPLAINLOOSE]}$`);we("COMPARATORLOOSE",`^${ne[se.GTLT]}\\s*(${ne[se.LOOSEPLAIN]})$|^$`);we("COMPARATOR",`^${ne[se.GTLT]}\\s*(${ne[se.FULLPLAIN]})$|^$`);we("COMPARATORTRIM",`(\\s*)${ne[se.GTLT]}\\s*(${ne[se.LOOSEPLAIN]}|${ne[se.XRANGEPLAIN]})`,!0);jr.comparatorTrimReplace="$1$2$3";we("HYPHENRANGE",`^\\s*(${ne[se.XRANGEPLAIN]})\\s+-\\s+(${ne[se.XRANGEPLAIN]})\\s*$`);we("HYPHENRANGELOOSE",`^\\s*(${ne[se.XRANGEPLAINLOOSE]})\\s+-\\s+(${ne[se.XRANGEPLAINLOOSE]})\\s*$`);we("STAR","(<|>)?=?\\s*\\*");we("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");we("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Nd=L(function(t5,$P){var FF=Object.freeze({loose:!0}),VF=Object.freeze({}),ZF=(e)=>{if(!e)return VF;if(typeof e!=="object")return FF;return e};$P.exports=ZF});var eg=L(function(r5,EP){var wP=/^[0-9]+$/,RP=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=wP.test(e),o=wP.test(t);if(r&&o)e=+e,t=+t;return e===t?0:r&&!o?-1:o&&!r?1:e<t?-1:1},HF=(e,t)=>RP(t,e);EP.exports={compareIdentifiers:RP,rcompareIdentifiers:HF}});var bt=L(function(o5,PP){var xd=wa(),{MAX_LENGTH:zP,MAX_SAFE_INTEGER:Ad}=Cs(),{safeRe:jd,t:qd}=Ns(),GF=Nd(),{compareIdentifiers:tg}=eg(),KF=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let o=0;o<r.length;o++)if(tg(e[o],r[o])!==0)return!1;return!0};class gr{constructor(e,t){if(t=GF(t),e instanceof gr)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>zP)throw TypeError(`version is longer than ${zP} characters`);xd("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?jd[qd.LOOSE]:jd[qd.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>Ad||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ad||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ad||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((o)=>{if(/^[0-9]+$/.test(o)){let n=+o;if(n>=0&&n<Ad)return n}return o});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(xd("SemVer.compare",this.version,this.options,e),!(e instanceof gr)){if(typeof e==="string"&&e===this.version)return 0;e=new gr(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof gr))e=new gr(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 gr))e=new gr(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],o=e.prerelease[t];if(xd("prerelease compare",t,r,o),r===void 0&&o===void 0)return 0;else if(o===void 0)return 1;else if(r===void 0)return-1;else if(r===o)continue;else return tg(r,o)}while(++t)}compareBuild(e){if(!(e instanceof gr))e=new gr(e,this.options);let t=0;do{let r=this.build[t],o=e.build[t];if(xd("build compare",t,r,o),r===void 0&&o===void 0)return 0;else if(o===void 0)return 1;else if(r===void 0)return-1;else if(r===o)continue;else return tg(r,o)}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 o=`-${t}`.match(this.options.loose?jd[qd.PRERELEASELOOSE]:jd[qd.PRERELEASE]);if(!o||o[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 o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let n=this.prerelease.length;while(--n>=0)if(typeof this.prerelease[n]==="number")this.prerelease[n]++,n=-2;if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(t){let n=[t,o];if(r===!1)n=[t];if(KF(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=n}else this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}PP.exports=gr});var Lo=L(function(n5,IP){var TP=bt(),JF=(e,t,r=!1)=>{if(e instanceof TP)return e;try{return new TP(e,t)}catch(o){if(!r)return null;throw o}};IP.exports=JF});var OP=L(function(s5,kP){var BF=Lo(),WF=(e,t)=>{let r=BF(e,t);return r?r.version:null};kP.exports=WF});var NP=L(function(i5,CP){var YF=Lo(),XF=(e,t)=>{let r=YF(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};CP.exports=XF});var jP=L(function(a5,AP){var xP=bt(),QF=(e,t,r,o,n)=>{if(typeof r==="string")n=o,o=r,r=void 0;try{return new xP(e instanceof xP?e.version:e,r).inc(t,o,n).version}catch(s){return null}};AP.exports=QF});var LP=L(function(c5,MP){var qP=Lo(),eV=(e,t)=>{let r=qP(e,null,!0),o=qP(t,null,!0),n=r.compare(o);if(n===0)return null;let s=n>0,i=s?r:o,a=s?o: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 l=c?"pre":"";if(r.major!==o.major)return l+"major";if(r.minor!==o.minor)return l+"minor";if(r.patch!==o.patch)return l+"patch";return"prerelease"};MP.exports=eV});var UP=L(function(u5,DP){var tV=bt(),rV=(e,t)=>new tV(e,t).major;DP.exports=rV});var VP=L(function(l5,FP){var oV=bt(),nV=(e,t)=>new oV(e,t).minor;FP.exports=nV});var HP=L(function(d5,ZP){var sV=bt(),iV=(e,t)=>new sV(e,t).patch;ZP.exports=iV});var KP=L(function(p5,GP){var aV=Lo(),cV=(e,t)=>{let r=aV(e,t);return r&&r.prerelease.length?r.prerelease:null};GP.exports=cV});var ir=L(function(f5,BP){var JP=bt(),uV=(e,t,r)=>new JP(e,r).compare(new JP(t,r));BP.exports=uV});var YP=L(function(m5,WP){var lV=ir(),dV=(e,t,r)=>lV(t,e,r);WP.exports=dV});var QP=L(function(h5,XP){var pV=ir(),fV=(e,t)=>pV(e,t,!0);XP.exports=fV});var Md=L(function(g5,tT){var eT=bt(),mV=(e,t,r)=>{let o=new eT(e,r),n=new eT(t,r);return o.compare(n)||o.compareBuild(n)};tT.exports=mV});var oT=L(function(_5,rT){var hV=Md(),gV=(e,t)=>e.sort((r,o)=>hV(r,o,t));rT.exports=gV});var sT=L(function(y5,nT){var _V=Md(),yV=(e,t)=>e.sort((r,o)=>_V(o,r,t));nT.exports=yV});var Ra=L(function(v5,iT){var vV=ir(),SV=(e,t,r)=>vV(e,t,r)>0;iT.exports=SV});var Ld=L(function(S5,aT){var bV=ir(),$V=(e,t,r)=>bV(e,t,r)<0;aT.exports=$V});var rg=L(function(b5,cT){var wV=ir(),RV=(e,t,r)=>wV(e,t,r)===0;cT.exports=RV});var og=L(function($5,uT){var EV=ir(),zV=(e,t,r)=>EV(e,t,r)!==0;uT.exports=zV});var Dd=L(function(w5,lT){var PV=ir(),TV=(e,t,r)=>PV(e,t,r)>=0;lT.exports=TV});var Ud=L(function(R5,dT){var IV=ir(),kV=(e,t,r)=>IV(e,t,r)<=0;dT.exports=kV});var ng=L(function(E5,pT){var OV=rg(),CV=og(),NV=Ra(),xV=Dd(),AV=Ld(),jV=Ud(),qV=(e,t,r,o)=>{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 OV(e,r,o);case"!=":return CV(e,r,o);case">":return NV(e,r,o);case">=":return xV(e,r,o);case"<":return AV(e,r,o);case"<=":return jV(e,r,o);default:throw TypeError(`Invalid operator: ${t}`)}};pT.exports=qV});var mT=L(function(z5,fT){var MV=bt(),LV=Lo(),{safeRe:Fd,t:Vd}=Ns(),DV=(e,t)=>{if(e instanceof MV)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?Fd[Vd.COERCEFULL]:Fd[Vd.COERCE]);else{let c=t.includePrerelease?Fd[Vd.COERCERTLFULL]:Fd[Vd.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 o=r[2],n=r[3]||"0",s=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return LV(`${o}.${n}.${s}${i}${a}`,t)};fT.exports=DV});var _T=L(function(P5,gT){var UV=Lo(),hT=Cs(),FV=bt(),VV=(e,t,r)=>{if(!hT.RELEASE_TYPES.includes(t))return null;let o=ZV(e,r);return o&&HV(o,t)},ZV=(e,t)=>{let r=e instanceof FV?e.version:e;return UV(r,t)},HV=(e,t)=>{if(GV(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},GV=(e)=>e.startsWith("pre");gT.exports=VV});var ST=L(function(T5,vT){class yT{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 o=this.map.keys().next().value;this.delete(o)}this.map.set(e,t)}return this}}vT.exports=yT});var ar=L(function(I5,RT){var KV=/\s+/g;class Ea{constructor(e,t){if(t=BV(t),e instanceof Ea)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new Ea(e.raw,t);if(e instanceof Zd)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(KV," "),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((o)=>!$T(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&n9(o[0])){this.set=[o];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){e=e.replace(o9,"");let r=((this.options.includePrerelease&&t9)|(this.options.loose&&r9))+":"+e,o=bT.get(r);if(o)return o;let n=this.options.loose,s=n?xt[$t.HYPHENRANGELOOSE]:xt[$t.HYPHENRANGE];e=e.replace(s,h9(this.options.includePrerelease)),Ze("hyphen replace",e),e=e.replace(xt[$t.COMPARATORTRIM],XV),Ze("comparator trim",e),e=e.replace(xt[$t.TILDETRIM],QV),Ze("tilde trim",e),e=e.replace(xt[$t.CARETTRIM],e9),Ze("caret trim",e);let i=e.split(" ").map((l)=>s9(l,this.options)).join(" ").split(/\s+/).map((l)=>m9(l,this.options));if(n)i=i.filter((l)=>(Ze("loose invalid filter",l,this.options),!!l.match(xt[$t.COMPARATORLOOSE])));Ze("range list",i);let a=new Map,c=i.map((l)=>new Zd(l,this.options));for(let l of c){if($T(l))return[l];a.set(l.value,l)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return bT.set(r,u),u}intersects(e,t){if(!(e instanceof Ea))throw TypeError("a Range is required");return this.set.some((r)=>wT(r,t)&&e.set.some((o)=>wT(o,t)&&r.every((n)=>o.every((s)=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new WV(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(g9(this.set[t],e,this.options))return!0;return!1}}RT.exports=Ea;var JV=ST(),bT=new JV,BV=Nd(),Zd=za(),Ze=wa(),WV=bt(),{safeRe:xt,src:YV,t:$t,comparatorTrimReplace:XV,tildeTrimReplace:QV,caretTrimReplace:e9}=Ns(),{FLAG_INCLUDE_PRERELEASE:t9,FLAG_LOOSE:r9}=Cs(),o9=new RegExp(YV[$t.BUILD],"g"),$T=(e)=>e.value==="<0.0.0-0",n9=(e)=>e.value==="",wT=(e,t)=>{let r=!0,o=e.slice(),n=o.pop();while(r&&o.length)r=o.every((s)=>n.intersects(s,t)),n=o.pop();return r},s9=(e,t)=>(e=e.replace(xt[$t.BUILD],""),Ze("comp",e,t),e=u9(e,t),Ze("caret",e),e=a9(e,t),Ze("tildes",e),e=d9(e,t),Ze("xrange",e),e=f9(e,t),Ze("stars",e),e),pt=(e)=>!e||e.toLowerCase()==="x"||e==="*",i9=(e,t,r)=>pt(e)&&!pt(t)||pt(t)&&r&&!pt(r),a9=(e,t)=>e.trim().split(/\s+/).map((r)=>c9(r,t)).join(" "),c9=(e,t)=>{let r=t.loose?xt[$t.TILDELOOSE]:xt[$t.TILDE],o=t.includePrerelease?"-0":"";return e.replace(r,(n,s,i,a,c)=>{Ze("tilde",e,n,s,i,a,c);let u;if(pt(s))u="";else if(pt(i))u=`>=${s}.0.0${o} <${+s+1}.0.0-0`;else if(pt(a))u=`>=${s}.${i}.0${o} <${s}.${+i+1}.0-0`;else if(c)Ze("replaceTilde pr",c),u=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`;else u=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`;return Ze("tilde return",u),u})},u9=(e,t)=>e.trim().split(/\s+/).map((r)=>l9(r,t)).join(" "),l9=(e,t)=>{Ze("caret",e,t);let r=t.loose?xt[$t.CARETLOOSE]:xt[$t.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(n,s,i,a,c)=>{Ze("caret",e,n,s,i,a,c);let u;if(pt(s))u="";else if(pt(i))u=`>=${s}.0.0${o} <${+s+1}.0.0-0`;else if(pt(a))if(s==="0")u=`>=${s}.${i}.0${o} <${s}.${+i+1}.0-0`;else u=`>=${s}.${i}.0${o} <${+s+1}.0.0-0`;else if(c)if(Ze("replaceCaret pr",c),s==="0")if(i==="0")u=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`;else u=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`;else u=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`;else if(Ze("no pr"),s==="0")if(i==="0")u=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`;else u=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`;else u=`>=${s}.${i}.${a} <${+s+1}.0.0-0`;return Ze("caret return",u),u})},d9=(e,t)=>(Ze("replaceXRanges",e,t),e.split(/\s+/).map((r)=>p9(r,t)).join(" ")),p9=(e,t)=>{e=e.trim();let r=t.loose?xt[$t.XRANGELOOSE]:xt[$t.XRANGE];return e.replace(r,(o,n,s,i,a,c)=>{if(Ze("xRange",e,o,n,s,i,a,c),i9(s,i,a))return e;let u=pt(s),l=u||pt(i),d=l||pt(a),f=d;if(n==="="&&f)n="";if(c=t.includePrerelease?"-0":"",u)if(n===">"||n==="<")o="<0.0.0-0";else o="*";else if(n&&f){if(l)i=0;if(a=0,n===">")if(n=">=",l)s=+s+1,i=0,a=0;else i=+i+1,a=0;else if(n==="<=")if(n="<",l)s=+s+1;else i=+i+1;if(n==="<")c="-0";o=`${n+s}.${i}.${a}${c}`}else if(l)o=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(d)o=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`;return Ze("xRange return",o),o})},f9=(e,t)=>(Ze("replaceStars",e,t),e.trim().replace(xt[$t.STAR],"")),m9=(e,t)=>(Ze("replaceGTE0",e,t),e.trim().replace(xt[t.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),h9=(e)=>(t,r,o,n,s,i,a,c,u,l,d,f)=>{if(pt(o))r="";else if(pt(n))r=`>=${o}.0.0${e?"-0":""}`;else if(pt(s))r=`>=${o}.${n}.0${e?"-0":""}`;else if(i)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(pt(u))c="";else if(pt(l))c=`<${+u+1}.0.0-0`;else if(pt(d))c=`<${u}.${+l+1}.0-0`;else if(f)c=`<=${u}.${l}.${d}-${f}`;else if(e)c=`<${u}.${l}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},g9=(e,t,r)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let o=0;o<e.length;o++){if(Ze(e[o].semver),e[o].semver===Zd.ANY)continue;if(e[o].semver.prerelease.length>0){let n=e[o].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}}return!1}return!0}});var za=L(function(k5,kT){var Pa=Symbol("SemVer ANY");class Hd{static get ANY(){return Pa}constructor(e,t){if(t=ET(t),e instanceof Hd)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),ig("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Pa)this.value="";else this.value=this.operator+this.semver.version;ig("comp",this)}parse(e){let t=this.options.loose?zT[PT.COMPARATORLOOSE]:zT[PT.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=Pa;else this.semver=new TT(r[2],this.options.loose)}toString(){return this.value}test(e){if(ig("Comparator.test",e,this.options.loose),this.semver===Pa||e===Pa)return!0;if(typeof e==="string")try{e=new TT(e,this.options)}catch(t){return!1}return sg(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Hd))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new IT(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new IT(this.value,t).test(e.semver)}if(t=ET(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(sg(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(sg(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}kT.exports=Hd;var ET=Nd(),{safeRe:zT,t:PT}=Ns(),sg=ng(),ig=wa(),TT=bt(),IT=ar()});var Ta=L(function(O5,OT){var _9=ar(),y9=(e,t,r)=>{try{t=new _9(t,r)}catch(o){return!1}return t.test(e)};OT.exports=y9});var NT=L(function(C5,CT){var v9=ar(),S9=(e,t)=>new v9(e,t).set.map((r)=>r.map((o)=>o.value).join(" ").trim().split(" "));CT.exports=S9});var AT=L(function(N5,xT){var b9=bt(),$9=ar(),w9=(e,t,r)=>{let o=null,n=null,s=null;try{s=new $9(t,r)}catch(i){return null}return e.forEach((i)=>{if(s.test(i)){if(!o||n.compare(i)===-1)o=i,n=new b9(o,r)}}),o};xT.exports=w9});var qT=L(function(x5,jT){var R9=bt(),E9=ar(),z9=(e,t,r)=>{let o=null,n=null,s=null;try{s=new E9(t,r)}catch(i){return null}return e.forEach((i)=>{if(s.test(i)){if(!o||n.compare(i)===1)o=i,n=new R9(o,r)}}),o};jT.exports=z9});var DT=L(function(A5,LT){var ag=bt(),P9=ar(),MT=Ra(),T9=(e,t)=>{e=new P9(e,t);let r=new ag("0.0.0");if(e.test(r))return r;if(r=new ag("0.0.0-0"),e.test(r))return r;r=null;for(let o=0;o<e.set.length;++o){let n=e.set[o],s=null;if(n.forEach((i)=>{let a=new ag(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(!s||MT(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||MT(r,s)))r=s}if(r&&e.test(r))return r;return null};LT.exports=T9});var FT=L(function(j5,UT){var I9=ar(),k9=(e,t)=>{try{return new I9(e,t).range||"*"}catch(r){return null}};UT.exports=k9});var Gd=L(function(q5,GT){var O9=bt(),HT=za(),{ANY:C9}=HT,N9=ar(),x9=Ta(),VT=Ra(),ZT=Ld(),A9=Ud(),j9=Dd(),q9=(e,t,r,o)=>{e=new O9(e,o),t=new N9(t,o);let n,s,i,a,c;switch(r){case">":n=VT,s=A9,i=ZT,a=">",c=">=";break;case"<":n=ZT,s=j9,i=VT,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(x9(e,t,o))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,f=null;if(l.forEach((h)=>{if(h.semver===C9)h=new HT(">=0.0.0");if(d=d||h,f=f||h,n(h.semver,d.semver,o))d=h;else if(i(h.semver,f.semver,o))f=h}),d.operator===a||d.operator===c)return!1;if((!f.operator||f.operator===a)&&s(e,f.semver))return!1;else if(f.operator===c&&i(e,f.semver))return!1}return!0};GT.exports=q9});var JT=L(function(M5,KT){var M9=Gd(),L9=(e,t,r)=>M9(e,t,">",r);KT.exports=L9});var WT=L(function(L5,BT){var D9=Gd(),U9=(e,t,r)=>D9(e,t,"<",r);BT.exports=U9});var QT=L(function(D5,XT){var YT=ar(),F9=(e,t,r)=>(e=new YT(e,r),t=new YT(t,r),e.intersects(t,r));XT.exports=F9});var tI=L(function(U5,eI){var V9=Ta(),Z9=ir();eI.exports=(e,t,r)=>{let o=[],n=null,s=null,i=e.sort((l,d)=>Z9(l,d,r));for(let l of i)if(V9(l,t,r)){if(s=l,!n)n=l}else{if(s)o.push([n,s]);s=null,n=null}if(n)o.push([n,null]);let a=[];for(let[l,d]of o)if(l===d)a.push(l);else if(!d&&l===i[0])a.push("*");else if(!d)a.push(`>=${l}`);else if(l===i[0])a.push(`<=${d}`);else a.push(`${l} - ${d}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var aI=L(function(F5,iI){var rI=ar(),lg=za(),{ANY:cg}=lg,ug=Ta(),dg=ir(),H9=(e,t,r={})=>{if(e===t)return!0;e=new rI(e,r),t=new rI(t,r);let o=!1;e:for(let n of e.set){for(let s of t.set){let i=K9(n,s,r);if(o=o||i!==null,i)continue e}if(o)return!1}return!0},G9=[new lg(">=0.0.0-0")],oI=[new lg(">=0.0.0")],K9=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===cg)if(t.length===1&&t[0].semver===cg)return!0;else if(r.includePrerelease)e=G9;else e=oI;if(t.length===1&&t[0].semver===cg)if(r.includePrerelease)return!0;else t=oI;let o=new Set,n,s;for(let h of e)if(h.operator===">"||h.operator===">=")n=nI(n,h,r);else if(h.operator==="<"||h.operator==="<=")s=sI(s,h,r);else o.add(h.semver);if(o.size>1)return null;let i;if(n&&s){if(i=dg(n.semver,s.semver,r),i>0)return null;else if(i===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of o){if(n&&!ug(h,String(n),r))return null;if(s&&!ug(h,String(s),r))return null;for(let _ of t)if(!ug(h,String(_),r))return!1;return!0}let a,c,u,l,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;if(d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0)d=!1;for(let h of t){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",n){if(f){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch)f=!1}if(h.operator===">"||h.operator===">="){if(a=nI(n,h,r),a===h&&a!==n)return!1}else if(n.operator===">="&&!h.test(n.semver))return!1}if(s){if(d){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch)d=!1}if(h.operator==="<"||h.operator==="<="){if(c=sI(s,h,r),c===h&&c!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||n)&&i!==0)return!1}if(n&&u&&!s&&i!==0)return!1;if(s&&l&&!n&&i!==0)return!1;if(f||d)return!1;return!0},nI=(e,t,r)=>{if(!e)return t;let o=dg(e.semver,t.semver,r);return o>0?e:o<0?t:t.operator===">"&&e.operator===">="?t:e},sI=(e,t,r)=>{if(!e)return t;let o=dg(e.semver,t.semver,r);return o<0?e:o>0?t:t.operator==="<"&&e.operator==="<="?t:e};iI.exports=H9});var uI=L(function(V5,cI){var xs=Ns(),Kd=Cs(),J9=bt(),Jd=eg(),B9=Lo(),W9=OP(),Y9=NP(),X9=jP(),Q9=LP(),e4=UP(),t4=VP(),r4=HP(),o4=KP(),n4=ir(),s4=YP(),i4=QP(),a4=Md(),c4=oT(),u4=sT(),l4=Ra(),d4=Ld(),p4=rg(),f4=og(),m4=Dd(),h4=Ud(),g4=ng(),_4=mT(),y4=_T(),v4=za(),S4=ar(),b4=Ta(),$4=NT(),w4=AT(),R4=qT(),E4=DT(),z4=FT(),P4=Gd(),T4=JT(),I4=WT(),k4=QT(),O4=tI(),C4=aI();cI.exports={parse:B9,valid:W9,clean:Y9,inc:X9,diff:Q9,major:e4,minor:t4,patch:r4,prerelease:o4,compare:n4,rcompare:s4,compareLoose:i4,compareBuild:a4,sort:c4,rsort:u4,gt:l4,lt:d4,eq:p4,neq:f4,gte:m4,lte:h4,cmp:g4,coerce:_4,truncate:y4,Comparator:v4,Range:S4,satisfies:b4,toComparators:$4,maxSatisfying:w4,minSatisfying:R4,minVersion:E4,validRange:z4,outside:P4,gtr:T4,ltr:I4,intersects:k4,simplifyRange:O4,subset:C4,SemVer:J9,re:xs.re,src:xs.src,tokens:xs.t,SEMVER_SPEC_VERSION:Kd.SEMVER_SPEC_VERSION,RELEASE_TYPES:Kd.RELEASE_TYPES,compareIdentifiers:Jd.compareIdentifiers,rcompareIdentifiers:Jd.rcompareIdentifiers}});var{create:mk,defineProperty:Wa,getOwnPropertyDescriptor:hk,getOwnPropertyNames:gk,getPrototypeOf:_k}=Object,yk=Object.prototype.hasOwnProperty,H=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tg=(e,t)=>{let r={};for(var o in e)Wa(r,o,{get:e[o],enumerable:!0});if(t)Wa(r,Symbol.toStringTag,{value:"Module"});return r},vk=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=gk(t),s=0,i=n.length,a;s<i;s++)if(a=n[s],!yk.call(e,a)&&a!==r)Wa(e,a,{get:((c)=>t[c]).bind(null,a),enumerable:!(o=hk(t,a))||o.enumerable})}return e},Ya=(e,t,r)=>(r=e!=null?mk(_k(e)):{},vk(t||!e||!e.__esModule?Wa(r,"default",{value:e,enumerable:!0}):r,e));var Sk=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ig=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),bk=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),$k=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function kg(e){return typeof e==="string"&&Ig.has(e.replace(/#$/,""))}function Og(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(Sk.has(r))return"2020-12";if(Ig.has(r))return"2019-09";if(bk.has(r)||$k.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var op=Object.freeze({status:"aborted"});function U(e,t,r){function o(a,c){if(!a._zod)Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let f=l[d];if(!(f in a))a[f]=u[f].bind(a)}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}var wk=Symbol("zod_brand");class Lr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ui extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}var Xa={};function Kt(e){if(e)Object.assign(Xa,e);return Xa}function ec(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function sp(e,t="|"){return e.map((r)=>up(r)).join(t)}function li(e,t){if(typeof t==="bigint")return t.toString();return t}function di(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function tc(e){return e===null||e===void 0}function rc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ng(e,t){let r=(e.toString().split(".")[1]||"").length,o=t.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);if(c?.[1])n=Number.parseInt(c[1])}let s=r>n?r:n,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}var Cg=Symbol("evaluating");function Oe(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Cg)return;if(o===void 0)o=Cg,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Yo(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function eo(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function ip(e){return JSON.stringify(e)}function xg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ap="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Ag=di(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Xo(e){if(jn(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(jn(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function cp(e){if(Xo(e))return{...e};if(Array.isArray(e))return[...e];return e}var jg=new Set(["string","number","symbol"]);function to(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lr(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function ie(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function up(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function qg(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Mg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Rk(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=eo(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;i[a]=r.shape[a]}return Yo(this,"shape",i),i},checks:[]});return lr(e,s)}function Ek(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=eo(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;delete i[a]}return Yo(this,"shape",i),i},checks:[]});return lr(e,s)}function zk(e,t){if(!Xo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=eo(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Yo(this,"shape",s),s}});return lr(e,n)}function Pk(e,t){if(!Xo(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=eo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Yo(this,"shape",o),o}});return lr(e,r)}function Tk(e,t){let r=eo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Yo(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return lr(e,r)}function Ik(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=eo(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: "${u}"`);if(!r[u])continue;c[u]=e?new e({type:"optional",innerType:a[u]}):a[u]}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Yo(this,"shape",c),c},checks:[]});return lr(t,i)}function kk(e,t,r){let o=eo(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;s[i]=new e({type:"nonoptional",innerType:n[i]})}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Yo(this,"shape",s),s}});return lr(t,o)}function Qo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ro(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Qa(e){return typeof e==="string"?e:e?.message}function _r(e,t,r){let o={...e,path:e.path??[]};if(!e.message){let n=Qa(e.inst?._zod.def?.error?.(e))??Qa(t?.error?.(e))??Qa(r.customError?.(e))??Qa(r.localeError?.(e))??"Invalid input";o.message=n}if(delete o.inst,delete o.continue,!t?.reportInput)delete o.input;return o}function oc(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Lg(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function en(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}var Dg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,li,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},nc=U("$ZodError",Dg),lp=U("$ZodError",Dg,{Parent:Error});function dp(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function pp(e,t=(r)=>r.message){let r={_errors:[]},o=(n)=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((i)=>o({issues:i}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return o(e),r}var sc=(e)=>(t,r,o,n)=>{let s=o?Object.assign(o,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Lr;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map((c)=>_r(c,s,Kt())));throw ap(a,n?.callee),a}return i.value};var ic=(e)=>async(t,r,o,n)=>{let s=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)i=await i;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map((c)=>_r(c,s,Kt())));throw ap(a,n?.callee),a}return i.value};var pi=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Lr;return s.issues.length?{success:!1,error:new(e??nc)(s.issues.map((i)=>_r(i,n,Kt())))}:{success:!0,data:s.value}},Ug=pi(lp),fi=(e)=>async(t,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>_r(i,n,Kt())))}:{success:!0,data:s.value}},Fg=fi(lp),Vg=(e)=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return sc(e)(t,r,n)};var Zg=(e)=>(t,r,o)=>sc(e)(t,r,o);var Hg=(e)=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ic(e)(t,r,n)};var Gg=(e)=>async(t,r,o)=>ic(e)(t,r,o);var Kg=(e)=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pi(e)(t,r,n)};var Jg=(e)=>(t,r,o)=>pi(e)(t,r,o);var Bg=(e)=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return fi(e)(t,r,n)};var Wg=(e)=>async(t,r,o)=>fi(e)(t,r,o);var Yg=/^[cC][^\s-]{8,}$/,Xg=/^[0-9a-z]+$/,Qg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,e_=/^[0-9a-vA-V]{20}$/,t_=/^[A-Za-z0-9]{27}$/,r_=/^[a-zA-Z0-9_-]{21}$/,o_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var n_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fp=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var s_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ck="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function i_(){return new RegExp(Ck,"u")}var a_=/^(?:(?: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])$/,c_=/^(([0-9a-fA-F]{1,4}:){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}|:))$/;var u_=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,l_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,d_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mp=/^[A-Za-z0-9_-]*$/;var p_=/^\+[1-9]\d{6,14}$/,f_="(?:(?:\\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])))",m_=new RegExp(`^${f_}$`);function h_(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function g_(e){return new RegExp(`^${h_(e)}$`)}function __(e){let t=h_({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${f_}T(?:${o})$`)}var y_=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var v_=/^-?\d+$/,hp=/^-?\d+(?:\.\d+)?$/,S_=/^(?:true|false)$/i,b_=/^null$/i;var $_=/^[^A-Z]*$/,w_=/^[^a-z]*$/;var vt=U("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),R_={number:"number",bigint:"bigint",object:"date"},gp=U("$ZodCheckLessThan",(e,t)=>{vt.init(e,t);let r=R_[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_p=U("$ZodCheckGreaterThan",(e,t)=>{vt.init(e,t);let r=R_[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),E_=U("$ZodCheckMultipleOf",(e,t)=>{vt.init(e,t),e._zod.onattach.push((r)=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):Ng(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),z_=U("$ZodCheckNumberFormat",(e,t)=>{vt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Mg[t.format];e._zod.onattach.push((i)=>{let a=i._zod.bag;if(a.format=t.format,a.minimum=n,a.maximum=s,r)a.pattern=v_}),e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var P_=U("$ZodCheckMaxLength",(e,t)=>{var r;vt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!tc(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let i=oc(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),T_=U("$ZodCheckMinLength",(e,t)=>{var r;vt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!tc(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let i=oc(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),I_=U("$ZodCheckLengthEquals",(e,t)=>{var r;vt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!tc(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=(o)=>{let n=o.value,s=n.length;if(s===t.length)return;let i=oc(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),hi=U("$ZodCheckStringFormat",(e,t)=>{var r,o;if(vt.init(e,t),e._zod.onattach.push((n)=>{let s=n._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),k_=U("$ZodCheckRegex",(e,t)=>{hi.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),O_=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$_),hi.init(e,t)}),C_=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=w_),hi.init(e,t)}),N_=U("$ZodCheckIncludes",(e,t)=>{vt.init(e,t);let r=to(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push((n)=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),x_=U("$ZodCheckStartsWith",(e,t)=>{vt.init(e,t);let r=new RegExp(`^${to(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((o)=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),A_=U("$ZodCheckEndsWith",(e,t)=>{vt.init(e,t);let r=new RegExp(`.*${to(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((o)=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var j_=U("$ZodCheckOverwrite",(e,t)=>{vt.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class yp{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
10
+ `).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,o.join(`
11
+ `))}}var M_={major:4,minor:3,patch:6};var Me=U("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=M_;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,a,c)=>{let u=Qo(i),l;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(i))continue}else if(u)continue;let f=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new Lr;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await h,i.issues.length===f)return;if(!u)u=Qo(i,f)});else{if(i.issues.length===f)continue;if(!u)u=Qo(i,f)}}if(l)return l.then(()=>i);return i},s=(i,a,c)=>{if(Qo(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Lr;return u.then((l)=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>s(l,i,a));return s(u,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Lr;return c.then((u)=>n(u,o,a))}return n(c,o,a)}}Oe(e,"~standard",()=>({validate:(n)=>{try{let s=Ug(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return Fg(e,n).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),uc=U("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??y_(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ve=U("$ZodStringFormat",(e,t)=>{hi.init(e,t),uc.init(e,t)}),K_=U("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=n_),Ve.init(e,t)}),J_=U("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fp(o))}else t.pattern??(t.pattern=fp());Ve.init(e,t)}),B_=U("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=s_),Ve.init(e,t)}),W_=U("$ZodURL",(e,t)=>{Ve.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=new URL(o);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(n.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Y_=U("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=i_()),Ve.init(e,t)}),X_=U("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=r_),Ve.init(e,t)}),Q_=U("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Yg),Ve.init(e,t)}),ey=U("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Xg),Ve.init(e,t)}),ty=U("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qg),Ve.init(e,t)}),ry=U("$ZodXID",(e,t)=>{t.pattern??(t.pattern=e_),Ve.init(e,t)}),oy=U("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=t_),Ve.init(e,t)}),ny=U("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=__(t)),Ve.init(e,t)}),sy=U("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=m_),Ve.init(e,t)}),iy=U("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=g_(t)),Ve.init(e,t)}),ay=U("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o_),Ve.init(e,t)}),cy=U("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=a_),Ve.init(e,t),e._zod.bag.format="ipv4"}),uy=U("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=c_),Ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var ly=U("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=u_),Ve.init(e,t)}),dy=U("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=l_),Ve.init(e,t),e._zod.check=(r)=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[n,s]=o;if(!s)throw Error();let i=Number(s);if(`${i}`!==s)throw Error();if(i<0||i>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function py(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var fy=U("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=d_),Ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(py(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Nk(e){if(!mp.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return py(r)}var my=U("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mp),Ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(Nk(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),hy=U("$ZodE164",(e,t)=>{t.pattern??(t.pattern=p_),Ve.init(e,t)});function xk(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var gy=U("$ZodJWT",(e,t)=>{Ve.init(e,t),e._zod.check=(r)=>{if(xk(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Sp=U("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=e._zod.bag.pattern??hp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),_y=U("$ZodNumberFormat",(e,t)=>{z_.init(e,t),Sp.init(e,t)}),yy=U("$ZodBoolean",(e,t)=>{Me.init(e,t),e._zod.pattern=S_,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var vy=U("$ZodNull",(e,t)=>{Me.init(e,t),e._zod.pattern=b_,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Sy=U("$ZodAny",(e,t)=>{Me.init(e,t),e._zod.parse=(r)=>r}),by=U("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=(r)=>r}),$y=U("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function L_(e,t,r){if(e.issues.length)t.issues.push(...ro(r,e.issues));t.value[r]=e.value}var wy=U("$ZodArray",(e,t)=>{Me.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)s.push(c.then((u)=>L_(u,r,i)));else L_(c,r,i)}if(s.length)return Promise.all(s).then(()=>r);return r}});function cc(e,t,r,o,n){if(e.issues.length){if(n&&!(r in o))return;t.issues.push(...ro(r,e.issues))}if(e.value===void 0){if(r in o)t.value[r]=void 0}else t.value[r]=e.value}function Ry(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let r=qg(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Ey(e,t,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in t){if(a.has(d))continue;if(u==="never"){i.push(d);continue}let f=c.run({value:t[d],issues:[]},o);if(f instanceof Promise)e.push(f.then((h)=>cc(h,r,d,t,l)));else cc(f,r,d,t,l)}if(i.length)r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Ak=U("$ZodObject",(e,t)=>{if(Me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=di(()=>Ry(t));Oe(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=jn,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],d=i.shape;for(let f of i.keys){let h=d[f],_=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},c);if(g instanceof Promise)l.push(g.then((y)=>cc(y,a,f,u,_)));else cc(g,a,f,u,_)}if(!s)return l.length?Promise.all(l).then(()=>a):a;return Ey(l,u,a,c,o.value,e)}}),zy=U("$ZodObjectJIT",(e,t)=>{Ak.init(e,t);let r=e._zod.parse,o=di(()=>Ry(t)),n=(f)=>{let h=new yp(["shape","payload","ctx"]),_=o.value,g=(v)=>{let w=ip(v);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),m=0;for(let v of _.keys)y[v]=`key_${m++}`;h.write("const newResult = {};");for(let v of _.keys){let w=y[v],P=ip(v),b=f[v]?._zod?.optout==="optional";if(h.write(`const ${w} = ${g(v)};`),b)h.write(`
12
+ if (${w}.issues.length) {
13
+ if (${P} in input) {
14
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${w}.value === undefined) {
22
+ if (${P} in input) {
23
+ newResult[${P}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${P}] = ${w}.value;
27
+ }
28
+
29
+ `);else h.write(`
30
+ if (${w}.issues.length) {
31
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
34
+ })));
35
+ }
36
+
37
+ if (${w}.value === undefined) {
38
+ if (${P} in input) {
39
+ newResult[${P}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${P}] = ${w}.value;
43
+ }
44
+
45
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");let S=h.compile();return(v,w)=>S(f,v,w)},s,i=jn,a=!Xa.jitless,u=a&&Ag.value,l=t.catchall,d;e._zod.parse=(f,h)=>{d??(d=o.value);let _=f.value;if(!i(_))return f.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),f;if(a&&u&&h?.async===!1&&h.jitless!==!0){if(!s)s=n(t.shape);if(f=s(f,h),!l)return f;return Ey([],_,f,h,d,e)}return r(f,h)}});function D_(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter((s)=>!Qo(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>_r(i,o,Kt())))}),t}var bp=U("$ZodUnion",(e,t)=>{Me.init(e,t),Oe(e._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),Oe(e._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),Oe(e._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),Oe(e._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>rc(s.source)).join("|")})$`)}return});let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,s)=>{if(r)return o(n,s);let i=!1,a=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}if(!i)return D_(a,n,e,s);return Promise.all(a).then((c)=>D_(c,n,e,s))}});var Py=U("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bp.init(e,t);let r=e._zod.parse;Oe(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){if(!n[a])n[a]=new Set;for(let u of c)n[a].add(u)}}return n});let o=di(()=>{let n=t.options,s=new Map;for(let i of n){let a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!jn(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=o.value.get(i?.[t.discriminator]);if(a)return a._zod.run(n,s);if(t.unionFallback)return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),n}}),Ty=U("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>U_(r,c,u));return U_(r,s,i)}});function vp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Xo(e)&&Xo(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};for(let s of o){let i=vp(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=vp(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function U_(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n)e.issues.push({...n,keys:s});if(Qo(e))return e;let i=vp(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Iy=U("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Xo(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],i=t.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u==="string"||typeof u==="number"||typeof u==="symbol"){a.add(typeof u==="number"?u.toString():u);let l=t.valueType._zod.run({value:n[u],issues:[]},o);if(l instanceof Promise)s.push(l.then((d)=>{if(d.issues.length)r.issues.push(...ro(u,d.issues));r.value[u]=d.value}));else{if(l.issues.length)r.issues.push(...ro(u,l.issues));r.value[u]=l.value}}let c;for(let u in n)if(!a.has(u))c=c??[],c.push(u);if(c&&c.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a==="string"&&hp.test(a)&&c.issues.length){let d=t.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length===0)c=d}if(c.issues.length){if(t.mode==="loose")r.value[a]=n[a];else r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((d)=>_r(d,o,Kt())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);if(l instanceof Promise)s.push(l.then((d)=>{if(d.issues.length)r.issues.push(...ro(a,d.issues));r.value[c.value]=d.value}));else{if(l.issues.length)r.issues.push(...ro(a,l.issues));r.value[c.value]=l.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var ky=U("$ZodEnum",(e,t)=>{Me.init(e,t);let r=ec(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>jg.has(typeof n)).map((n)=>typeof n==="string"?to(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Oy=U("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map((o)=>typeof o==="string"?to(o):o?to(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Cy=U("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ui(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((i)=>(r.value=i,r));if(n instanceof Promise)throw new Lr;return r.value=n,r}});function F_(e,t){if(e.issues.length&&t===void 0)return{issues:[],value:void 0};return e}var $p=U("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Oe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${rc(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>F_(s,r.value));return F_(n,r.value)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),Ny=U("$ZodExactOptional",(e,t)=>{$p.init(e,t),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),xy=U("$ZodNullable",(e,t)=>{Me.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${rc(r.source)}|null)$`):void 0}),Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Ay=U("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>V_(s,t));return V_(n,t)}});function V_(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var jy=U("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),qy=U("$ZodNonOptional",(e,t)=>{Me.init(e,t),Oe(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Z_(s,e));return Z_(n,e)}});function Z_(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var My=U("$ZodCatch",(e,t)=>{Me.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>{if(r.value=s.value,s.issues.length)r.value=t.catchValue({...r,error:{issues:s.issues.map((i)=>_r(i,o,Kt()))},input:r.value}),r.issues=[];return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((s)=>_r(s,o,Kt()))},input:r.value}),r.issues=[];return r}});var Ly=U("$ZodPipe",(e,t)=>{Me.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>ac(i,t.in,o));return ac(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>ac(s,t.out,o));return ac(n,t.out,o)}});function ac(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Dy=U("$ZodReadonly",(e,t)=>{Me.init(e,t),Oe(e._zod,"propValues",()=>t.innerType._zod.propValues),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"optin",()=>t.innerType?._zod?.optin),Oe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(H_);return H_(n)}});function H_(e){return e.value=Object.freeze(e.value),e}var Uy=U("$ZodLazy",(e,t)=>{Me.init(e,t),Oe(e._zod,"innerType",()=>t.getter()),Oe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Oe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Oe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Oe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Fy=U("$ZodCustom",(e,t)=>{vt.init(e,t),Me.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((s)=>G_(s,r,o,e));G_(n,r,o,e);return}});function G_(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(en(n))}}var jk=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=Lg(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${up(n.values[0])}`;return`Invalid option: expected one of ${sp(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);if(i)return`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);if(i)return`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`;return`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${sp(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function wp(){return{localeError:jk()}}var Vy,qk=Symbol("ZodOutput"),Mk=Symbol("ZodInput");class Zy{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Hy(){return new Zy}(Vy=globalThis).__zod_globalRegistry??(Vy.__zod_globalRegistry=Hy());var oo=globalThis.__zod_globalRegistry;function Gy(e,t){return new e({type:"string",...ie(t)})}function Rp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function Ep(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function Ky(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function Jy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function By(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function Wy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function zp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function Yy(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function Xy(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function Qy(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function ev(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function tv(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function rv(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function ov(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function nv(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function sv(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function iv(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function av(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function cv(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function uv(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function lv(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function dv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function pv(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function fv(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function mv(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function hv(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function gv(e,t){return new e({type:"number",checks:[],...ie(t)})}function _v(e,t){return new e({type:"number",coerce:!0,checks:[],...ie(t)})}function yv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function vv(e,t){return new e({type:"boolean",...ie(t)})}function Sv(e,t){return new e({type:"null",...ie(t)})}function bv(e){return new e({type:"any"})}function $v(e){return new e({type:"unknown"})}function wv(e,t){return new e({type:"never",...ie(t)})}function lc(e,t){return new gp({check:"less_than",...ie(t),value:e,inclusive:!1})}function gi(e,t){return new gp({check:"less_than",...ie(t),value:e,inclusive:!0})}function dc(e,t){return new _p({check:"greater_than",...ie(t),value:e,inclusive:!1})}function _i(e,t){return new _p({check:"greater_than",...ie(t),value:e,inclusive:!0})}function pc(e,t){return new E_({check:"multiple_of",...ie(t),value:e})}function fc(e,t){return new P_({check:"max_length",...ie(t),maximum:e})}function qn(e,t){return new T_({check:"min_length",...ie(t),minimum:e})}function mc(e,t){return new I_({check:"length_equals",...ie(t),length:e})}function Pp(e,t){return new k_({check:"string_format",format:"regex",...ie(t),pattern:e})}function Tp(e){return new O_({check:"string_format",format:"lowercase",...ie(e)})}function Ip(e){return new C_({check:"string_format",format:"uppercase",...ie(e)})}function kp(e,t){return new N_({check:"string_format",format:"includes",...ie(t),includes:e})}function Op(e,t){return new x_({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function Cp(e,t){return new A_({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function no(e){return new j_({check:"overwrite",tx:e})}function Np(e){return no((t)=>t.normalize(e))}function xp(){return no((e)=>e.trim())}function Ap(){return no((e)=>e.toLowerCase())}function jp(){return no((e)=>e.toUpperCase())}function qp(){return no((e)=>xg(e))}function Rv(e,t,r){return new e({type:"array",element:t,...ie(r)})}function Ev(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ie(r)})}function zv(e){let t=Lk((r)=>(r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(en(o,r.value,t._zod.def));else{let n=o;if(n.fatal)n.continue=!1;n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(en(n))}},e(r.value,r)));return t}function Lk(e,t){let r=new vt({check:"custom",...ie(t)});return r._zod.check=e,r}function vi(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??oo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Le(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let f=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,f,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Le(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(i.schema,c);if(t.io==="input"&&Ct(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&i.schema._prefault)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Si(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,f=e.external.uri??((_)=>_);if(d)return{ref:f(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===r)return{ref:"#"};let u=`${"#"}/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
46
+
47
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref"){s(i);continue}}}}function bi(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(i)=>{let a=e.seen.get(i);if(a.ref===null)return;let c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){o(l);let f=e.seen.get(l),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))c.allOf=c.allOf??[],c.allOf.push(h);else Object.assign(c,h);if(Object.assign(c,u),i._zod.parent===l)for(let g in c){if(g==="$ref"||g==="allOf")continue;if(!(g in u))delete c[g]}if(h.$ref&&f.def)for(let g in c){if(g==="$ref"||g==="allOf")continue;if(g in f.def&&JSON.stringify(c[g])===JSON.stringify(f.def[g]))delete c[g]}}let d=i._zod.parent;if(d&&d!==l){o(d);let f=e.seen.get(d);if(f?.schema.$ref){if(c.$ref=f.schema.$ref,f.def)for(let h in c){if(h==="$ref"||h==="allOf")continue;if(h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h]))delete c[h]}}}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(let i of[...e.seen.entries()].reverse())o(i[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let i=e.external.registry.get(t)?.id;if(!i)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(i)}Object.assign(n,r.def??r.schema);let s=e.external?.defs??{};for(let i of e.seen.entries()){let a=i[1];if(a.def&&a.defId)s[a.defId]=a.def}if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let i=JSON.parse(JSON.stringify(n));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:yi(t,"input",e.processors),output:yi(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch(i){throw Error("Error converting schema to JSON.")}}function Ct(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ct(o.element,r);if(o.type==="set")return Ct(o.valueType,r);if(o.type==="lazy")return Ct(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ct(o.innerType,r);if(o.type==="intersection")return Ct(o.left,r)||Ct(o.right,r);if(o.type==="record"||o.type==="map")return Ct(o.keyType,r)||Ct(o.valueType,r);if(o.type==="pipe")return Ct(o.in,r)||Ct(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ct(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ct(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ct(n,r))return!0;if(o.rest&&Ct(o.rest,r))return!0;return!1}return!1}var Pv=(e,t={})=>(r)=>{let o=vi({...r,processors:t});return Le(e,o),Si(o,e),bi(o,e)},yi=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=vi({...n??{},target:s,io:t,processors:r});return Le(e,i),Si(i,e),bi(i,e)};var Dk={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mp=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=Dk[a]??a,n.format==="")delete n.format;if(a==="time")delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let l=[...c];if(l.length===1)n.pattern=l[0].source;else if(l.length>1)n.allOf=[...l.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Lp=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;if(typeof a==="string"&&a.includes("int"))n.type="integer";else n.type="number";if(typeof l==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.minimum=l,n.exclusiveMinimum=!0;else n.exclusiveMinimum=l;if(typeof s==="number"){if(n.minimum=s,typeof l==="number"&&t.target!=="draft-04")if(l>=s)delete n.minimum;else delete n.exclusiveMinimum}if(typeof u==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.maximum=u,n.exclusiveMaximum=!0;else n.exclusiveMaximum=u;if(typeof i==="number"){if(n.maximum=i,typeof u==="number"&&t.target!=="draft-04")if(u<=i)delete n.maximum;else delete n.exclusiveMaximum}if(typeof c==="number")n.multipleOf=c},Dp=(e,t,r,o)=>{r.type="boolean"},Iv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},kv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Up=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Ov=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Cv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Fp=(e,t,r,o)=>{r.not={}},Vp=(e,t,r,o)=>{},Zp=(e,t,r,o)=>{},Nv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Hp=(e,t,r,o)=>{let n=e._zod.def,s=ec(n.entries);if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gp=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(i));else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}},xv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},Av=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},jv=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:a,mime:c}=e._zod.bag;if(i!==void 0)s.minLength=i;if(a!==void 0)s.maxLength=a;if(c)if(c.length===1)s.contentMediaType=c[0],Object.assign(n,s);else Object.assign(n,s),n.anyOf=c.map((u)=>({contentMediaType:u}));else Object.assign(n,s)},qv=(e,t,r,o)=>{r.type="boolean"},Kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},Mv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Jp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Lv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Dv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Bp=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Le(s.element,t,{...o,path:[...o.path,"items"]})},Wp=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=Le(i[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter((u)=>{let l=s.shape[u]._zod;if(t.io==="input")return l.optin===void 0;else return l.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Le(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Yp=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Le(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},Xp=(e,t,r,o)=>{let n=e._zod.def,s=Le(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Le(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c},Uv=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,h)=>Le(f,t,{...o,path:[...o.path,i,h]})),u=s.rest?Le(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=c,u)n.items=u}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(n.minItems=c.length,!u)n.maxItems=c.length}else if(n.items=c,u)n.additionalItems=u;let{minimum:l,maximum:d}=e._zod.bag;if(typeof l==="number")n.minItems=l;if(typeof d==="number")n.maxItems=d},Qp=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Le(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=Le(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});n.additionalProperties=Le(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let u=i._zod.values;if(u){let l=[...u].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l}},ef=(e,t,r,o)=>{let n=e._zod.def,s=Le(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},tf=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},rf=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},of=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},nf=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},sf=(e,t,r,o)=>{let n=e._zod.def,s=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Le(s,t,o);let i=t.seen.get(e);i.ref=s},af=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Fv=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},hc=(e,t,r,o)=>{let n=e._zod.def;Le(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},cf=(e,t,r,o)=>{let n=e._zod.innerType;Le(n,t,o);let s=t.seen.get(e);s.ref=n},Tv={string:Mp,number:Lp,boolean:Dp,bigint:Iv,symbol:kv,null:Up,undefined:Ov,void:Cv,never:Fp,any:Vp,unknown:Zp,date:Nv,enum:Hp,literal:Gp,nan:xv,template_literal:Av,file:jv,success:qv,custom:Kp,function:Mv,transform:Jp,map:Lv,set:Dv,array:Bp,object:Wp,union:Yp,intersection:Xp,tuple:Uv,record:Qp,nullable:ef,nonoptional:tf,default:rf,prefault:of,catch:nf,pipe:sf,readonly:af,promise:Fv,optional:hc,lazy:cf};function gc(e,t){if("_idmap"in e){let o=e,n=vi({...t,processors:Tv}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Le(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;Si(n,l),i[u]=bi(n,l)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=vi({...t,processors:Tv});return Le(e,r),Si(r,e),bi(r,e)}var Jk=U("ZodISODateTime",(e,t)=>{ny.init(e,t),Ge.init(e,t)});function Ln(e){return pv(Jk,e)}var Bk=U("ZodISODate",(e,t)=>{sy.init(e,t),Ge.init(e,t)});function uf(e){return fv(Bk,e)}var Wk=U("ZodISOTime",(e,t)=>{iy.init(e,t),Ge.init(e,t)});function Vv(e){return mv(Wk,e)}var Yk=U("ZodISODuration",(e,t)=>{ay.init(e,t),Ge.init(e,t)});function Zv(e){return hv(Yk,e)}var Gv=(e,t)=>{nc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>pp(e,r)},flatten:{value:(r)=>dp(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,li,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,li,2)}},isEmpty:{get(){return e.issues.length===0}}})},ZH=U("ZodError",Gv),Jt=U("ZodError",Gv,{Parent:Error});var Kv=sc(Jt),Jv=ic(Jt),yc=pi(Jt),Bv=fi(Jt),Wv=Vg(Jt),Yv=Zg(Jt),Xv=Hg(Jt),Qv=Gg(Jt),eS=Kg(Jt),tS=Jg(Jt),rS=Bg(Jt),oS=Wg(Jt);var Fe=U("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:yi(e,"input"),output:yi(e,"output")}}),e.toJSONSchema=Pv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(eo(t,{checks:[...t.checks??[],...r.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>lr(e,r,o),e.brand=()=>e,e.register=(r,o)=>(r.add(e,o),e),e.parse=(r,o)=>Kv(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>yc(e,r,o),e.parseAsync=async(r,o)=>Jv(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Bv(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Wv(e,r,o),e.decode=(r,o)=>Yv(e,r,o),e.encodeAsync=async(r,o)=>Xv(e,r,o),e.decodeAsync=async(r,o)=>Qv(e,r,o),e.safeEncode=(r,o)=>eS(e,r,o),e.safeDecode=(r,o)=>tS(e,r,o),e.safeEncodeAsync=async(r,o)=>rS(e,r,o),e.safeDecodeAsync=async(r,o)=>oS(e,r,o),e.refine=(r,o)=>e.check(UO(r,o)),e.superRefine=(r)=>e.check(FO(r)),e.overwrite=(r)=>e.check(no(r)),e.optional=()=>ae(e),e.exactOptional=()=>PO(e),e.nullable=()=>iS(e),e.nullish=()=>ae(iS(e)),e.nonoptional=(r)=>NO(e,r),e.array=()=>x(e),e.or=(r)=>te([e,r]),e.and=(r)=>Dr(e,r),e.transform=(r)=>df(e,gS(r)),e.default=(r)=>kO(e,r),e.prefault=(r)=>CO(e,r),e.catch=(r)=>AO(e,r),e.pipe=(r)=>df(e,r),e.readonly=()=>MO(e),e.describe=(r)=>{let o=e.clone();return oo.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return oo.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return oo.get(e);let o=e.clone();return oo.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=(r)=>r(e),e)),aS=U("_ZodString",(e,t)=>{uc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Mp(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Pp(...o)),e.includes=(...o)=>e.check(kp(...o)),e.startsWith=(...o)=>e.check(Op(...o)),e.endsWith=(...o)=>e.check(Cp(...o)),e.min=(...o)=>e.check(qn(...o)),e.max=(...o)=>e.check(fc(...o)),e.length=(...o)=>e.check(mc(...o)),e.nonempty=(...o)=>e.check(qn(1,...o)),e.lowercase=(o)=>e.check(Tp(o)),e.uppercase=(o)=>e.check(Ip(o)),e.trim=()=>e.check(xp()),e.normalize=(...o)=>e.check(Np(...o)),e.toLowerCase=()=>e.check(Ap()),e.toUpperCase=()=>e.check(jp()),e.slugify=()=>e.check(qp())}),cS=U("ZodString",(e,t)=>{uc.init(e,t),aS.init(e,t),e.email=(r)=>e.check(Rp(uS,r)),e.url=(r)=>e.check(zp(dS,r)),e.jwt=(r)=>e.check(dv(fO,r)),e.emoji=(r)=>e.check(Yy(Qk,r)),e.guid=(r)=>e.check(Ep(nS,r)),e.uuid=(r)=>e.check(Ky(vc,r)),e.uuidv4=(r)=>e.check(Jy(vc,r)),e.uuidv6=(r)=>e.check(By(vc,r)),e.uuidv7=(r)=>e.check(Wy(vc,r)),e.nanoid=(r)=>e.check(Xy(eO,r)),e.guid=(r)=>e.check(Ep(nS,r)),e.cuid=(r)=>e.check(Qy(tO,r)),e.cuid2=(r)=>e.check(ev(rO,r)),e.ulid=(r)=>e.check(tv(oO,r)),e.base64=(r)=>e.check(cv(lO,r)),e.base64url=(r)=>e.check(uv(dO,r)),e.xid=(r)=>e.check(rv(nO,r)),e.ksuid=(r)=>e.check(ov(sO,r)),e.ipv4=(r)=>e.check(nv(iO,r)),e.ipv6=(r)=>e.check(sv(aO,r)),e.cidrv4=(r)=>e.check(iv(cO,r)),e.cidrv6=(r)=>e.check(av(uO,r)),e.e164=(r)=>e.check(lv(pO,r)),e.datetime=(r)=>e.check(Ln(r)),e.date=(r)=>e.check(uf(r)),e.time=(r)=>e.check(Vv(r)),e.duration=(r)=>e.check(Zv(r))});function p(e){return Gy(cS,e)}var Ge=U("ZodStringFormat",(e,t)=>{Ve.init(e,t),aS.init(e,t)}),uS=U("ZodEmail",(e,t)=>{B_.init(e,t),Ge.init(e,t)});function lS(e){return Rp(uS,e)}var nS=U("ZodGUID",(e,t)=>{K_.init(e,t),Ge.init(e,t)});var vc=U("ZodUUID",(e,t)=>{J_.init(e,t),Ge.init(e,t)});var dS=U("ZodURL",(e,t)=>{W_.init(e,t),Ge.init(e,t)});function Sc(e){return zp(dS,e)}var Qk=U("ZodEmoji",(e,t)=>{Y_.init(e,t),Ge.init(e,t)});var eO=U("ZodNanoID",(e,t)=>{X_.init(e,t),Ge.init(e,t)});var tO=U("ZodCUID",(e,t)=>{Q_.init(e,t),Ge.init(e,t)});var rO=U("ZodCUID2",(e,t)=>{ey.init(e,t),Ge.init(e,t)});var oO=U("ZodULID",(e,t)=>{ty.init(e,t),Ge.init(e,t)});var nO=U("ZodXID",(e,t)=>{ry.init(e,t),Ge.init(e,t)});var sO=U("ZodKSUID",(e,t)=>{oy.init(e,t),Ge.init(e,t)});var iO=U("ZodIPv4",(e,t)=>{cy.init(e,t),Ge.init(e,t)});var aO=U("ZodIPv6",(e,t)=>{uy.init(e,t),Ge.init(e,t)});var cO=U("ZodCIDRv4",(e,t)=>{ly.init(e,t),Ge.init(e,t)});var uO=U("ZodCIDRv6",(e,t)=>{dy.init(e,t),Ge.init(e,t)});var lO=U("ZodBase64",(e,t)=>{fy.init(e,t),Ge.init(e,t)});var dO=U("ZodBase64URL",(e,t)=>{my.init(e,t),Ge.init(e,t)});var pO=U("ZodE164",(e,t)=>{hy.init(e,t),Ge.init(e,t)});var fO=U("ZodJWT",(e,t)=>{gy.init(e,t),Ge.init(e,t)});var bc=U("ZodNumber",(e,t)=>{Sp.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Lp(e,o,n,s),e.gt=(o,n)=>e.check(dc(o,n)),e.gte=(o,n)=>e.check(_i(o,n)),e.min=(o,n)=>e.check(_i(o,n)),e.lt=(o,n)=>e.check(lc(o,n)),e.lte=(o,n)=>e.check(gi(o,n)),e.max=(o,n)=>e.check(gi(o,n)),e.int=(o)=>e.check(sS(o)),e.safe=(o)=>e.check(sS(o)),e.positive=(o)=>e.check(dc(0,o)),e.nonnegative=(o)=>e.check(_i(0,o)),e.negative=(o)=>e.check(lc(0,o)),e.nonpositive=(o)=>e.check(gi(0,o)),e.multipleOf=(o,n)=>e.check(pc(o,n)),e.step=(o,n)=>e.check(pc(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function G(e){return gv(bc,e)}var mO=U("ZodNumberFormat",(e,t)=>{_y.init(e,t),bc.init(e,t)});function sS(e){return yv(mO,e)}var pS=U("ZodBoolean",(e,t)=>{yy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dp(e,r,o,n)});function Q(e){return vv(pS,e)}var hO=U("ZodNull",(e,t)=>{vy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Up(e,r,o,n)});function tn(e){return Sv(hO,e)}var gO=U("ZodAny",(e,t)=>{Sy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n)});function fS(){return bv(gO)}var _O=U("ZodUnknown",(e,t)=>{by.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n)});function ce(){return $v(_O)}var yO=U("ZodNever",(e,t)=>{$y.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n)});function vO(e){return wv(yO,e)}var SO=U("ZodArray",(e,t)=>{wy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bp(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(qn(r,o)),e.nonempty=(r)=>e.check(qn(1,r)),e.max=(r,o)=>e.check(fc(r,o)),e.length=(r,o)=>e.check(mc(r,o)),e.unwrap=()=>e.element});function x(e,t){return Rv(SO,e,t)}var mS=U("ZodObject",(e,t)=>{zy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(e,r,o,n),Oe(e,"shape",()=>t.shape),e.keyof=()=>fe(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ce()}),e.loose=()=>e.clone({...e._zod.def,catchall:ce()}),e.strict=()=>e.clone({...e._zod.def,catchall:vO()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>zk(e,r),e.safeExtend=(r)=>Pk(e,r),e.merge=(r)=>Tk(e,r),e.pick=(r)=>Rk(e,r),e.omit=(r)=>Ek(e,r),e.partial=(...r)=>Ik(_S,e,r[0]),e.required=(...r)=>kk(yS,e,r[0])});function T(e,t){let r={type:"object",shape:e??{},...ie(t)};return new mS(r)}function de(e,t){return new mS({type:"object",shape:e,catchall:ce(),...ie(t)})}var hS=U("ZodUnion",(e,t)=>{bp.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n),e.options=t.options});function te(e,t){return new hS({type:"union",options:e,...ie(t)})}var bO=U("ZodDiscriminatedUnion",(e,t)=>{hS.init(e,t),Py.init(e,t)});function Dn(e,t,r){return new bO({type:"union",options:t,discriminator:e,...ie(r)})}var $O=U("ZodIntersection",(e,t)=>{Ty.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xp(e,r,o,n)});function Dr(e,t){return new $O({type:"intersection",left:e,right:t})}var wO=U("ZodRecord",(e,t)=>{Iy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ee(e,t,r){return new wO({type:"record",keyType:e,valueType:t,...ie(r)})}var lf=U("ZodEnum",(e,t)=>{ky.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Hp(e,o,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new lf({...t,checks:[],...ie(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new lf({...t,checks:[],...ie(n),entries:s})}});function fe(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new lf({type:"enum",entries:r,...ie(t)})}var RO=U("ZodLiteral",(e,t)=>{Oy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gp(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function A(e,t){return new RO({type:"literal",values:Array.isArray(e)?e:[e],...ie(t)})}var EO=U("ZodTransform",(e,t)=>{Cy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jp(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ui(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(en(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(en(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function gS(e){return new EO({type:"transform",transform:e})}var _S=U("ZodOptional",(e,t)=>{$p.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ae(e){return new _S({type:"optional",innerType:e})}var zO=U("ZodExactOptional",(e,t)=>{Ny.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function PO(e){return new zO({type:"optional",innerType:e})}var TO=U("ZodNullable",(e,t)=>{xy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ef(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function iS(e){return new TO({type:"nullable",innerType:e})}var IO=U("ZodDefault",(e,t)=>{Ay.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kO(e,t){return new IO({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():cp(t)}})}var OO=U("ZodPrefault",(e,t)=>{jy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>of(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function CO(e,t){return new OO({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():cp(t)}})}var yS=U("ZodNonOptional",(e,t)=>{qy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function NO(e,t){return new yS({type:"nonoptional",innerType:e,...ie(t)})}var xO=U("ZodCatch",(e,t)=>{My.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AO(e,t){return new xO({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var jO=U("ZodPipe",(e,t)=>{Ly.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sf(e,r,o,n),e.in=t.in,e.out=t.out});function df(e,t){return new jO({type:"pipe",in:e,out:t})}var qO=U("ZodReadonly",(e,t)=>{Dy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>af(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function MO(e){return new qO({type:"readonly",innerType:e})}var LO=U("ZodLazy",(e,t)=>{Uy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function $i(e){return new LO({type:"lazy",getter:e})}var DO=U("ZodCustom",(e,t)=>{Fy.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n)});function UO(e,t={}){return Ev(DO,e,t)}function FO(e){return zv(e)}function rn(e,t){return df(gS(e),t)}var SS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var vS;(function(e){})(vS||(vS={}));function VO(e){return _v(bc,e)}Kt(wp());var nn="2025-11-25";var $c=[nn,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],wc="io.modelcontextprotocol/related-task",Fr="io.modelcontextprotocol/protocolVersion",Un="io.modelcontextprotocol/clientInfo",Sr="io.modelcontextprotocol/serverInfo",Vr="io.modelcontextprotocol/clientCapabilities",sn="io.modelcontextprotocol/subscriptionId",io="io.modelcontextprotocol/logLevel";var an="2.0";var so=$i(()=>te([p(),G(),Q(),tn(),ee(p(),so),x(so)])),We=ee(p(),so),ff=x(so),wi=te([p(),G().int()]),Ri=p(),Rc=T({ttl:G().optional()}),Ec=T({taskId:p()}),Ei=de({progressToken:wi.optional(),[wc]:Ec.optional()}),gt=T({_meta:Ei.optional()}),cn=gt.extend({task:Rc.optional()}),Ye=T({method:p(),params:gt.loose().optional()}),zt=T({_meta:Ei.optional()}),Pt=T({method:p(),params:zt.loose().optional()}),zi=de({get[Sr](){return Zn.optional().catch(void 0)}}),Xe=de({_meta:zi.optional()}),ao=te([p(),G().int()]),Pi=T({jsonrpc:A(an),id:ao,...Ye.shape}).strict(),Ti=T({jsonrpc:A(an),...Pt.shape}).strict(),Fn=T({jsonrpc:A(an),id:ao,result:Xe}).strict(),Vn=T({jsonrpc:A(an),id:ao.optional(),error:T({code:G().int(),message:p(),data:ce().optional()})}).strict(),Ii=te([Pi,Ti,Fn,Vn]),mf=te([Fn,Vn]),ki=Xe.strict(),zc=zt.extend({requestId:ao.optional(),reason:p().optional()}),Oi=Pt.extend({method:A("notifications/cancelled"),params:zc}),Pc=T({src:p(),mimeType:p().optional(),sizes:x(p()).optional(),theme:fe(["light","dark"]).optional()}),co=T({icons:x(Pc).optional()}),Ur=T({name:p(),title:p().optional()}),Zn=Ur.extend({...Ur.shape,...co.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),HO=Dr(T({applyDefaults:Q().optional()}),We),GO=rn((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Dr(T({form:HO.optional(),url:We.optional()}),We.optional())),Tc=de({list:We.optional(),cancel:We.optional(),requests:de({sampling:de({createMessage:We.optional()}).optional(),elicitation:de({create:We.optional()}).optional()}).optional()}),Ic=de({list:We.optional(),cancel:We.optional(),requests:de({tools:de({call:We.optional()}).optional()}).optional()}),kc=T({experimental:ee(p(),We).optional(),sampling:T({context:We.optional(),tools:We.optional()}).optional(),elicitation:GO.optional(),roots:T({listChanged:Q().optional()}).optional(),tasks:Tc.optional(),extensions:ee(p(),We).optional()}),Oc=gt.extend({protocolVersion:p(),capabilities:kc,clientInfo:Zn}),Cc=Ye.extend({method:A("initialize"),params:Oc}),Ci=T({experimental:ee(p(),We).optional(),logging:We.optional(),completions:We.optional(),prompts:T({listChanged:Q().optional()}).optional(),resources:T({subscribe:Q().optional(),listChanged:Q().optional()}).optional(),tools:T({listChanged:Q().optional()}).optional(),tasks:Ic.optional(),extensions:ee(p(),We).optional()}),Nc=Xe.extend({protocolVersion:p(),capabilities:Ci,serverInfo:Zn,instructions:p().optional()}),xc=Pt.extend({method:A("notifications/initialized"),params:zt.optional()}),Ac=Ye.extend({method:A("server/discover"),params:gt.optional()}),jc=Xe.extend({supportedVersions:x(p()),capabilities:Ci,instructions:p().optional()}),Ni=Ye.extend({method:A("ping"),params:gt.optional()}),qc=T({progress:G(),total:ae(G()),message:ae(p())}),Mc=T({...zt.shape,...qc.shape,progressToken:wi}),xi=Pt.extend({method:A("notifications/progress"),params:Mc}),Lc=gt.extend({cursor:Ri.optional()}),uo=Ye.extend({params:Lc.optional()}),lo=Xe.extend({nextCursor:Ri.optional()}),Ai=T({uri:p(),mimeType:ae(p()),_meta:ee(p(),ce()).optional()}),ji=Ai.extend({text:p()}),hf=p().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),qi=Ai.extend({blob:hf}),po=fe(["user","assistant"]),Zr=T({audience:x(po).optional(),priority:G().min(0).max(1).optional(),lastModified:Ln({offset:!0}).optional()}),Mi=T({...Ur.shape,...co.shape,uri:p(),description:ae(p()),mimeType:ae(p()),size:ae(G()),annotations:Zr.optional(),_meta:ae(de({}))}),Dc=T({...Ur.shape,...co.shape,uriTemplate:p(),description:ae(p()),mimeType:ae(p()),annotations:Zr.optional(),_meta:ae(de({}))}),Uc=uo.extend({method:A("resources/list")}),Fc=lo.extend({resources:x(Mi)}),Vc=uo.extend({method:A("resources/templates/list")}),Zc=lo.extend({resourceTemplates:x(Dc)}),Hn=gt.extend({uri:p()}),Hc=Hn,Gc=Ye.extend({method:A("resources/read"),params:Hc}),Kc=Xe.extend({contents:x(te([ji,qi]))}),Jc=Pt.extend({method:A("notifications/resources/list_changed"),params:zt.optional()}),Bc=Hn,Wc=Ye.extend({method:A("resources/subscribe"),params:Bc}),Yc=Hn,Xc=Ye.extend({method:A("resources/unsubscribe"),params:Yc}),Li=T({toolsListChanged:Q().optional(),promptsListChanged:Q().optional(),resourcesListChanged:Q().optional(),resourceSubscriptions:x(p()).optional()}),Qc=gt.extend({notifications:Li}),eu=Ye.extend({method:A("subscriptions/listen"),params:Qc}),tu=zt.extend({notifications:Li}),ru=Pt.extend({method:A("notifications/subscriptions/acknowledged"),params:tu}),ou=zi.extend({[sn]:ao}),nu=Xe.extend({_meta:ou}),su=zt.extend({uri:p()}),iu=Pt.extend({method:A("notifications/resources/updated"),params:su}),au=T({name:p(),description:ae(p()),required:ae(Q())}),cu=T({...Ur.shape,...co.shape,description:ae(p()),arguments:ae(x(au)),_meta:ae(de({}))}),uu=uo.extend({method:A("prompts/list")}),lu=lo.extend({prompts:x(cu)}),du=gt.extend({name:p(),arguments:ee(p(),p()).optional()}),pu=Ye.extend({method:A("prompts/get"),params:du}),Gn=T({type:A("text"),text:p(),annotations:Zr.optional(),_meta:ee(p(),ce()).optional()}),Kn=T({type:A("image"),data:hf,mimeType:p(),annotations:Zr.optional(),_meta:ee(p(),ce()).optional()}),Jn=T({type:A("audio"),data:hf,mimeType:p(),annotations:Zr.optional(),_meta:ee(p(),ce()).optional()}),fu=T({type:A("tool_use"),name:p(),id:p(),input:ee(p(),ce()),_meta:ee(p(),ce()).optional()}),mu=T({type:A("resource"),resource:te([ji,qi]),annotations:Zr.optional(),_meta:ee(p(),ce()).optional()}),hu=Mi.extend({type:A("resource_link")}),Bn=te([Gn,Kn,Jn,hu,mu]),gu=T({role:po,content:Bn}),_u=Xe.extend({description:p().optional(),messages:x(gu)}),yu=Pt.extend({method:A("notifications/prompts/list_changed"),params:zt.optional()}),vu=T({title:p().optional(),readOnlyHint:Q().optional(),destructiveHint:Q().optional(),idempotentHint:Q().optional(),openWorldHint:Q().optional()}),Su=T({taskSupport:fe(["required","optional","forbidden"]).optional()}),Di=T({...Ur.shape,...co.shape,description:p().optional(),inputSchema:T({type:A("object"),properties:ee(p(),so).optional(),required:x(p()).optional()}).catchall(ce()),outputSchema:de({$schema:p().optional()}).optional(),annotations:vu.optional(),execution:Su.optional(),_meta:ee(p(),ce()).optional()}),bu=uo.extend({method:A("tools/list")}),$u=lo.extend({tools:x(Di)}),Ui=Xe.extend({content:x(Bn).default([]),structuredContent:ce().optional(),isError:Q().optional()}),gf=Ui.or(Xe.extend({toolResult:ce()})),wu=cn.extend({name:p(),arguments:ee(p(),ce()).optional()}),Ru=Ye.extend({method:A("tools/call"),params:wu}),Eu=Pt.extend({method:A("notifications/tools/list_changed"),params:zt.optional()}),_f=T({autoRefresh:Q().default(!0),debounceMs:G().int().nonnegative().default(300)}),fo=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),zu=gt.extend({level:fo}),Pu=Ye.extend({method:A("logging/setLevel"),params:zu}),Tu=zt.extend({level:fo,logger:p().optional(),data:ce()}),Iu=Pt.extend({method:A("notifications/message"),params:Tu}),ku=T({name:p().optional()}),Ou=T({hints:x(ku).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),Cu=T({mode:fe(["auto","required","none"]).optional()}),Nu=T({type:A("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:x(Bn),structuredContent:ce().optional(),isError:Q().optional(),_meta:ee(p(),ce()).optional()}),xu=Dn("type",[Gn,Kn,Jn]),on=Dn("type",[Gn,Kn,Jn,fu,Nu]),Au=T({role:po,content:te([on,x(on)]),_meta:ee(p(),ce()).optional()}),ju=cn.extend({messages:x(Au),modelPreferences:Ou.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:x(p()).optional(),metadata:We.optional(),tools:x(Di).optional(),toolChoice:Cu.optional()}),qu=Ye.extend({method:A("sampling/createMessage"),params:ju}),Mu=Xe.extend({model:p(),stopReason:ae(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:po,content:xu}),Lu=Xe.extend({model:p(),stopReason:ae(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:po,content:te([on,x(on)])}),Fi=T({type:A("boolean"),title:p().optional(),description:p().optional(),default:Q().optional()}),Wn=T({type:A("string"),title:p().optional(),description:p().optional(),minLength:G().optional(),maxLength:G().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),Yn=T({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),Vi=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),default:p().optional()}),Zi=T({type:A("string"),title:p().optional(),description:p().optional(),oneOf:x(T({const:p(),title:p()})),default:p().optional()}),Hi=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),enumNames:x(p()).optional(),default:p().optional()}),Du=te([Vi,Zi]),Gi=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({type:A("string"),enum:x(p())}),default:x(p()).optional()}),Ki=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({anyOf:x(T({const:p(),title:p()}))}),default:x(p()).optional()}),Uu=te([Gi,Ki]),Fu=te([Hi,Du,Uu]),Ji=te([Fu,Fi,Wn,Yn]),Xn=cn.extend({mode:A("form").optional(),message:p(),requestedSchema:T({type:A("object"),properties:ee(p(),Ji),required:x(p()).optional()}).catchall(ce())}),Vu=cn.extend({mode:A("url"),message:p(),elicitationId:p(),url:p().url()}),Zu=te([Xn,Vu]),Hu=Ye.extend({method:A("elicitation/create"),params:Zu}),Gu=zt.extend({elicitationId:p()}),Ku=Pt.extend({method:A("notifications/elicitation/complete"),params:Gu}),Ju=Xe.extend({action:fe(["accept","decline","cancel"]),content:rn((e)=>e===null?void 0:e,ee(p(),te([p(),G(),Q(),x(p())])).optional())}),Bu=T({type:A("ref/resource"),uri:p()}),Wu=T({type:A("ref/prompt"),name:p()}),Yu=gt.extend({ref:te([Wu,Bu]),argument:T({name:p(),value:p()}),context:T({arguments:ee(p(),p()).optional()}).optional()}),Xu=Ye.extend({method:A("completion/complete"),params:Yu}),Qu=Xe.extend({completion:de({values:x(p()).max(100),total:ae(G().int()),hasMore:ae(Q())})}),el=T({uri:p().startsWith("file://"),name:p().optional(),_meta:ee(p(),ce()).optional()}),tl=Ye.extend({method:A("roots/list"),params:gt.optional()}),rl=Xe.extend({roots:x(el)}),ol=Pt.extend({method:A("notifications/roots/list_changed"),params:zt.optional()}),yf=de({ttl:G().optional(),pollInterval:G().optional()}),nl=fe(["working","input_required","completed","failed","cancelled"]),mo=T({taskId:p(),status:nl,ttl:te([G(),tn()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:ae(G()),statusMessage:ae(p())}),vf=Xe.extend({task:mo}),sl=zt.merge(mo),Sf=Pt.extend({method:A("notifications/tasks/status"),params:sl}),bf=Ye.extend({method:A("tasks/get"),params:gt.extend({taskId:p()})}),$f=Xe.merge(mo),wf=Ye.extend({method:A("tasks/result"),params:gt.extend({taskId:p()})}),Rf=Xe.loose(),Ef=uo.extend({method:A("tasks/list")}),zf=lo.extend({tasks:x(mo)}),Pf=Ye.extend({method:A("tasks/cancel"),params:gt.extend({taskId:p()})}),Tf=Xe.merge(mo),If=te([Ni,Cc,Ac,Xu,Pu,pu,uu,Uc,Vc,Gc,Wc,Xc,eu,Ru,bu]),kf=te([Oi,xi,xc,ol]),Of=te([ki,Mu,Lu,Ju,rl]),Cf=te([Ni,qu,Hu,tl]),Nf=te([Oi,xi,Iu,iu,Jc,Eu,yu,ru,Ku]),xf=te([ki,Nc,jc,Qu,_u,lu,Fc,Zc,Kc,Ui,$u,nu]),ht=Sc().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:SS.custom,message:"URL must be parseable",fatal:!0}),op}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Af=de({resource:p().url(),authorization_servers:x(ht).optional(),jwks_uri:p().url().optional(),scopes_supported:x(p()).optional(),bearer_methods_supported:x(p()).optional(),resource_signing_alg_values_supported:x(p()).optional(),resource_name:p().optional(),resource_documentation:p().optional(),resource_policy_uri:p().url().optional(),resource_tos_uri:p().url().optional(),tls_client_certificate_bound_access_tokens:Q().optional(),authorization_details_types_supported:x(p()).optional(),dpop_signing_alg_values_supported:x(p()).optional(),dpop_bound_access_tokens_required:Q().optional()}),il=de({issuer:p(),authorization_endpoint:ht,token_endpoint:ht,registration_endpoint:ht.optional(),scopes_supported:x(p()).optional(),response_types_supported:x(p()),response_modes_supported:x(p()).optional(),grant_types_supported:x(p()).optional(),token_endpoint_auth_methods_supported:x(p()).optional(),token_endpoint_auth_signing_alg_values_supported:x(p()).optional(),service_documentation:ht.optional(),revocation_endpoint:ht.optional(),revocation_endpoint_auth_methods_supported:x(p()).optional(),revocation_endpoint_auth_signing_alg_values_supported:x(p()).optional(),introspection_endpoint:p().optional(),introspection_endpoint_auth_methods_supported:x(p()).optional(),introspection_endpoint_auth_signing_alg_values_supported:x(p()).optional(),code_challenge_methods_supported:x(p()).optional(),client_id_metadata_document_supported:Q().optional(),authorization_response_iss_parameter_supported:Q().optional().catch(void 0)}),al=de({issuer:p(),authorization_endpoint:ht,token_endpoint:ht,userinfo_endpoint:ht.optional(),jwks_uri:ht,registration_endpoint:ht.optional(),scopes_supported:x(p()).optional(),response_types_supported:x(p()),response_modes_supported:x(p()).optional(),grant_types_supported:x(p()).optional(),acr_values_supported:x(p()).optional(),subject_types_supported:x(p()),id_token_signing_alg_values_supported:x(p()),id_token_encryption_alg_values_supported:x(p()).optional(),id_token_encryption_enc_values_supported:x(p()).optional(),userinfo_signing_alg_values_supported:x(p()).optional(),userinfo_encryption_alg_values_supported:x(p()).optional(),userinfo_encryption_enc_values_supported:x(p()).optional(),request_object_signing_alg_values_supported:x(p()).optional(),request_object_encryption_alg_values_supported:x(p()).optional(),request_object_encryption_enc_values_supported:x(p()).optional(),token_endpoint_auth_methods_supported:x(p()).optional(),token_endpoint_auth_signing_alg_values_supported:x(p()).optional(),display_values_supported:x(p()).optional(),claim_types_supported:x(p()).optional(),claims_supported:x(p()).optional(),service_documentation:p().optional(),claims_locales_supported:x(p()).optional(),ui_locales_supported:x(p()).optional(),claims_parameter_supported:Q().optional(),request_parameter_supported:Q().optional(),request_uri_parameter_supported:Q().optional(),require_request_uri_registration:Q().optional(),op_policy_uri:ht.optional(),op_tos_uri:ht.optional(),client_id_metadata_document_supported:Q().optional(),authorization_response_iss_parameter_supported:Q().optional().catch(void 0)}),jf=T({...al.shape,...il.pick({code_challenge_methods_supported:!0}).shape}),qf=T({access_token:p(),id_token:p().optional(),token_type:p(),expires_in:VO().optional(),scope:p().optional(),refresh_token:p().optional()}).strip(),Mf=T({issued_token_type:A("urn:ietf:params:oauth:token-type:id-jag"),access_token:p(),token_type:p().optional(),expires_in:G().optional(),scope:p().optional()}).strip(),Lf=T({error:p(),error_description:p().optional(),error_uri:p().optional()}),pf=ht.optional().or(A("").transform(()=>{return})),cl=T({redirect_uris:x(ht),token_endpoint_auth_method:p().optional(),grant_types:x(p()).optional(),response_types:x(p()).optional(),application_type:p().optional(),client_name:p().optional(),client_uri:ht.optional(),logo_uri:pf,scope:p().optional(),contacts:x(p()).optional(),tos_uri:pf,policy_uri:p().optional(),jwks_uri:ht.optional(),jwks:fS().optional(),software_id:p().optional(),software_version:p().optional(),software_statement:p().optional()}).strip(),ul=T({client_id:p(),client_secret:p().optional(),client_id_issued_at:G().optional(),client_secret_expires_at:G().optional()}).strip(),Df=cl.merge(ul),Uf=T({error:p(),error_description:p().optional()}).strip(),Ff=T({token:p(),token_type_hint:p().optional()}).strip();var Gf=Symbol.for("mcp.sdk.errorBrands");function Wf(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,Gf,{value:r,enumerable:!1,configurable:!0})}function es(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Gf)){let r=t[Gf];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var KO=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return es(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return es(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",Wf(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},Pe=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),ve=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return es(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return es(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name="SdkError",Wf(this,new.target)}},JO=class extends ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function OS(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function BO(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function ZS(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function _l(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(OS(n)&&OS(s)){let i={};for(let[a,c]of Object.entries(n))if(c!==void 0&&s[a]===void 0&&!BO(o,a,s))i[a]=c;if(Object.keys(i).length>0)r[o]=i}}return Object.keys(r).length>0?r:void 0}var HS="2026-07-28",go=[HS];function rs(e){return e>=HS}function GS(e){return e.filter((t)=>!rs(t))}function Yf(e){return e.filter((t)=>rs(t))}function KS(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var JS=["task","inputRequests","requestState"];function Xf(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||JS.some((t)=>(t in e)))return e;return{...e,content:[]}}function WO(){let e=$i(()=>te([p(),G(),Q(),tn(),ee(p(),e),x(e)])),t=ee(p(),e),r=te([p(),G().int()]),o=p(),n=T({ttl:G().optional()}),s=T({taskId:p()}),i=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=T({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=T({method:p(),params:a.loose().optional()}),l=T({_meta:i.optional()}),d=T({method:p(),params:l.loose().optional()}),f=de({_meta:i.optional()}),h=te([p(),G().int()]),_=f.strict(),g=l.extend({requestId:h.optional(),reason:p().optional()}),y=d.extend({method:A("notifications/cancelled"),params:g}),m=T({src:p(),mimeType:p().optional(),sizes:x(p()).optional(),theme:fe(["light","dark"]).optional()}),S=T({icons:x(m).optional()}),v=T({name:p(),title:p().optional()}),w=v.extend({...v.shape,...S.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),P=Dr(T({applyDefaults:Q().optional()}),t),R=rn((Et)=>{if(Et&&typeof Et==="object"&&!Array.isArray(Et)&&Object.keys(Et).length===0)return{form:{}};return Et},Dr(T({form:P.optional(),url:t.optional()}),t.optional())),b=de({list:t.optional(),cancel:t.optional(),requests:de({sampling:de({createMessage:t.optional()}).optional(),elicitation:de({create:t.optional()}).optional()}).optional()}),E=de({list:t.optional(),cancel:t.optional(),requests:de({tools:de({call:t.optional()}).optional()}).optional()}),C=T({experimental:ee(p(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:T({listChanged:Q().optional()}).optional(),tasks:b.optional(),extensions:ee(p(),t).optional()}),D=a.extend({protocolVersion:p(),capabilities:C,clientInfo:w}),N=u.extend({method:A("initialize"),params:D}),F=T({experimental:ee(p(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:Q().optional()}).optional(),resources:T({subscribe:Q().optional(),listChanged:Q().optional()}).optional(),tools:T({listChanged:Q().optional()}).optional(),tasks:E.optional(),extensions:ee(p(),t).optional()}),Y=f.extend({protocolVersion:p(),capabilities:F,serverInfo:w,instructions:p().optional()}),X=d.extend({method:A("notifications/initialized"),params:l.optional()}),ze=u.extend({method:A("ping"),params:a.optional()}),He=T({progress:G(),total:ae(G()),message:ae(p())}),De=T({...l.shape,...He.shape,progressToken:r}),at=d.extend({method:A("notifications/progress"),params:De}),Ie=a.extend({cursor:o.optional()}),O=u.extend({params:Ie.optional()}),q=f.extend({nextCursor:o.optional()}),K=T({uri:p(),mimeType:ae(p()),_meta:ee(p(),ce()).optional()}),z=K.extend({text:p()}),k=p().refine((Et)=>{try{return atob(Et),!0}catch{return!1}},{message:"Invalid Base64 string"}),j=K.extend({blob:k}),J=fe(["user","assistant"]),ue=T({audience:x(J).optional(),priority:G().min(0).max(1).optional(),lastModified:Ln({offset:!0}).optional()}),Re=T({...v.shape,...S.shape,uri:p(),description:ae(p()),mimeType:ae(p()),size:ae(G()),annotations:ue.optional(),_meta:ae(de({}))}),ge=T({...v.shape,...S.shape,uriTemplate:p(),description:ae(p()),mimeType:ae(p()),annotations:ue.optional(),_meta:ae(de({}))}),Ue=O.extend({method:A("resources/list")}),Ot=q.extend({resources:x(Re)}),I=O.extend({method:A("resources/templates/list")}),M=q.extend({resourceTemplates:x(ge)}),Z=a.extend({uri:p()}),pe=Z,me=u.extend({method:A("resources/read"),params:pe}),$e=f.extend({contents:x(te([z,j]))}),st=d.extend({method:A("notifications/resources/list_changed"),params:l.optional()}),dt=Z,wt=u.extend({method:A("resources/subscribe"),params:dt}),ct=Z,Je=u.extend({method:A("resources/unsubscribe"),params:ct}),Yt=l.extend({uri:p()}),mt=d.extend({method:A("notifications/resources/updated"),params:Yt}),qr=T({name:p(),description:ae(p()),required:ae(Q())}),cr=T({...v.shape,...S.shape,description:ae(p()),arguments:ae(x(qr)),_meta:ae(de({}))}),Mr=O.extend({method:A("prompts/list")}),Br=q.extend({prompts:x(cr)}),Wr=a.extend({name:p(),arguments:ee(p(),p()).optional()}),Uo=u.extend({method:A("prompts/get"),params:Wr}),Fo=T({type:A("text"),text:p(),annotations:ue.optional(),_meta:ee(p(),ce()).optional()}),Vo=T({type:A("image"),data:k,mimeType:p(),annotations:ue.optional(),_meta:ee(p(),ce()).optional()}),Zo=T({type:A("audio"),data:k,mimeType:p(),annotations:ue.optional(),_meta:ee(p(),ce()).optional()}),js=T({type:A("tool_use"),name:p(),id:p(),input:ee(p(),ce()),_meta:ee(p(),ce()).optional()}),Yr=T({type:A("resource"),resource:te([z,j]),annotations:ue.optional(),_meta:ee(p(),ce()).optional()}),qs=Re.extend({type:A("resource_link")}),Xt=te([Fo,Vo,Zo,qs,Yr]),En=T({role:J,content:Xt}),zn=f.extend({description:p().optional(),messages:x(En)}),Ho=d.extend({method:A("notifications/prompts/list_changed"),params:l.optional()}),Ms=T({title:p().optional(),readOnlyHint:Q().optional(),destructiveHint:Q().optional(),idempotentHint:Q().optional(),openWorldHint:Q().optional()}),Pn=T({taskSupport:fe(["required","optional","forbidden"]).optional()}),Go=T({...v.shape,...S.shape,description:p().optional(),inputSchema:T({type:A("object"),properties:ee(p(),e).optional(),required:x(p()).optional()}).catchall(ce()),outputSchema:T({type:A("object"),properties:ee(p(),e).optional(),required:x(p()).optional()}).catchall(ce()).optional(),annotations:Ms.optional(),execution:Pn.optional(),_meta:ee(p(),ce()).optional()}),Tn=O.extend({method:A("tools/list")}),In=q.extend({tools:x(Go)}),kn=f.extend({content:x(Xt),structuredContent:ee(p(),ce()).optional(),isError:Q().optional()}),Rt=c.extend({name:p(),arguments:ee(p(),ce()).optional()}),Ls=u.extend({method:A("tools/call"),params:Rt}),Na=d.extend({method:A("notifications/tools/list_changed"),params:l.optional()}),On=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),Ds=a.extend({level:On}),Us=u.extend({method:A("logging/setLevel"),params:Ds}),Fs=l.extend({level:On,logger:p().optional(),data:ce()}),Vs=d.extend({method:A("notifications/message"),params:Fs}),Zs=T({name:p().optional()}),Hs=T({hints:x(Zs).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),Gs=T({mode:fe(["auto","required","none"]).optional()}),xa=T({type:A("tool_result"),toolUseId:p().describe("The unique identifier for the corresponding tool call."),content:x(Xt),structuredContent:T({}).loose().optional(),isError:Q().optional(),_meta:ee(p(),ce()).optional()}),Ks=Dn("type",[Fo,Vo,Zo]),Xr=Dn("type",[Fo,Vo,Zo,js,xa]),Js=T({role:J,content:te([Xr,x(Xr)]),_meta:ee(p(),ce()).optional()}),Bs=c.extend({messages:x(Js),modelPreferences:Hs.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:x(p()).optional(),metadata:t.optional(),tools:x(Go).optional(),toolChoice:Gs.optional()}),Ws=u.extend({method:A("sampling/createMessage"),params:Bs}),Ys=f.extend({model:p(),stopReason:ae(fe(["endTurn","stopSequence","maxTokens"]).or(p())),role:J,content:Ks}),Xs=f.extend({model:p(),stopReason:ae(fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(p())),role:J,content:te([Xr,x(Xr)])}),Qs=T({type:A("boolean"),title:p().optional(),description:p().optional(),default:Q().optional()}),ei=T({type:A("string"),title:p().optional(),description:p().optional(),minLength:G().optional(),maxLength:G().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),ti=T({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),ri=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),default:p().optional()}),oi=T({type:A("string"),title:p().optional(),description:p().optional(),oneOf:x(T({const:p(),title:p()})),default:p().optional()}),ni=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),enumNames:x(p()).optional(),default:p().optional()}),si=te([ri,oi]),Ko=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({type:A("string"),enum:x(p())}),default:x(p()).optional()}),Jo=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({anyOf:x(T({const:p(),title:p()}))}),default:x(p()).optional()}),Aa=te([Ko,Jo]),ja=te([ni,si,Aa]),Ht=te([ja,Qs,ei,ti]),Gt=c.extend({mode:A("form").optional(),message:p(),requestedSchema:T({type:A("object"),properties:ee(p(),Ht),required:x(p()).optional()}).catchall(ce())}),ii=c.extend({mode:A("url"),message:p(),elicitationId:p(),url:p().url()}),ur=te([Gt,ii]),qa=u.extend({method:A("elicitation/create"),params:ur}),Ma=l.extend({elicitationId:p()}),La=d.extend({method:A("notifications/elicitation/complete"),params:Ma}),Da=f.extend({action:fe(["accept","decline","cancel"]),content:rn((Et)=>Et===null?void 0:Et,ee(p(),te([p(),G(),Q(),x(p())])).optional())}),Ua=T({type:A("ref/resource"),uri:p()}),Fa=T({type:A("ref/prompt"),name:p()}),Va=a.extend({ref:te([Fa,Ua]),argument:T({name:p(),value:p()}),context:T({arguments:ee(p(),p()).optional()}).optional()}),ai=u.extend({method:A("completion/complete"),params:Va}),Za=f.extend({completion:de({values:x(p()).max(100),total:ae(G().int()),hasMore:ae(Q())})}),Ha=T({uri:p().startsWith("file://"),name:p().optional(),_meta:ee(p(),ce()).optional()}),Cn=u.extend({method:A("roots/list"),params:a.optional()}),ci=f.extend({roots:x(Ha)}),Ga=d.extend({method:A("notifications/roots/list_changed"),params:l.optional()}),Ka=de({ttl:G().optional(),pollInterval:G().optional()}),Ja=fe(["working","input_required","completed","failed","cancelled"]),Qr=T({taskId:p(),status:Ja,ttl:te([G(),tn()]),createdAt:p(),lastUpdatedAt:p(),pollInterval:ae(G()),statusMessage:ae(p())}),At=f.extend({task:Qr}),Ba=l.merge(Qr),Bo=d.extend({method:A("notifications/tasks/status"),params:Ba}),Nn=u.extend({method:A("tasks/get"),params:a.extend({taskId:p()})}),xn=f.merge(Qr),An=u.extend({method:A("tasks/result"),params:a.extend({taskId:p()})}),tp=f.loose(),jt=O.extend({method:A("tasks/list")}),it=q.extend({tasks:x(Qr)}),Wo=u.extend({method:A("tasks/cancel"),params:a.extend({taskId:p()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:f,RequestIdSchema:h,EmptyResultSchema:_,CancelledNotificationParamsSchema:g,CancelledNotificationSchema:y,IconSchema:m,IconsSchema:S,BaseMetadataSchema:v,ImplementationSchema:w,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:C,InitializeRequestParamsSchema:D,InitializeRequestSchema:N,ServerCapabilitiesSchema:F,InitializeResultSchema:Y,InitializedNotificationSchema:X,PingRequestSchema:ze,ProgressSchema:He,ProgressNotificationParamsSchema:De,ProgressNotificationSchema:at,PaginatedRequestParamsSchema:Ie,PaginatedRequestSchema:O,PaginatedResultSchema:q,ResourceContentsSchema:K,TextResourceContentsSchema:z,BlobResourceContentsSchema:j,RoleSchema:J,AnnotationsSchema:ue,ResourceSchema:Re,ResourceTemplateSchema:ge,ListResourcesRequestSchema:Ue,ListResourcesResultSchema:Ot,ListResourceTemplatesRequestSchema:I,ListResourceTemplatesResultSchema:M,ResourceRequestParamsSchema:Z,ReadResourceRequestParamsSchema:pe,ReadResourceRequestSchema:me,ReadResourceResultSchema:$e,ResourceListChangedNotificationSchema:st,SubscribeRequestParamsSchema:dt,SubscribeRequestSchema:wt,UnsubscribeRequestParamsSchema:ct,UnsubscribeRequestSchema:Je,ResourceUpdatedNotificationParamsSchema:Yt,ResourceUpdatedNotificationSchema:mt,PromptArgumentSchema:qr,PromptSchema:cr,ListPromptsRequestSchema:Mr,ListPromptsResultSchema:Br,GetPromptRequestParamsSchema:Wr,GetPromptRequestSchema:Uo,TextContentSchema:Fo,ImageContentSchema:Vo,AudioContentSchema:Zo,ToolUseContentSchema:js,EmbeddedResourceSchema:Yr,ResourceLinkSchema:qs,ContentBlockSchema:Xt,PromptMessageSchema:En,GetPromptResultSchema:zn,PromptListChangedNotificationSchema:Ho,ToolAnnotationsSchema:Ms,ToolExecutionSchema:Pn,ToolSchema:Go,ListToolsRequestSchema:Tn,ListToolsResultSchema:In,CallToolResultSchema:kn,CallToolRequestParamsSchema:Rt,CallToolRequestSchema:Ls,ToolListChangedNotificationSchema:Na,LoggingLevelSchema:On,SetLevelRequestParamsSchema:Ds,SetLevelRequestSchema:Us,LoggingMessageNotificationParamsSchema:Fs,LoggingMessageNotificationSchema:Vs,ModelHintSchema:Zs,ModelPreferencesSchema:Hs,ToolChoiceSchema:Gs,ToolResultContentSchema:xa,SamplingContentSchema:Ks,SamplingMessageContentBlockSchema:Xr,SamplingMessageSchema:Js,CreateMessageRequestParamsSchema:Bs,CreateMessageRequestSchema:Ws,CreateMessageResultSchema:Ys,CreateMessageResultWithToolsSchema:Xs,BooleanSchemaSchema:Qs,StringSchemaSchema:ei,NumberSchemaSchema:ti,UntitledSingleSelectEnumSchemaSchema:ri,TitledSingleSelectEnumSchemaSchema:oi,LegacyTitledEnumSchemaSchema:ni,SingleSelectEnumSchemaSchema:si,UntitledMultiSelectEnumSchemaSchema:Ko,TitledMultiSelectEnumSchemaSchema:Jo,MultiSelectEnumSchemaSchema:Aa,EnumSchemaSchema:ja,PrimitiveSchemaDefinitionSchema:Ht,ElicitRequestFormParamsSchema:Gt,ElicitRequestURLParamsSchema:ii,ElicitRequestParamsSchema:ur,ElicitRequestSchema:qa,ElicitationCompleteNotificationParamsSchema:Ma,ElicitationCompleteNotificationSchema:La,ElicitResultSchema:Da,ResourceTemplateReferenceSchema:Ua,PromptReferenceSchema:Fa,CompleteRequestParamsSchema:Va,CompleteRequestSchema:ai,CompleteResultSchema:Za,RootSchema:Ha,ListRootsRequestSchema:Cn,ListRootsResultSchema:ci,RootsListChangedNotificationSchema:Ga,TaskCreationParamsSchema:Ka,TaskStatusSchema:Ja,TaskSchema:Qr,CreateTaskResultSchema:At,TaskStatusNotificationParamsSchema:Ba,TaskStatusNotificationSchema:Bo,GetTaskRequestSchema:Nn,GetTaskResultSchema:xn,GetTaskPayloadRequestSchema:An,GetTaskPayloadResultSchema:tp,ListTasksRequestSchema:jt,ListTasksResultSchema:it,CancelTaskRequestSchema:Wo,CancelTaskResultSchema:f.merge(Qr),ClientRequestSchema:te([ze,N,ai,Us,Uo,Mr,Ue,I,me,wt,Je,Ls,Tn,Nn,An,jt,Wo]),ClientNotificationSchema:te([y,at,X,Ga,Bo]),ClientResultSchema:te([_,Ys,Xs,Da,ci,xn,it,At]),ServerRequestSchema:te([ze,Ws,qa,Cn,Nn,An,jt,Wo]),ServerNotificationSchema:te([y,at,Vs,mt,st,Na,Ho,Bo,La]),ServerResultSchema:te([_,Y,Za,zn,Br,Ot,M,$e,kn,In,xn,it,At]),CallToolResultWireSchema:ce().superRefine((Et,ak)=>{if(typeof Et!=="object"||Et===null||Array.isArray(Et)||Et.content!==void 0)return;for(let Eg of JS)if(Eg in Et){ak.addIssue({code:"custom",message:`content is required when the body carries '${Eg}' — another result family cannot default into an empty tools/call success`});return}}).transform(Xf).pipe(kn)}}var YO;function BS(){return YO??=WO()}function WS(e){return e.type!=="object"}var XO=new Set(["const","enum","default","examples"]),QO=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function CS(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function eC(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(CS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=kg(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((c)=>o(c,!1));if(n===null||typeof n!=="object")return n;if(!s&&CS(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))if(s)i[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)a=!0;else if(XO.has(c))i[c]=u;else if(QO.has(c))i[c]=o(u,!0);else i[c]=o(u,!1);if(a)if("$ref"in i)i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}];else i.$ref="#/properties/result";return i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var YS={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},XS={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},tC={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ll;function Qf(){if(ll)return ll;let e=BS();return ll={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ll}function QS(e){return Object.prototype.hasOwnProperty.call(YS,e)}function e0(e){return Object.prototype.hasOwnProperty.call(XS,e)}function rC(e){return Object.prototype.hasOwnProperty.call(tC,e)}function oC(e){return rC(e)?Qf().resultSchemas[e]:void 0}function nC(e){return QS(e)?Qf().requestSchemas[e]:void 0}function sC(e){return e0(e)?Qf().notificationSchemas[e]:void 0}var n6=Object.keys(YS),s6=Object.keys(XS);function Kf(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function dl(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var NS={ok:!1,reason:"not-in-era"};function xS(e){return Kf(e)&&Kf(e.outputSchema)&&WS(e.outputSchema)}function AS(e){return e}var em={era:"2025-11-25",hasRequestMethod:QS,hasNotificationMethod:e0,validateRequest:(e,t)=>dl(nC(e),t),validateResult:(e,t)=>dl(oC(e),t),validateNotification:(e,t)=>dl(sC(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>NS,validateInputResponse:()=>NS,samplingResultVariant:(e,t)=>{let r=BS();return dl(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=KS(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&WS(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Kf(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:AS(r)}}return{kind:"complete",result:AS(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>xS(o)))return t;return{...t,tools:r.map((o)=>xS(o)?{...o,outputSchema:eC(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function iC(){let e=$i(()=>te([p(),G(),Q(),tn(),ee(p(),e),x(e)])),t=ee(p(),e),r=te([p(),G().int()]),o=p(),n=te([p(),G().int()]),s=fe(["user","assistant"]),i=fe(["debug","info","notice","warning","error","critical","alert","emergency"]),a=p().refine((it)=>{try{return atob(it),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=T({ttl:G().optional()}),u=T({taskId:p()}),l=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=T({_meta:l.optional()}),f=d.extend({task:c.optional()}),h=T({_meta:l.optional()}),_=T({method:p(),params:h.loose().optional()}),g=T({src:p(),mimeType:p().optional(),sizes:x(p()).optional(),theme:fe(["light","dark"]).optional()}),y=T({icons:x(g).optional()}),m=T({name:p(),title:p().optional()}),S=m.extend({...m.shape,...y.shape,version:p(),websiteUrl:p().optional(),description:p().optional()}),v=Dr(T({applyDefaults:Q().optional()}),t),w=rn((it)=>{if(it&&typeof it==="object"&&!Array.isArray(it)&&Object.keys(it).length===0)return{form:{}};return it},Dr(T({form:v.optional(),url:t.optional()}),t.optional())),P=de({list:t.optional(),cancel:t.optional(),requests:de({sampling:de({createMessage:t.optional()}).optional(),elicitation:de({create:t.optional()}).optional()}).optional()}),R=de({list:t.optional(),cancel:t.optional(),requests:de({tools:de({call:t.optional()}).optional()}).optional()}),b=T({experimental:ee(p(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:w.optional(),roots:T({listChanged:Q().optional()}).optional(),tasks:P.optional(),extensions:ee(p(),t).optional()}),E=T({experimental:ee(p(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:Q().optional()}).optional(),resources:T({subscribe:Q().optional(),listChanged:Q().optional()}).optional(),tools:T({listChanged:Q().optional()}).optional(),tasks:R.optional(),extensions:ee(p(),t).optional()}),C=T({progress:G(),total:ae(G()),message:ae(p())}),D=T({...h.shape,...C.shape,progressToken:r}),N=_.extend({method:A("notifications/progress"),params:D}),F=h.extend({level:i,logger:p().optional(),data:ce()}),Y=_.extend({method:A("notifications/message"),params:F}),X=T({uri:p(),mimeType:ae(p()),_meta:ee(p(),ce()).optional()}),ze=X.extend({text:p()}),He=X.extend({blob:a}),De=T({audience:x(s).optional(),priority:G().min(0).max(1).optional(),lastModified:Ln({offset:!0}).optional()}),at=T({...m.shape,...y.shape,uri:p(),description:ae(p()),mimeType:ae(p()),size:ae(G()),annotations:De.optional(),_meta:ae(de({}))}),Ie=T({...m.shape,...y.shape,uriTemplate:p(),description:ae(p()),mimeType:ae(p()),annotations:De.optional(),_meta:ae(de({}))}),O=_.extend({method:A("notifications/resources/list_changed"),params:h.optional()}),q=h.extend({uri:p()}),K=_.extend({method:A("notifications/resources/updated"),params:q}),z=T({name:p(),description:ae(p()),required:ae(Q())}),k=T({...m.shape,...y.shape,description:ae(p()),arguments:ae(x(z)),_meta:ae(de({}))}),j=_.extend({method:A("notifications/prompts/list_changed"),params:h.optional()}),J=T({type:A("text"),text:p(),annotations:De.optional(),_meta:ee(p(),ce()).optional()}),ue=T({type:A("image"),data:a,mimeType:p(),annotations:De.optional(),_meta:ee(p(),ce()).optional()}),Re=T({type:A("audio"),data:a,mimeType:p(),annotations:De.optional(),_meta:ee(p(),ce()).optional()}),ge=T({type:A("tool_use"),name:p(),id:p(),input:ee(p(),ce()),_meta:ee(p(),ce()).optional()}),Ue=T({type:A("resource"),resource:te([ze,He]),annotations:De.optional(),_meta:ee(p(),ce()).optional()}),Ot=at.extend({type:A("resource_link")}),I=te([J,ue,Re,Ot,Ue]),M=T({role:s,content:I}),Z=T({title:p().optional(),readOnlyHint:Q().optional(),destructiveHint:Q().optional(),idempotentHint:Q().optional(),openWorldHint:Q().optional()}),pe=_.extend({method:A("notifications/tools/list_changed"),params:h.optional()}),me=T({name:p().optional()}),$e=T({hints:x(me).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),st=T({mode:fe(["auto","required","none"]).optional()}),dt=T({type:A("boolean"),title:p().optional(),description:p().optional(),default:Q().optional()}),wt=T({type:A("string"),title:p().optional(),description:p().optional(),minLength:G().optional(),maxLength:G().optional(),format:fe(["email","uri","date","date-time"]).optional(),default:p().optional()}),ct=T({type:fe(["number","integer"]),title:p().optional(),description:p().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),Je=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),default:p().optional()}),Yt=T({type:A("string"),title:p().optional(),description:p().optional(),oneOf:x(T({const:p(),title:p()})),default:p().optional()}),mt=T({type:A("string"),title:p().optional(),description:p().optional(),enum:x(p()),enumNames:x(p()).optional(),default:p().optional()}),qr=te([Je,Yt]),cr=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({type:A("string"),enum:x(p())}),default:x(p()).optional()}),Mr=T({type:A("array"),title:p().optional(),description:p().optional(),minItems:G().optional(),maxItems:G().optional(),items:T({anyOf:x(T({const:p(),title:p()}))}),default:x(p()).optional()}),Br=te([cr,Mr]),Wr=te([mt,qr,Br]),Uo=te([Wr,dt,wt,ct]),Fo=f.extend({mode:A("form").optional(),message:p(),requestedSchema:T({type:A("object"),properties:ee(p(),Uo),required:x(p()).optional()}).catchall(ce())}),Vo=T({type:A("ref/resource"),uri:p()}),Zo=T({type:A("ref/prompt"),name:p()}),js=T({uri:p().startsWith("file://"),name:p().optional(),_meta:ee(p(),ce()).optional()}),Yr=b.shape,qs=T({experimental:Yr.experimental,sampling:Yr.sampling,elicitation:Yr.elicitation,roots:Yr.roots,extensions:Yr.extensions}),Xt=E.shape,En=T({experimental:Xt.experimental,logging:Xt.logging,completions:Xt.completions,prompts:Xt.prompts,resources:Xt.resources,tools:Xt.tools,extensions:Xt.extensions}),zn=de({progressToken:r.optional(),[Fr]:p(),[Un]:S.optional(),[Vr]:qs,[io]:i.optional()}),Ho=T({...m.shape,...y.shape,description:p().optional(),inputSchema:de({$schema:p().optional(),type:A("object")}),outputSchema:de({$schema:p().optional()}).optional(),annotations:Z.optional(),_meta:ee(p(),ce()).optional()}),Ms=T({type:A("tool_result"),toolUseId:p(),content:x(I),structuredContent:ce().optional(),isError:Q().optional(),_meta:ee(p(),ce()).optional()}),Pn=te([J,ue,Re,ge,Ms]),Go=T({role:s,content:te([Pn,x(Pn)]),_meta:ee(p(),ce()).optional()}),Tn=p(),In=de({[Sr]:S.optional().catch(void 0)}),kn=In.optional();function Rt(it){return de({_meta:kn,resultType:Tn.default("complete"),...it})}let Ls=Rt({}),Na=Rt({nextCursor:o.optional()}),On=Rt({content:x(I),structuredContent:ce().optional(),isError:Q().optional()}),Ds=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),tools:x(Ho),nextCursor:o.optional()}),Us=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),prompts:x(k),nextCursor:o.optional()}),Fs=Rt({description:p().optional(),messages:x(M)}),Vs=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),resources:x(at),nextCursor:o.optional()}),Zs=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),resourceTemplates:x(Ie),nextCursor:o.optional()}),Hs=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),contents:x(te([ze,He]))}),Gs=Rt({completion:T({values:x(p()).max(100),total:G().int().optional(),hasMore:Q().optional()}).loose()}),xa=Rt({ttlMs:G().int().min(0),cacheScope:fe(["public","private"])}),Ks=Rt({ttlMs:G().int().min(0).catch(0),cacheScope:fe(["public","private"]).catch("private"),supportedVersions:x(p()),capabilities:En,instructions:p().optional()}),Xr=T({messages:x(Go),modelPreferences:$e.optional(),systemPrompt:p().optional(),includeContext:fe(["none","thisServer","allServers"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:x(p()).optional(),metadata:t.optional(),tools:x(Ho).optional(),toolChoice:st.optional()}),Js=T({method:A("sampling/createMessage"),params:Xr}),Bs=T({method:A("roots/list"),params:T({_meta:ee(p(),ce()).optional()}).optional()}),Ws=T({...Go.shape,model:p(),stopReason:p().optional()}),Ys=T({roots:x(js)}),Xs=T({action:fe(["accept","decline","cancel"]),content:ee(p(),te([p(),G(),Q(),x(p())])).optional()}),Qs=T({mode:A("url"),message:p(),url:p().url()}),ei=te([Fo,Qs]),ti=T({method:A("elicitation/create"),params:ei}),ri=te([Js,Bs,ti]),oi=te([Ws,Ys,Xs]),ni=ee(p(),ri),si=ee(p(),oi),Ko=Rt({inputRequests:ni.optional(),requestState:p().optional()}),Jo={inputResponses:si.optional(),requestState:p().optional()},Aa=T({_meta:zn,...Jo}),ja=de({progressToken:r.optional()});function Ht(it,Wo){return T({method:A(it),params:T({_meta:zn,...Wo})})}function Gt(it,Wo){return T({method:A(it),params:T({_meta:ja.optional(),...Wo}).optional()})}let ii={name:p(),arguments:ee(p(),ce()).optional(),...Jo},ur={cursor:o.optional()},qa=Ht("tools/call",ii),Ma=Ht("tools/list",ur),La=Ht("prompts/list",ur),Da=Ht("prompts/get",{name:p(),arguments:ee(p(),p()).optional(),...Jo}),Ua=Ht("resources/list",ur),Fa=Ht("resources/templates/list",ur),Va=Ht("resources/read",{uri:p(),...Jo}),ai={ref:te([Zo,Vo]),argument:T({name:p(),value:p()}),context:T({arguments:ee(p(),p()).optional()}).optional()},Za=Ht("completion/complete",ai),Ha=Ht("server/discover",{}),Cn=T({toolsListChanged:Q().optional(),promptsListChanged:Q().optional(),resourcesListChanged:Q().optional(),resourceSubscriptions:x(p()).optional()}),ci={notifications:Cn},Ga=Ht("subscriptions/listen",ci),Ka=In.extend({"io.modelcontextprotocol/subscriptionId":n}),Ja=de({_meta:Ka,resultType:Tn.default("complete")}),Qr={"tools/call":Gt("tools/call",ii),"tools/list":Gt("tools/list",ur),"prompts/get":Gt("prompts/get",{name:p(),arguments:ee(p(),p()).optional()}),"prompts/list":Gt("prompts/list",ur),"resources/list":Gt("resources/list",ur),"resources/templates/list":Gt("resources/templates/list",ur),"resources/read":Gt("resources/read",{uri:p()}),"completion/complete":Gt("completion/complete",ai),"server/discover":Gt("server/discover",{}),"subscriptions/listen":Gt("subscriptions/listen",ci)};function At(it){return de({_meta:kn,...it})}let Ba={"tools/call":At({content:x(I),structuredContent:ce().optional(),isError:Q().optional()}),"tools/list":At({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),tools:x(Ho),nextCursor:o.optional()}),"prompts/get":At({description:p().optional(),messages:x(M)}),"prompts/list":At({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),prompts:x(k),nextCursor:o.optional()}),"resources/list":At({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),resources:x(at),nextCursor:o.optional()}),"resources/templates/list":At({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),resourceTemplates:x(Ie),nextCursor:o.optional()}),"resources/read":At({ttlMs:G().int().min(0),cacheScope:fe(["public","private"]),contents:x(te([ze,He]))}),"completion/complete":At({completion:T({values:x(p()).max(100),total:G().int().optional(),hasMore:Q().optional()}).loose()}),"server/discover":At({ttlMs:G().int().min(0).catch(0),cacheScope:fe(["public","private"]).catch("private"),supportedVersions:x(p()),capabilities:En,instructions:p().optional()}),"subscriptions/listen":At({})},Bo=de({"io.modelcontextprotocol/subscriptionId":n.optional()}),Nn=T({method:A("notifications/subscriptions/acknowledged"),params:T({_meta:Bo.optional(),notifications:Cn})}),xn=T({_meta:Bo.optional(),requestId:n,reason:p().optional()}),An=T({method:A("notifications/cancelled"),params:xn}),tp={"notifications/cancelled":An,"notifications/progress":N,"notifications/message":Y,"notifications/resources/updated":K,"notifications/resources/list_changed":O,"notifications/tools/list_changed":pe,"notifications/prompts/list_changed":j,"notifications/subscriptions/acknowledged":Nn},jt=(it)=>T({jsonrpc:A("2.0"),id:te([p(),G().int()]),result:it}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:h,NotificationSchema:_,IconSchema:g,IconsSchema:y,BaseMetadataSchema:m,ImplementationSchema:S,ClientTasksCapabilitySchema:P,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:b,ServerCapabilitiesSchema:E,ProgressSchema:C,ProgressNotificationParamsSchema:D,ProgressNotificationSchema:N,LoggingMessageNotificationParamsSchema:F,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:X,TextResourceContentsSchema:ze,BlobResourceContentsSchema:He,AnnotationsSchema:De,ResourceSchema:at,ResourceTemplateSchema:Ie,ResourceListChangedNotificationSchema:O,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:K,PromptArgumentSchema:z,PromptSchema:k,PromptListChangedNotificationSchema:j,TextContentSchema:J,ImageContentSchema:ue,AudioContentSchema:Re,ToolUseContentSchema:ge,EmbeddedResourceSchema:Ue,ResourceLinkSchema:Ot,ContentBlockSchema:I,PromptMessageSchema:M,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:pe,ModelHintSchema:me,ModelPreferencesSchema:$e,ToolChoiceSchema:st,BooleanSchemaSchema:dt,StringSchemaSchema:wt,NumberSchemaSchema:ct,UntitledSingleSelectEnumSchemaSchema:Je,TitledSingleSelectEnumSchemaSchema:Yt,LegacyTitledEnumSchemaSchema:mt,SingleSelectEnumSchemaSchema:qr,UntitledMultiSelectEnumSchemaSchema:cr,TitledMultiSelectEnumSchemaSchema:Mr,MultiSelectEnumSchemaSchema:Br,EnumSchemaSchema:Wr,PrimitiveSchemaDefinitionSchema:Uo,ElicitRequestFormParamsSchema:Fo,ResourceTemplateReferenceSchema:Vo,PromptReferenceSchema:Zo,RootSchema:js,ClientCapabilities2026Schema:qs,ServerCapabilities2026Schema:En,RequestMetaEnvelopeSchema:zn,ToolSchema:Ho,ToolResultContentSchema:Ms,SamplingMessageContentBlockSchema:Pn,SamplingMessageSchema:Go,ResultTypeSchema:Tn,ResultMetaSchema:In,ResultSchema:Ls,PaginatedResultSchema:Na,CallToolResultSchema:On,ListToolsResultSchema:Ds,ListPromptsResultSchema:Us,GetPromptResultSchema:Fs,ListResourcesResultSchema:Vs,ListResourceTemplatesResultSchema:Zs,ReadResourceResultSchema:Hs,CompleteResultSchema:Gs,CacheableResultSchema:xa,DiscoverResultSchema:Ks,CreateMessageRequestParamsSchema:Xr,CreateMessageRequestSchema:Js,ListRootsRequestSchema:Bs,CreateMessageResultSchema:Ws,ListRootsResultSchema:Ys,ElicitResultSchema:Xs,ElicitRequestURLParamsSchema:Qs,ElicitRequestParamsSchema:ei,ElicitRequestSchema:ti,InputRequestSchema:ri,InputResponseSchema:oi,InputRequestsSchema:ni,InputResponsesSchema:si,InputRequiredResultSchema:Ko,InputResponseRequestParamsSchema:Aa,CallToolRequestSchema:qa,ListToolsRequestSchema:Ma,ListPromptsRequestSchema:La,GetPromptRequestSchema:Da,ListResourcesRequestSchema:Ua,ListResourceTemplatesRequestSchema:Fa,ReadResourceRequestSchema:Va,CompleteRequestSchema:Za,DiscoverRequestSchema:Ha,SubscriptionFilterSchema:Cn,SubscriptionsListenRequestSchema:Ga,SubscriptionsListenResultMetaSchema:Ka,SubscriptionsListenResultSchema:Ja,dispatchRequestSchemas:Qr,dispatchResultSchemas:Ba,NotificationMetaSchema:Bo,SubscriptionsAcknowledgedNotificationSchema:Nn,CancelledNotificationParamsSchema:xn,CancelledNotificationSchema:An,notificationSchemas2026:tp,JSONRPCResultResponseSchema:jt(Ls),CallToolResultResponseSchema:jt(te([On,Ko])),ListToolsResultResponseSchema:jt(Ds),ListPromptsResultResponseSchema:jt(Us),GetPromptResultResponseSchema:jt(te([Fs,Ko])),ListResourcesResultResponseSchema:jt(Vs),ListResourceTemplatesResultResponseSchema:jt(Zs),ReadResourceResultResponseSchema:jt(te([Hs,Ko])),CompleteResultResponseSchema:jt(Gs),DiscoverResultResponseSchema:jt(Ks)}}var aC;function ln(){return aC??=iC()}var cC=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function uC(e){return cC.includes(e)}var Qn=Symbol("modelcontextprotocol.resultCacheHintFallback");function yl(e,t){if(t===void 0)return e;let r=e[Qn];if(r===void 0)return{...e,[Qn]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[Qn]:o}}function lC(e){return e[Qn]}function tm(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function rm(e){return e==="public"||e==="private"}function om(e,t){if(e.ttlMs!==void 0&&!tm(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!rm(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var B=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),le=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return es(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return es(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",Wf(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new t0(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new os({supported:n.supported,requested:n.requested},r)}if(t===B.InvalidParams||t===B.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===B.ResourceNotFound||Object.keys(n).length===1))return new vl(n.uri,r)}if(t===B.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new Sl({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},vl=class extends le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(B.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},t0=class extends le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(B.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},os=class extends le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(B.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Sl=class extends le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(B.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},dC=0,pC="private",fC=["tools/call","prompts/get","resources/read"];function mC(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(fC.includes(e))return t;throw new le(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function hC(e,t){let r=lC(t);if(t.resultType!=="complete"||!uC(e))return r===void 0?t:SC(t);let o=t,n=tm(o.ttlMs)?o.ttlMs:yC(r),s=rm(o.cacheScope)?o.cacheScope:vC(r),i={...o,ttlMs:n,cacheScope:s};return delete i[Qn],i}function gC(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function _C(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Sr]:t}};if(!gC(r))return e;if(r[Sr]!==void 0)return e;return{...e,_meta:{...r,[Sr]:t}}}function yC(e){return e!==void 0&&tm(e.ttlMs)?e.ttlMs:dC}function vC(e){return e!==void 0&&rm(e.cacheScope)?e.cacheScope:pC}function SC(e){let t={...e};return delete t[Qn],t}var bC=["elicitation/create","sampling/createMessage","roots/list"],pl;function r0(){if(pl)return pl;let e=ln();return pl={request:{"elicitation/create":T({method:A("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":T({method:A("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":T({method:A("roots/list"),params:de({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},pl}function o0(e){return bC.includes(e)}function Vf(e){return o0(e)?r0().request[e]:void 0}function $C(e){return o0(e)?r0().response[e]:void 0}var nm={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},n0={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function s0(e){return Object.prototype.hasOwnProperty.call(nm,e)}function i0(e){return Object.prototype.hasOwnProperty.call(n0,e)}function wC(e){return Object.prototype.hasOwnProperty.call(nm,e)}function RC(e){return s0(e)?ln().dispatchRequestSchemas[e]:void 0}function EC(e){return wC(e)?ln().dispatchResultSchemas[e]:void 0}function zC(e){return i0(e)?ln().notificationSchemas2026[e]:void 0}var i6=Object.keys(nm),a6=Object.keys(n0);function Yi(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Bi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var PC={ok:!1,reason:"not-in-era"},TC=[Fr,Vr];function IC(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((a)=>Yi(a)&&("execution"in a)))n().tools=s.map((a)=>{if(!Yi(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c});let i=t.capabilities;if(Yi(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var sm={era:"2026-07-28",hasRequestMethod:s0,hasNotificationMethod:i0,hasInputRequestMethod:(e)=>Vf(e)!==void 0,validateRequest:(e,t)=>Bi(RC(e),t),validateResult:(e,t)=>Bi(EC(e),t),validateNotification:(e,t)=>Bi(zC(e),t),validateInputRequest:(e,t)=>Bi(Vf(e),t),validateInputResponse:(e,t)=>Bi($C(e),t),samplingResultVariant:()=>PC,outboundEnvelope(e){return{[Fr]:e.protocolVersion,[Un]:e.clientInfo,[Vr]:e.clientCapabilities,...e.logLevel!==void 0&&{[io]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of TC)if(!(o in e))t.push({key:o,problem:"missing"});let r=ln().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";if(n.length===1&&t.some((i)=>i.key===s&&i.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>KS(e),inputRequestSchema:Vf,decodeResult(e,t){if(!Yi(t))return{kind:"invalid",error:new ve(Pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ve(Pe.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!=="string")return{kind:"invalid",error:new ve(Pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=Yi(i)?i:{},c=t.requestState;if(Object.keys(a).length===0&&typeof c!=="string")return{kind:"invalid",error:new ve(Pe.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:a,...typeof c==="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new ve(Pe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=kC(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ve(Pe.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return _C(hC(e,mC(e,IC(e,t))),r)},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=ln().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((r)=>r.message).join("; ")}`}},fl;function kC(){if(fl)return fl;let e=ln();return fl={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},fl}var ta="2026-07-28";function ho(e){return e!==void 0&&rs(e)?sm:em}function jS(e){if(e.revision!==void 0)return ho(e.revision).era;return e.era==="modern"?sm.era:em.era}function Zf(e){return a0.some((t)=>t.hasRequestMethod(e))}function Hf(e){return a0.some((t)=>t.hasNotificationMethod(e))}var a0=[em,sm];function qS(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function dn(e){if(!qS(e))return;let t=e._meta;return qS(t)?t:void 0}function bl(e){let t=dn(e);return t!==void 0&&Fr in t}function $l(e){let t=dn(e)?.[Fr];return typeof t==="string"?t:void 0}function wl(e){return ho(ta).validateEnvelopeMeta(e)}var OC=Tg({AnnotationsSchema:()=>Zr,AudioContentSchema:()=>Jn,BaseMetadataSchema:()=>Ur,BaseRequestParamsSchema:()=>gt,BlobResourceContentsSchema:()=>qi,BooleanSchemaSchema:()=>Fi,CallToolRequestParamsSchema:()=>wu,CallToolRequestSchema:()=>Ru,CallToolResultSchema:()=>Ui,CancelTaskRequestSchema:()=>Pf,CancelTaskResultSchema:()=>Tf,CancelledNotificationParamsSchema:()=>zc,CancelledNotificationSchema:()=>Oi,ClientCapabilitiesSchema:()=>kc,ClientNotificationSchema:()=>kf,ClientRequestSchema:()=>If,ClientResultSchema:()=>Of,ClientTasksCapabilitySchema:()=>Tc,CompatibilityCallToolResultSchema:()=>gf,CompleteRequestParamsSchema:()=>Yu,CompleteRequestSchema:()=>Xu,CompleteResultSchema:()=>Qu,ContentBlockSchema:()=>Bn,CreateMessageRequestParamsSchema:()=>ju,CreateMessageRequestSchema:()=>qu,CreateMessageResultSchema:()=>Mu,CreateMessageResultWithToolsSchema:()=>Lu,CreateTaskResultSchema:()=>vf,CursorSchema:()=>Ri,DiscoverRequestSchema:()=>Ac,DiscoverResultSchema:()=>jc,ElicitRequestFormParamsSchema:()=>Xn,ElicitRequestParamsSchema:()=>Zu,ElicitRequestSchema:()=>Hu,ElicitRequestURLParamsSchema:()=>Vu,ElicitResultSchema:()=>Ju,ElicitationCompleteNotificationParamsSchema:()=>Gu,ElicitationCompleteNotificationSchema:()=>Ku,EmbeddedResourceSchema:()=>mu,EmptyResultSchema:()=>ki,EnumSchemaSchema:()=>Fu,GetPromptRequestParamsSchema:()=>du,GetPromptRequestSchema:()=>pu,GetPromptResultSchema:()=>_u,GetTaskPayloadRequestSchema:()=>wf,GetTaskPayloadResultSchema:()=>Rf,GetTaskRequestSchema:()=>bf,GetTaskResultSchema:()=>$f,IconSchema:()=>Pc,IconsSchema:()=>co,ImageContentSchema:()=>Kn,ImplementationSchema:()=>Zn,InitializeRequestParamsSchema:()=>Oc,InitializeRequestSchema:()=>Cc,InitializeResultSchema:()=>Nc,InitializedNotificationSchema:()=>xc,JSONArraySchema:()=>ff,JSONObjectSchema:()=>We,JSONRPCErrorResponseSchema:()=>Vn,JSONRPCMessageSchema:()=>Ii,JSONRPCNotificationSchema:()=>Ti,JSONRPCRequestSchema:()=>Pi,JSONRPCResponseSchema:()=>mf,JSONRPCResultResponseSchema:()=>Fn,JSONValueSchema:()=>so,LegacyTitledEnumSchemaSchema:()=>Hi,ListChangedOptionsBaseSchema:()=>_f,ListPromptsRequestSchema:()=>uu,ListPromptsResultSchema:()=>lu,ListResourceTemplatesRequestSchema:()=>Vc,ListResourceTemplatesResultSchema:()=>Zc,ListResourcesRequestSchema:()=>Uc,ListResourcesResultSchema:()=>Fc,ListRootsRequestSchema:()=>tl,ListRootsResultSchema:()=>rl,ListTasksRequestSchema:()=>Ef,ListTasksResultSchema:()=>zf,ListToolsRequestSchema:()=>bu,ListToolsResultSchema:()=>$u,LoggingLevelSchema:()=>fo,LoggingMessageNotificationParamsSchema:()=>Tu,LoggingMessageNotificationSchema:()=>Iu,ModelHintSchema:()=>ku,ModelPreferencesSchema:()=>Ou,MultiSelectEnumSchemaSchema:()=>Uu,NotificationSchema:()=>Pt,NotificationsParamsSchema:()=>zt,NumberSchemaSchema:()=>Yn,PaginatedRequestParamsSchema:()=>Lc,PaginatedRequestSchema:()=>uo,PaginatedResultSchema:()=>lo,PingRequestSchema:()=>Ni,PrimitiveSchemaDefinitionSchema:()=>Ji,ProgressNotificationParamsSchema:()=>Mc,ProgressNotificationSchema:()=>xi,ProgressSchema:()=>qc,ProgressTokenSchema:()=>wi,PromptArgumentSchema:()=>au,PromptListChangedNotificationSchema:()=>yu,PromptMessageSchema:()=>gu,PromptReferenceSchema:()=>Wu,PromptSchema:()=>cu,ReadResourceRequestParamsSchema:()=>Hc,ReadResourceRequestSchema:()=>Gc,ReadResourceResultSchema:()=>Kc,RelatedTaskMetadataSchema:()=>Ec,RequestIdSchema:()=>ao,RequestMetaSchema:()=>Ei,RequestSchema:()=>Ye,ResourceContentsSchema:()=>Ai,ResourceLinkSchema:()=>hu,ResourceListChangedNotificationSchema:()=>Jc,ResourceRequestParamsSchema:()=>Hn,ResourceSchema:()=>Mi,ResourceTemplateReferenceSchema:()=>Bu,ResourceTemplateSchema:()=>Dc,ResourceUpdatedNotificationParamsSchema:()=>su,ResourceUpdatedNotificationSchema:()=>iu,ResultMetaObjectSchema:()=>zi,ResultSchema:()=>Xe,RoleSchema:()=>po,RootSchema:()=>el,RootsListChangedNotificationSchema:()=>ol,SamplingContentSchema:()=>xu,SamplingMessageContentBlockSchema:()=>on,SamplingMessageSchema:()=>Au,ServerCapabilitiesSchema:()=>Ci,ServerNotificationSchema:()=>Nf,ServerRequestSchema:()=>Cf,ServerResultSchema:()=>xf,ServerTasksCapabilitySchema:()=>Ic,SetLevelRequestParamsSchema:()=>zu,SetLevelRequestSchema:()=>Pu,SingleSelectEnumSchemaSchema:()=>Du,StringSchemaSchema:()=>Wn,SubscribeRequestParamsSchema:()=>Bc,SubscribeRequestSchema:()=>Wc,SubscriptionFilterSchema:()=>Li,SubscriptionsAcknowledgedNotificationParamsSchema:()=>tu,SubscriptionsAcknowledgedNotificationSchema:()=>ru,SubscriptionsListenRequestParamsSchema:()=>Qc,SubscriptionsListenRequestSchema:()=>eu,SubscriptionsListenResultMetaSchema:()=>ou,SubscriptionsListenResultSchema:()=>nu,TaskAugmentedRequestParamsSchema:()=>cn,TaskCreationParamsSchema:()=>yf,TaskMetadataSchema:()=>Rc,TaskSchema:()=>mo,TaskStatusNotificationParamsSchema:()=>sl,TaskStatusNotificationSchema:()=>Sf,TaskStatusSchema:()=>nl,TextContentSchema:()=>Gn,TextResourceContentsSchema:()=>ji,TitledMultiSelectEnumSchemaSchema:()=>Ki,TitledSingleSelectEnumSchemaSchema:()=>Zi,ToolAnnotationsSchema:()=>vu,ToolChoiceSchema:()=>Cu,ToolExecutionSchema:()=>Su,ToolListChangedNotificationSchema:()=>Eu,ToolResultContentSchema:()=>Nu,ToolSchema:()=>Di,ToolUseContentSchema:()=>fu,UnsubscribeRequestParamsSchema:()=>Yc,UnsubscribeRequestSchema:()=>Xc,UntitledMultiSelectEnumSchemaSchema:()=>Gi,UntitledSingleSelectEnumSchemaSchema:()=>Vi});var Qt=(e)=>Pi.safeParse(e).success,_o=(e)=>Ti.safeParse(e).success,Qi=(e)=>Fn.safeParse(e).success,Rl=(e)=>Vn.safeParse(e).success;var Hr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function im(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function am(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var MS="x-mcp-header",CC=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,NC=new Set(["string","integer","boolean","number"]);function cm(e){let t=[],r=new Map,o=(s,i,a)=>{if(s===null||typeof s!=="object")return;let c=s;if(MS in c){if(!a||i.length===0)return`${ml(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let l=c[MS];if(typeof l!=="string"||l.length===0)return`${ml(i)}: x-mcp-header MUST be a non-empty string`;if(!CC.test(l))return`${ml(i)}: x-mcp-header '${l}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let d=typeof c.type==="string"?c.type:void 0;if(d===void 0||!NC.has(d))return`${ml(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${d??"<none>"}`;let f=l.toLowerCase(),h=r.get(f);if(h!==void 0)return`x-mcp-header '${l}' is not case-insensitively unique (also declared as '${h}')`;r.set(f,l),t.push({path:i,headerName:l,type:d})}let u=c.properties;if(u!==null&&typeof u==="object")for(let[l,d]of Object.entries(u)){let f=o(d,[...i,l],a);if(f!==void 0)return f}for(let l of xC){let d=c[l];if(d===void 0)continue;let f=Array.isArray(d)?d:d!==null&&typeof d==="object"&&AC.has(l)?Object.values(d):[d];for(let h of f){let _=o(h,[...i,`<${l}>`],!1);if(_!==void 0)return _}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var xC=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],AC=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ml(e){return e.length===0?"<root>":e.join(".")}var gl=-32020,c6=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[B.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[gl,B.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[B.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[B.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[B.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[gl],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[B.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[gl],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],jC={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[gl]:400};function hl(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function um(e){if(!bl(e))return!1;let t=$l(e);if(t===void 0||!rs(t))return!1;let r=dn(e);return r!==void 0&&wl(r).length===0}function lm(e,t){switch(e.reason){case"http-method":return hl("http-method","modern-only-method-not-allowed",405,new le(-32000,"Method not allowed."),!0);case"batch":return hl("jsonrpc-shape","modern-only-batch-not-supported",400,new le(B.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return hl("jsonrpc-shape","modern-only-response-post",400,new le(B.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return hl("era-classification","modern-only-missing-envelope",400,r===void 0?new le(B.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new os({supported:[...t],requested:r}),!0)}}}function El(e,t){return yc(e,t)}function Wi(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function ts(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var LS=!1,Jf="draft-2020-12";function yo(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Jf});else if(r.vendor==="zod"){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!LS)LS=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");o=gc(e,{target:Jf,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(o.type!==void 0)return o;return c0(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function c0(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every((o)=>o!==null&&typeof o==="object"&&(o.type==="object"||c0(o)))}return!1}function qC(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function un(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>qC(o)).join(", ")};return{success:!0,data:r.value}}function MC(e){let t=gc(e,{target:Jf,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var LC=/\\\.\\d\{(\d+)\}/;function DC(e){let t=LC.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>Ln({local:o,offset:n,precision:s}))))}function UC(e,t){let r;switch(e){case"email":r=[lS()];break;case"uri":r=[Sc()];break;case"date":r=[uf()];break;case"date-time":r=DC(t);break}return new Set(r.map((o)=>MC(o)).filter((o)=>o!==void 0))}function FC(e,t,r){if(r!=="zod")return!0;return UC(e,t).has(t)}function u0(e){let t=yo(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function ea(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function VC(e){try{return yo(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new le(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var ZC=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function dm(e){return ZC.has(e)||e.startsWith("x-")}var HC=new Set(["$schema",...Object.keys(Xn.shape.requestedSchema.shape)]),DS={string:Wi([Wn,Vi,Zi,Hi]),number:Wi([Yn]),integer:Wi([Yn]),boolean:Wi([Fi]),array:Wi([Gi,Ki])},GC=new Set(Wn.shape.format.unwrap().options);function KC(e,t,r,o){if(!ea(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(DS,e.type)?DS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))if(n.has(i)||dm(i))s[i]=a;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!GC.has(e.format))s[i]=a;else if(typeof a!=="string"||!FC(e.format,a,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function JC(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&ea(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,KC(a,`properties.${i}`,t,o)]));else if(HC.has(n))r[n]=s;else if(!dm(n))o.push(n);if(o.length>0)throw new le(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function BC(e,t){if(!ea(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!El(Ji,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Bf(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>Bf(o,t[n],`${r}[${n}]`));if(!ea(e)||!ea(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return dm(o)?[]:[s];return Bf(n,t[o],s)})}function WC(e){if(!ts(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=JC(VC(e.requestedSchema),t),o=El(Xn.shape.requestedSchema,r);if(!o.success)throw new le(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${BC(r,o.error.message)}`);let n=Bf(r,o.data);if(n.length>0)throw new le(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter((i)=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new le(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function YC(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var XC=Object.assign(YC,{elicit(e){try{return{method:"elicitation/create",params:WC(e)}}catch(t){throw t instanceof le?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var l0=250;function d0(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function p0(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ve?t.reason:new ve(Pe.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ve?t.reason:new ve(Pe.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function f0(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var QC=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],eN={IdJagTokenExchangeResponseSchema:Mf,OAuthClientInformationFullSchema:Df,OAuthClientInformationSchema:ul,OAuthClientMetadataSchema:cl,OAuthClientRegistrationErrorSchema:Uf,OAuthErrorResponseSchema:Lf,OAuthMetadataSchema:il,OAuthProtectedResourceMetadataSchema:Af,OAuthTokenRevocationRequestSchema:Ff,OAuthTokensSchema:qf,OpenIdProviderDiscoveryMetadataSchema:jf,OpenIdProviderMetadataSchema:al},m0={},h0={};function g0(e,t){let r=e.slice(0,-6);m0[r]=t,h0[r]=(o)=>t.safeParse(o).success}for(let e of QC)g0(e,OC[e]);for(let[e,t]of Object.entries(eN))g0(e,t);var tN=Object.freeze(m0),rN=Object.freeze(h0);function oN(e){switch(e){case"initialize":case"notifications/initialized":return ho(void 0);case"server/discover":return ho(ta);default:return}}var _0=60000,nN=[Fr,Un,Vr,io],sN=["inputResponses","requestState"];function US(e,t){let r=e.params;if(!Xi(r))return{message:e,lifted:{}};let o=r._meta,n=Xi(o)?nN.filter((c)=>(c in o)):[],s=t==="request"?sN.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&Xi(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];if(i.envelope=c,Object.keys(u).length>0)a._meta=u;else delete a._meta}for(let c of s){if(c==="inputResponses")i.inputResponses=a[c];if(c==="requestState")i.requestState=a[c];delete a[c]}return{message:{...e,params:a},lifted:i}}function FS(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function ra(e){return()=>e}var iN=ra(void 0);function pm(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:ra(t)}}}var y0;function fm(e,t){y0(e,t)}var mm=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{y0=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??$c,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ve(Pe.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ve(Pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{if(o?.(n,s),Qi(n)||Rl(n))this._onresponse(n);else if(Qt(n))this._onrequest(n,s);else if(_o(n))this._onnotification(n,s);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ve(Pe.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=US(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=jS(t.classification);if(i!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(Hf(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((i)=>this._onerror(Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=US(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(g,y,m)=>{let S={jsonrpc:"2.0",id:r.id,error:{code:g,message:y,...m!==void 0&&{data:m}}};s?.send(S).catch((v)=>this._onerror(Error(`Failed to send an error response: ${v}`)))};if(t?.classification!==void 0){let g=jS(t.classification);if(g!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${g} but this instance serves ${n.era}`));let y=t.classification.revision??g;i(B.UnsupportedProtocolVersion,`Unsupported protocol version: ${y}`,{supported:this._supportedProtocolVersions,requested:y});return}}if(Zf(r.method)&&!n.hasRequestMethod(r.method)){i(B.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(B.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(B.InvalidParams,c);return}let u=(g,y)=>this._notificationViaCodec(this._resolveOutboundCodec(g.method),g,{...y,relatedRequestId:r.id}),l=(g,y,m)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(g.method),g,y,{...m,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let f=o.inputResponses===void 0?void 0:aN(o.inputResponses),h={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:o.requestState===void 0?iN:ra(o.requestState),signal:d.signal,send:(g,y,m)=>{let S=this._resolveOutboundCodec(g.method);if(this._assertOutboundRequestInEra(S,g.method),ts(y))return l(g,y,m);let v=FS(S,g.method);if(v===void 0)throw TypeError(`'${g.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(g,v,y)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},_=this.buildContext(h,t);Promise.resolve().then(()=>a(r,_)).then(async(g)=>{if(d.signal.aborted)return;let y;try{y=n.encodeResult(r.method,g,this._outboundServerInfo())}catch(S){this._onerror(Error(`Failed to encode result for ${r.method}: ${S}`)),i(B.InternalError,"Internal error");return}let m={result:y,jsonrpc:"2.0",id:r.id};await s?.send(m)},async(g)=>{if(d.signal.aborted)return;let y=Number.isSafeInteger(g.code)?g.code:B.InternalError,m={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(y),message:g.message??"Internal error",...g.data!==void 0&&{data:g.data}}};await s?.send(m)}).catch((g)=>this._onerror(Error(`Failed to send response: ${g}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===d)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Qi(e))r(e);else r(le.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),ts(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=FS(o,e.method);if(n===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return ho(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=oN(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Zf(t)&&!e.hasRequestMethod(t))throw new ve(Pe.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a}=o??{},c=Date.now(),u,l;return new Promise((d,f)=>{let h=(R)=>{f(R)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(R){h(R);return}if(o?.signal?.aborted){let R=o.signal.reason;throw R instanceof ve?R:new ve(Pe.RequestTimeout,String(R))}let _=e.era===ta&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,g=this._requestMessageId++;l=g;let y={...t,jsonrpc:"2.0",id:g};if(o?.onprogress)this._progressHandlers.set(g,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:g}};let m=this._envelopeOutbound(y),S=!1,v=(R)=>{if(S)return;if(this._progressHandlers.delete(g),_===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(R)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((b)=>this._onerror(Error(`Failed to send cancellation: ${b}`)));else _.abort();f(R instanceof ve?R:new ve(Pe.RequestTimeout,String(R)))};this._responseHandlers.set(g,(R)=>{if(o?.signal?.aborted)return;if(S=!0,R instanceof Error)return f(R);let b;try{b=e.decodeResult(t.method,R.result)}catch(C){return f(C instanceof Error?C:Error(String(C)))}if(b.kind==="invalid")return f(b.error);if(b.kind==="input_required"){if(o?.allowInputRequired===!0)return d(cN(b));let C={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(D,N)=>this._requestWithSchemaViaCodec(e,D===void 0?{method:t.method}:{method:t.method,params:D},r,N)};return d(this._resolveNonCompleteResult(b,C))}let E=b.result;un(r,E).then((C)=>{if(C.success)d(C.data);else f(new ve(Pe.InvalidResult,`Invalid result for ${t.method}: ${C.error}`))},f)}),u=()=>v(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let w=o?.timeout??_0,P=()=>v(new ve(Pe.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(g,w,o?.maxTotalTimeout,P,o?.resetTimeoutOnProgress??!1),this._transport.send(m,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:_?.signal}).catch((R)=>{this._progressHandlers.delete(g),f(R)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(l!==void 0)this._responseHandlers.delete(l),this._cleanupTimeout(l)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ve(Pe.NotConnected,"Not connected");if(Hf(t.method)&&!e.hasNotificationMethod(t.method))throw new ve(Pe.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(o,r).catch((n)=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t==="function"){if(!Zf(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era")a=i.validateInputRequest(e,n);if(!a.ok){if(a.reason==="not-in-era")throw new le(B.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await un(t.params,{...n.params});if(!i.success)throw new le(B.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!Hf(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok){if(s.reason==="not-in-era")throw new le(B.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await un(t.params,{...o.params});if(!n.success)throw new le(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Xi(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function hm(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=Xi(i)&&Xi(s)?{...i,...s}:s}return r}function VS(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function aN(e){let t={},r=[];if(!VS(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!VS(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function cN(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
48
+ * content-type
49
+ * Copyright(c) 2015 Douglas Christopher Wilson
50
+ * MIT Licensed
51
+ */var uN=H((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(a){if(!a)throw TypeError("argument string is required");var c=typeof a==="object"?s(a):a;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var f,h,_;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,f=h[1].toLowerCase(),_=h[2],_.charCodeAt(0)===34){if(_=_.slice(1,-1),_.indexOf("\\")!==-1)_=_.replace(r,"$1")}d.parameters[f]=_}if(u!==c.length)throw TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader==="function")c=a.getHeader("content-type");else if(typeof a.headers==="object")c=a.headers&&a.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),u6=Ya(uN(),1);var v0=10485760,gm=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??v0}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){while(this._buffer){let e=this._buffer.indexOf(`
52
+ `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return S0(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function S0(e){return Ii.parse(JSON.parse(e))}function _m(e){return JSON.stringify(e)+`
53
+ `}var lN=/^[A-Za-z0-9._-]{1,128}$/;function dN(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!lN.test(e)){let r=[...e].filter((o)=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map((o)=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function pN(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function ym(e){let t=dN(e);return pN(e,t.warnings),t.isValid}function fN(e){return typeof e==="object"&&e!==null&&"_zod"in e}function mN(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function hN(e){if(typeof e!=="object"||e===null)return!1;if(ts(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((r)=>fN(r))}function zl(e){if(e===void 0)return;if(hN(e))return T(e);if(typeof e==="object"&&e!==null&&!ts(e)&&Object.values(e).some((t)=>mN(t)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!ts(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}var Pl=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(m){super();if(!e.IDENTIFIER.test(m))throw Error("CodeGen: name must be a valid identifier");this.str=m}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(m){super();this._items=typeof m==="string"?[m]:m}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let m=this._items[0];return m===""||m==='""'}get str(){var m;return(m=this._str)!==null&&m!==void 0?m:this._str=this._items.reduce((S,v)=>`${S}${v}`,"")}get names(){var m;return(m=this._names)!==null&&m!==void 0?m:this._names=this._items.reduce((S,v)=>{if(v instanceof r)S[v.str]=(S[v.str]||0)+1;return S},{})}};e._Code=o,e.nil=new o("");function n(m,...S){let v=[m[0]],w=0;while(w<S.length)a(v,S[w]),v.push(m[++w]);return new o(v)}e._=n;let s=new o("+");function i(m,...S){let v=[h(m[0])],w=0;while(w<S.length)v.push(s),a(v,S[w]),v.push(s,h(m[++w]));return c(v),new o(v)}e.str=i;function a(m,S){if(S instanceof o)m.push(...S._items);else if(S instanceof r)m.push(S);else m.push(d(S))}e.addCodeArg=a;function c(m){let S=1;while(S<m.length-1){if(m[S]===s){let v=u(m[S-1],m[S+1]);if(v!==void 0){m.splice(S-1,3,v);continue}m[S++]="+"}S++}}function u(m,S){if(S==='""')return m;if(m==='""')return S;if(typeof m=="string"){if(S instanceof r||m[m.length-1]!=='"')return;if(typeof S!="string")return`${m.slice(0,-1)}${S}"`;if(S[0]==='"')return m.slice(0,-1)+S.slice(1);return}if(typeof S=="string"&&S[0]==='"'&&!(m instanceof r))return`"${m}${S.slice(1)}`}function l(m,S){return S.emptyStr()?m:m.emptyStr()?S:i`${m}${S}`}e.strConcat=l;function d(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:h(Array.isArray(m)?m.join(","):m)}function f(m){return new o(h(m))}e.stringify=f;function h(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function _(m){return typeof m=="string"&&e.IDENTIFIER.test(m)?new o(`.${m}`):n`[${m}]`}e.getProperty=_;function g(m){if(typeof m=="string"&&e.IDENTIFIER.test(m))return new o(`${m}`);throw Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}e.getEsmExportName=g;function y(m){return new o(m.toString())}e.regexpCode=y}),b0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Pl();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`);this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(c))||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u);this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var a=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:f}=d,h=(l=u.key)!==null&&l!==void 0?l:u.ref,_=this._values[f];if(_){let m=_.get(h);if(m)return m}else _=this._values[f]=new Map;_.set(h,d);let g=this._scope[f]||(this._scope[f]=[]),y=g.length;return g[y]=u.ref,d.setValue(u,{property:f,itemIndex:y}),d}getValue(c,u){let l=this._values[c];if(!l)return;return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,(d)=>{if(d.value===void 0)throw Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let f=t.nil;for(let h in c){let _=c[h];if(!_)continue;let g=l[h]=l[h]||new Map;_.forEach((y)=>{if(g.has(y))return;g.set(y,o.Started);let m=u(y);if(m){let S=this.opts.es5?e.varKinds.var:e.varKinds.const;f=t._`${f}${S} ${y} = ${m};${this.opts._n}`}else if(m=d===null||d===void 0?void 0:d(y))f=t._`${f}${m}${this.opts._n}`;else throw new r(y);g.set(y,o.Completed)})}return f}};e.ValueScope=a}),Se=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=Pl(),r=b0();var o=Pl();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=b0();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(z,k){return this}},i=class extends s{constructor(z,k,j){super();this.varKind=z,this.name=k,this.rhs=j}render({es5:z,_n:k}){let j=z?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${j} ${this.name}${J};`+k}optimizeNames(z,k){if(!z[this.name.str])return;if(this.rhs)this.rhs=X(this.rhs,z,k);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(z,k,j){super();this.lhs=z,this.rhs=k,this.sideEffects=j}render({_n:z}){return`${this.lhs} = ${this.rhs};`+z}optimizeNames(z,k){if(this.lhs instanceof t.Name&&!z[this.lhs.str]&&!this.sideEffects)return;return this.rhs=X(this.rhs,z,k),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(z,k,j,J){super(z,j,J);this.op=k}render({_n:z}){return`${this.lhs} ${this.op}= ${this.rhs};`+z}},u=class extends s{constructor(z){super();this.label=z,this.names={}}render({_n:z}){return`${this.label}:`+z}},l=class extends s{constructor(z){super();this.label=z,this.names={}}render({_n:z}){return`break${this.label?` ${this.label}`:""};`+z}},d=class extends s{constructor(z){super();this.error=z}render({_n:z}){return`throw ${this.error};`+z}get names(){return this.error.names}},f=class extends s{constructor(z){super();this.code=z}render({_n:z}){return`${this.code};`+z}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(z,k){return this.code=X(this.code,z,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends s{constructor(z=[]){super();this.nodes=z}render(z){return this.nodes.reduce((k,j)=>k+j.render(z),"")}optimizeNodes(){let{nodes:z}=this,k=z.length;while(k--){let j=z[k].optimizeNodes();if(Array.isArray(j))z.splice(k,1,...j);else if(j)z[k]=j;else z.splice(k,1)}return z.length>0?this:void 0}optimizeNames(z,k){let{nodes:j}=this,J=j.length;while(J--){let ue=j[J];if(ue.optimizeNames(z,k))continue;ze(z,ue.names),j.splice(J,1)}return j.length>0?this:void 0}get names(){return this.nodes.reduce((z,k)=>F(z,k.names),{})}},_=class extends h{render(z){return"{"+z._n+super.render(z)+"}"+z._n}},g=class extends h{},y=class extends _{};y.kind="else";var m=class z extends _{constructor(k,j){super(j);this.condition=k}render(k){let j=`if(${this.condition})`+super.render(k);if(this.else)j+="else "+this.else.render(k);return j}optimizeNodes(){super.optimizeNodes();let k=this.condition;if(k===!0)return this.nodes;let j=this.else;if(j){let J=j.optimizeNodes();j=this.else=Array.isArray(J)?new y(J):J}if(j){if(k===!1)return j instanceof z?j:j.nodes;if(this.nodes.length)return this;return new z(He(k),j instanceof z?[j]:j.nodes)}if(k===!1||!this.nodes.length)return;return this}optimizeNames(k,j){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(k,j),!(super.optimizeNames(k,j)||this.else))return;return this.condition=X(this.condition,k,j),this}get names(){let k=super.names;if(Y(k,this.condition),this.else)F(k,this.else.names);return k}};m.kind="if";var S=class extends _{};S.kind="for";var v=class extends S{constructor(z){super();this.iteration=z}render(z){return`for(${this.iteration})`+super.render(z)}optimizeNames(z,k){if(!super.optimizeNames(z,k))return;return this.iteration=X(this.iteration,z,k),this}get names(){return F(super.names,this.iteration.names)}},w=class extends S{constructor(z,k,j,J){super();this.varKind=z,this.name=k,this.from=j,this.to=J}render(z){let k=z.es5?r.varKinds.var:this.varKind,{name:j,from:J,to:ue}=this;return`for(${k} ${j}=${J}; ${j}<${ue}; ${j}++)`+super.render(z)}get names(){return Y(Y(super.names,this.from),this.to)}},P=class extends S{constructor(z,k,j,J){super();this.loop=z,this.varKind=k,this.name=j,this.iterable=J}render(z){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(z)}optimizeNames(z,k){if(!super.optimizeNames(z,k))return;return this.iterable=X(this.iterable,z,k),this}get names(){return F(super.names,this.iterable.names)}},R=class extends _{constructor(z,k,j){super();this.name=z,this.args=k,this.async=j}render(z){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(z)}};R.kind="func";var b=class extends h{render(z){return"return "+super.render(z)}};b.kind="return";var E=class extends _{render(z){let k="try"+super.render(z);if(this.catch)k+=this.catch.render(z);if(this.finally)k+=this.finally.render(z);return k}optimizeNodes(){var z,k;return super.optimizeNodes(),(z=this.catch)===null||z===void 0||z.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(z,k){var j,J;return super.optimizeNames(z,k),(j=this.catch)===null||j===void 0||j.optimizeNames(z,k),(J=this.finally)===null||J===void 0||J.optimizeNames(z,k),this}get names(){let z=super.names;if(this.catch)F(z,this.catch.names);if(this.finally)F(z,this.finally.names);return z}},C=class extends _{constructor(z){super();this.error=z}render(z){return`catch(${this.error})`+super.render(z)}};C.kind="catch";var D=class extends _{render(z){return"finally"+super.render(z)}};D.kind="finally";var N=class{constructor(z,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
54
+ `:""},this._extScope=z,this._scope=new r.Scope({parent:z}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(z){return this._scope.name(z)}scopeName(z){return this._extScope.name(z)}scopeValue(z,k){let j=this._extScope.value(z,k);return(this._values[j.prefix]||(this._values[j.prefix]=new Set)).add(j),j}getScopeValue(z,k){return this._extScope.getValue(z,k)}scopeRefs(z){return this._extScope.scopeRefs(z,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(z,k,j,J){let ue=this._scope.toName(k);if(j!==void 0&&J)this._constants[ue.str]=j;return this._leafNode(new i(z,ue,j)),ue}const(z,k,j){return this._def(r.varKinds.const,z,k,j)}let(z,k,j){return this._def(r.varKinds.let,z,k,j)}var(z,k,j){return this._def(r.varKinds.var,z,k,j)}assign(z,k,j){return this._leafNode(new a(z,k,j))}add(z,k){return this._leafNode(new c(z,e.operators.ADD,k))}code(z){if(typeof z=="function")z();else if(z!==t.nil)this._leafNode(new f(z));return this}object(...z){let k=["{"];for(let[j,J]of z){if(k.length>1)k.push(",");if(k.push(j),j!==J||this.opts.es5)k.push(":"),(0,t.addCodeArg)(k,J)}return k.push("}"),new t._Code(k)}if(z,k,j){if(this._blockNode(new m(z)),k&&j)this.code(k).else().code(j).endIf();else if(k)this.code(k).endIf();else if(j)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(z){return this._elseNode(new m(z))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(m,y)}_for(z,k){if(this._blockNode(z),k)this.code(k).endFor();return this}for(z,k){return this._for(new v(z),k)}forRange(z,k,j,J,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){let Re=this._scope.toName(z);return this._for(new w(ue,Re,k,j),()=>J(Re))}forOf(z,k,j,J=r.varKinds.const){let ue=this._scope.toName(z);if(this.opts.es5){let Re=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,t._`${Re}.length`,(ge)=>{this.var(ue,t._`${Re}[${ge}]`),j(ue)})}return this._for(new P("of",J,ue,k),()=>j(ue))}forIn(z,k,j,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(z,t._`Object.keys(${k})`,j);let ue=this._scope.toName(z);return this._for(new P("in",J,ue,k),()=>j(ue))}endFor(){return this._endBlockNode(S)}label(z){return this._leafNode(new u(z))}break(z){return this._leafNode(new l(z))}return(z){let k=new b;if(this._blockNode(k),this.code(z),k.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(z,k,j){if(!k&&!j)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code(z),k){let ue=this.name("e");this._currNode=J.catch=new C(ue),k(ue)}if(j)this._currNode=J.finally=new D,this.code(j);return this._endBlockNode(C,D)}throw(z){return this._leafNode(new d(z))}block(z,k){if(this._blockStarts.push(this._nodes.length),z)this.code(z).endBlock(k);return this}endBlock(z){let k=this._blockStarts.pop();if(k===void 0)throw Error("CodeGen: not in self-balancing block");let j=this._nodes.length-k;if(j<0||z!==void 0&&j!==z)throw Error(`CodeGen: wrong number of nodes: ${j} vs ${z} expected`);return this._nodes.length=k,this}func(z,k=t.nil,j,J){if(this._blockNode(new R(z,k,j)),J)this.code(J).endFunc();return this}endFunc(){return this._endBlockNode(R)}optimize(z=1){while(z-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(z){return this._currNode.nodes.push(z),this}_blockNode(z){this._currNode.nodes.push(z),this._nodes.push(z)}_endBlockNode(z,k){let j=this._currNode;if(j instanceof z||k&&j instanceof k)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${k?`${z.kind}/${k.kind}`:z.kind}"`)}_elseNode(z){let k=this._currNode;if(!(k instanceof m))throw Error('CodeGen: "else" without "if"');return this._currNode=k.else=z,this}get _root(){return this._nodes[0]}get _currNode(){let z=this._nodes;return z[z.length-1]}set _currNode(z){let k=this._nodes;k[k.length-1]=z}};e.CodeGen=N;function F(z,k){for(let j in k)z[j]=(z[j]||0)+(k[j]||0);return z}function Y(z,k){return k instanceof t._CodeOrName?F(z,k.names):z}function X(z,k,j){if(z instanceof t.Name)return J(z);if(!ue(z))return z;return new t._Code(z._items.reduce((Re,ge)=>{if(ge instanceof t.Name)ge=J(ge);if(ge instanceof t._Code)Re.push(...ge._items);else Re.push(ge);return Re},[]));function J(Re){let ge=j[Re.str];if(ge===void 0||k[Re.str]!==1)return Re;return delete k[Re.str],ge}function ue(Re){return Re instanceof t._Code&&Re._items.some((ge)=>ge instanceof t.Name&&k[ge.str]===1&&j[ge.str]!==void 0)}}function ze(z,k){for(let j in k)z[j]=(z[j]||0)-(k[j]||0)}function He(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:t._`!${K(z)}`}e.not=He;let De=q(e.operators.AND);function at(...z){return z.reduce(De)}e.and=at;let Ie=q(e.operators.OR);function O(...z){return z.reduce(Ie)}e.or=O;function q(z){return(k,j)=>k===t.nil?j:j===t.nil?k:t._`${K(k)} ${z} ${K(j)}`}function K(z){return z instanceof t.Name?z:t._`(${z})`}}),ke=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=Se(),r=Pl();function o(R){let b={};for(let E of R)b[E]=!0;return b}e.toHash=o;function n(R,b){if(typeof b=="boolean")return b;if(Object.keys(b).length===0)return!0;return s(R,b),!i(b,R.self.RULES.all)}e.alwaysValidSchema=n;function s(R,b=R.schema){let{opts:E,self:C}=R;if(!E.strictSchema)return;if(typeof b==="boolean")return;let D=C.RULES.keywords;for(let N in b)if(!D[N])P(R,`unknown keyword: "${N}"`)}e.checkUnknownRules=s;function i(R,b){if(typeof R=="boolean")return!R;for(let E in R)if(b[E])return!0;return!1}e.schemaHasRules=i;function a(R,b){if(typeof R=="boolean")return!R;for(let E in R)if(E!=="$ref"&&b.all[E])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:R,schemaPath:b},E,C,D){if(!D){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return t._`${E}`}return t._`${R}${b}${(0,t.getProperty)(C)}`}e.schemaRefOrVal=c;function u(R){return f(decodeURIComponent(R))}e.unescapeFragment=u;function l(R){return encodeURIComponent(d(R))}e.escapeFragment=l;function d(R){if(typeof R=="number")return`${R}`;return R.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function f(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=f;function h(R,b){if(Array.isArray(R))for(let E of R)b(E);else b(R)}e.eachItem=h;function _({mergeNames:R,mergeToName:b,mergeValues:E,resultToName:C}){return(D,N,F,Y)=>{let X=F===void 0?N:F instanceof t.Name?(N instanceof t.Name?R(D,N,F):b(D,N,F),F):N instanceof t.Name?(b(D,F,N),N):E(N,F);return Y===t.Name&&!(X instanceof t.Name)?C(D,X):X}}e.mergeEvaluated={props:_({mergeNames:(R,b,E)=>R.if(t._`${E} !== true && ${b} !== undefined`,()=>{R.if(t._`${b} === true`,()=>R.assign(E,!0),()=>R.assign(E,t._`${E} || {}`).code(t._`Object.assign(${E}, ${b})`))}),mergeToName:(R,b,E)=>R.if(t._`${E} !== true`,()=>{if(b===!0)R.assign(E,!0);else R.assign(E,t._`${E} || {}`),y(R,E,b)}),mergeValues:(R,b)=>R===!0?!0:{...R,...b},resultToName:g}),items:_({mergeNames:(R,b,E)=>R.if(t._`${E} !== true && ${b} !== undefined`,()=>R.assign(E,t._`${b} === true ? true : ${E} > ${b} ? ${E} : ${b}`)),mergeToName:(R,b,E)=>R.if(t._`${E} !== true`,()=>R.assign(E,b===!0?!0:t._`${E} > ${b} ? ${E} : ${b}`)),mergeValues:(R,b)=>R===!0?!0:Math.max(R,b),resultToName:(R,b)=>R.var("items",b)})};function g(R,b){if(b===!0)return R.var("props",!0);let E=R.var("props",t._`{}`);if(b!==void 0)y(R,E,b);return E}e.evaluatedPropsToName=g;function y(R,b,E){Object.keys(E).forEach((C)=>R.assign(t._`${b}${(0,t.getProperty)(C)}`,!0))}e.setEvaluated=y;let m={};function S(R,b){return R.scopeValue("func",{ref:b,code:m[b.code]||(m[b.code]=new r._Code(b.code))})}e.useFunc=S;var v;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(v||(e.Type=v={}));function w(R,b,E){if(R instanceof t.Name){let C=b===v.Num;return E?C?t._`"[" + ${R} + "]"`:t._`"['" + ${R} + "']"`:C?t._`"/" + ${R}`:t._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(R).toString():"/"+d(R)}e.getErrorPath=w;function P(R,b,E=R.opts.strictSchema){if(!E)return;if(b=`strict mode: ${b}`,E===!0)throw Error(b);R.self.logger.warn(b)}e.checkStrictMode=P}),dr=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),Il=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=Se(),r=ke(),o=dr();e.keywordError={message:({keyword:y})=>t.str`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:m})=>m?t.str`"${y}" keyword must be ${m} ($data)`:t.str`"${y}" keyword is invalid ($data)`};function n(y,m=e.keywordError,S,v){let{it:w}=y,{gen:P,compositeRule:R,allErrors:b}=w,E=d(y,m,S);if(v!==null&&v!==void 0?v:R||b)c(P,E);else u(w,t._`[${E}]`)}e.reportError=n;function s(y,m=e.keywordError,S){let{it:v}=y,{gen:w,compositeRule:P,allErrors:R}=v;if(c(w,d(y,m,S)),!(P||R))u(v,o.default.vErrors)}e.reportExtraError=s;function i(y,m){y.assign(o.default.errors,m),y.if(t._`${o.default.vErrors} !== null`,()=>y.if(m,()=>y.assign(t._`${o.default.vErrors}.length`,m),()=>y.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:y,keyword:m,schemaValue:S,data:v,errsCount:w,it:P}){if(w===void 0)throw Error("ajv implementation error");let R=y.name("err");y.forRange("i",w,o.default.errors,(b)=>{if(y.const(R,t._`${o.default.vErrors}[${b}]`),y.if(t._`${R}.instancePath === undefined`,()=>y.assign(t._`${R}.instancePath`,(0,t.strConcat)(o.default.instancePath,P.errorPath))),y.assign(t._`${R}.schemaPath`,t.str`${P.errSchemaPath}/${m}`),P.opts.verbose)y.assign(t._`${R}.schema`,S),y.assign(t._`${R}.data`,v)})}e.extendErrors=a;function c(y,m){let S=y.const("err",m);y.if(t._`${o.default.vErrors} === null`,()=>y.assign(o.default.vErrors,t._`[${S}]`),t._`${o.default.vErrors}.push(${S})`),y.code(t._`${o.default.errors}++`)}function u(y,m){let{gen:S,validateName:v,schemaEnv:w}=y;if(w.$async)S.throw(t._`new ${y.ValidationError}(${m})`);else S.assign(t._`${v}.errors`,m),S.return(!1)}let l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(y,m,S){let{createErrors:v}=y.it;if(v===!1)return t._`{}`;return f(y,m,S)}function f(y,m,S={}){let{gen:v,it:w}=y,P=[h(w,S),_(y,S)];return g(y,m,P),v.object(...P)}function h({errorPath:y},{instancePath:m}){let S=m?t.str`${y}${(0,r.getErrorPath)(m,r.Type.Str)}`:y;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,S)]}function _({keyword:y,it:{errSchemaPath:m}},{schemaPath:S,parentSchema:v}){let w=v?m:t.str`${m}/${y}`;if(S)w=t.str`${w}${(0,r.getErrorPath)(S,r.Type.Str)}`;return[l.schemaPath,w]}function g(y,{params:m,message:S},v){let{keyword:w,data:P,schemaValue:R,it:b}=y,{opts:E,propertyName:C,topSchemaRef:D,schemaPath:N}=b;if(v.push([l.keyword,w],[l.params,typeof m=="function"?m(y):m||t._`{}`]),E.messages)v.push([l.message,typeof S=="function"?S(y):S]);if(E.verbose)v.push([l.schema,R],[l.parentSchema,t._`${D}${N}`],[o.default.data,P]);if(C)v.push([l.propertyName,C])}}),gN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Il(),r=Se(),o=dr(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;if(l===!1)a(c,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${d}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;if(d===!1)l.var(u,!1),a(c);else l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,f={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(f,n,void 0,u)}}),$0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),w0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((i)=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some((a)=>n[a]!==void 0))}e.shouldUseRule=o}),Tl=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=$0(),r=w0(),o=Il(),n=Se(),s=ke();var i;(function(v){v[v.Correct=0]="Correct",v[v.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(v){let w=c(v.type);if(w.includes("null")){if(v.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!w.length&&v.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(v.nullable===!0)w.push("null")}return w}e.getSchemaTypes=a;function c(v){let w=Array.isArray(v)?v:v?[v]:[];if(w.every(t.isJSONType))return w;throw Error("type must be JSONType or JSONType[]: "+w.join(","))}e.getJSONTypes=c;function u(v,w){let{gen:P,data:R,opts:b}=v,E=d(w,b.coerceTypes),C=w.length>0&&!(E.length===0&&w.length===1&&(0,r.schemaHasRulesForType)(v,w[0]));if(C){let D=g(w,R,b.strictNumbers,i.Wrong);P.if(D,()=>{if(E.length)f(v,w,E);else m(v)})}return C}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(v,w){return w?v.filter((P)=>l.has(P)||w==="array"&&P==="array"):[]}function f(v,w,P){let{gen:R,data:b,opts:E}=v,C=R.let("dataType",n._`typeof ${b}`),D=R.let("coerced",n._`undefined`);if(E.coerceTypes==="array")R.if(n._`${C} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>R.assign(b,n._`${b}[0]`).assign(C,n._`typeof ${b}`).if(g(w,b,E.strictNumbers),()=>R.assign(D,b)));R.if(n._`${D} !== undefined`);for(let F of P)if(l.has(F)||F==="array"&&E.coerceTypes==="array")N(F);R.else(),m(v),R.endIf(),R.if(n._`${D} !== undefined`,()=>{R.assign(b,D),h(v,D)});function N(F){switch(F){case"string":R.elseIf(n._`${C} == "number" || ${C} == "boolean"`).assign(D,n._`"" + ${b}`).elseIf(n._`${b} === null`).assign(D,n._`""`);return;case"number":R.elseIf(n._`${C} == "boolean" || ${b} === null
55
+ || (${C} == "string" && ${b} && ${b} == +${b})`).assign(D,n._`+${b}`);return;case"integer":R.elseIf(n._`${C} === "boolean" || ${b} === null
56
+ || (${C} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign(D,n._`+${b}`);return;case"boolean":R.elseIf(n._`${b} === "false" || ${b} === 0 || ${b} === null`).assign(D,!1).elseIf(n._`${b} === "true" || ${b} === 1`).assign(D,!0);return;case"null":R.elseIf(n._`${b} === "" || ${b} === 0 || ${b} === false`),R.assign(D,null);return;case"array":R.elseIf(n._`${C} === "string" || ${C} === "number"
57
+ || ${C} === "boolean" || ${b} === null`).assign(D,n._`[${b}]`)}}}function h({gen:v,parentData:w,parentDataProperty:P},R){v.if(n._`${w} !== undefined`,()=>v.assign(n._`${w}[${P}]`,R))}function _(v,w,P,R=i.Correct){let b=R===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(v){case"null":return n._`${w} ${b} null`;case"array":E=n._`Array.isArray(${w})`;break;case"object":E=n._`${w} && typeof ${w} == "object" && !Array.isArray(${w})`;break;case"integer":E=C(n._`!(${w} % 1) && !isNaN(${w})`);break;case"number":E=C();break;default:return n._`typeof ${w} ${b} ${v}`}return R===i.Correct?E:(0,n.not)(E);function C(D=n.nil){return(0,n.and)(n._`typeof ${w} == "number"`,D,P?n._`isFinite(${w})`:n.nil)}}e.checkDataType=_;function g(v,w,P,R){if(v.length===1)return _(v[0],w,P,R);let b,E=(0,s.toHash)(v);if(E.array&&E.object){let C=n._`typeof ${w} != "object"`;b=E.null?C:n._`!${w} || ${C}`,delete E.null,delete E.array,delete E.object}else b=n.nil;if(E.number)delete E.integer;for(let C in E)b=(0,n.and)(b,_(C,w,P,R));return b}e.checkDataTypes=g;let y={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:w})=>typeof v=="string"?n._`{type: ${v}}`:n._`{type: ${w}}`};function m(v){let w=S(v);(0,o.reportError)(w,y)}e.reportTypeError=m;function S(v){let{gen:w,data:P,schema:R}=v,b=(0,s.schemaRefOrVal)(v,R,"type");return{gen:w,keyword:"type",data:P,schema:R.type,schemaCode:b,schemaValue:b,parentSchema:R,params:{},it:v}}}),_N=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=Se(),r=ke();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else if(i==="array"&&Array.isArray(c))c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let f=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${f}`);return}let h=t._`${f} === undefined`;if(d.useDefaults==="empty")h=t._`${h} || ${f} === null || ${f} === ""`;c.if(h,t._`${f} = ${(0,t.stringify)(a)}`)}}),pr=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=Se(),r=ke(),o=dr(),n=ke();function s(v,w){let{gen:P,data:R,it:b}=v;P.if(d(P,R,w,b.opts.ownProperties),()=>{v.setParams({missingProperty:t._`${w}`},!0),v.error()})}e.checkReportMissingProp=s;function i({gen:v,data:w,it:{opts:P}},R,b){return(0,t.or)(...R.map((E)=>(0,t.and)(d(v,w,E,P.ownProperties),t._`${b} = ${E}`)))}e.checkMissingProp=i;function a(v,w){v.setParams({missingProperty:w},!0),v.error()}e.reportMissingProp=a;function c(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(v,w,P){return t._`${c(v)}.call(${w}, ${P})`}e.isOwnProperty=u;function l(v,w,P,R){let b=t._`${w}${(0,t.getProperty)(P)} !== undefined`;return R?t._`${b} && ${u(v,w,P)}`:b}e.propertyInData=l;function d(v,w,P,R){let b=t._`${w}${(0,t.getProperty)(P)} === undefined`;return R?(0,t.or)(b,(0,t.not)(u(v,w,P))):b}e.noPropertyInData=d;function f(v){return v?Object.keys(v).filter((w)=>w!=="__proto__"):[]}e.allSchemaProperties=f;function h(v,w){return f(w).filter((P)=>!(0,r.alwaysValidSchema)(v,w[P]))}e.schemaProperties=h;function _({schemaCode:v,data:w,it:{gen:P,topSchemaRef:R,schemaPath:b,errorPath:E},it:C},D,N,F){let Y=F?t._`${v}, ${w}, ${R}${b}`:w,X=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,C.parentData],[o.default.parentDataProperty,C.parentDataProperty],[o.default.rootData,o.default.rootData]];if(C.opts.dynamicRef)X.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ze=t._`${Y}, ${P.object(...X)}`;return N!==t.nil?t._`${D}.call(${N}, ${ze})`:t._`${D}(${ze})`}e.callValidateCode=_;let g=t._`new RegExp`;function y({gen:v,it:{opts:w}},P){let R=w.unicodeRegExp?"u":"",{regExp:b}=w.code,E=b(P,R);return v.scopeValue("pattern",{key:E.toString(),ref:E,code:t._`${b.code==="new RegExp"?g:(0,n.useFunc)(v,b)}(${P}, ${R})`})}e.usePattern=y;function m(v){let{gen:w,data:P,keyword:R,it:b}=v,E=w.name("valid");if(b.allErrors){let D=w.let("valid",!0);return C(()=>w.assign(D,!1)),D}return w.var(E,!0),C(()=>w.break()),E;function C(D){let N=w.const("len",t._`${P}.length`);w.forRange("i",0,N,(F)=>{v.subschema({keyword:R,dataProp:F,dataPropType:r.Type.Num},E),w.if((0,t.not)(E),D)})}}e.validateArray=m;function S(v){let{gen:w,schema:P,keyword:R,it:b}=v;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((D)=>(0,r.alwaysValidSchema)(b,D))&&!b.opts.unevaluated)return;let E=w.let("valid",!1),C=w.name("_valid");w.block(()=>P.forEach((D,N)=>{let F=v.subschema({keyword:R,schemaProp:N,compositeRule:!0},C);if(w.assign(E,t._`${E} || ${C}`),!v.mergeValidEvaluated(F,C))w.if((0,t.not)(E))})),v.result(E,()=>v.reset(),()=>v.error(!0))}e.validateUnion=S}),yN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=Se(),r=dr(),o=pr(),n=Il();function s(h,_){let{gen:g,keyword:y,schema:m,parentSchema:S,it:v}=h,w=_.macro.call(v.self,m,S,v),P=l(g,y,w);if(v.opts.validateSchema!==!1)v.self.validateSchema(w,!0);let R=g.name("valid");h.subschema({schema:w,schemaPath:t.nil,errSchemaPath:`${v.errSchemaPath}/${y}`,topSchemaRef:P,compositeRule:!0},R),h.pass(R,()=>h.error(!0))}e.macroKeywordCode=s;function i(h,_){var g;let{gen:y,keyword:m,schema:S,parentSchema:v,$data:w,it:P}=h;u(P,_);let R=l(y,m,!w&&_.compile?_.compile.call(P.self,S,v,P):_.validate),b=y.let("valid");h.block$data(b,E),h.ok((g=_.valid)!==null&&g!==void 0?g:b);function E(){if(_.errors===!1){if(N(),_.modifying)a(h);F(()=>h.error())}else{let Y=_.async?C():D();if(_.modifying)a(h);F(()=>c(h,Y))}}function C(){let Y=y.let("ruleErrs",null);return y.try(()=>N(t._`await `),(X)=>y.assign(b,!1).if(t._`${X} instanceof ${P.ValidationError}`,()=>y.assign(Y,t._`${X}.errors`),()=>y.throw(X))),Y}function D(){let Y=t._`${R}.errors`;return y.assign(Y,null),N(t.nil),Y}function N(Y=_.async?t._`await `:t.nil){let X=P.opts.passContext?r.default.this:r.default.self,ze=!(("compile"in _)&&!w||_.schema===!1);y.assign(b,t._`${Y}${(0,o.callValidateCode)(h,R,X,ze)}`,_.modifying)}function F(Y){var X;y.if((0,t.not)((X=_.valid)!==null&&X!==void 0?X:b),Y)}}e.funcKeywordCode=i;function a(h){let{gen:_,data:g,it:y}=h;_.if(y.parentData,()=>_.assign(g,t._`${y.parentData}[${y.parentDataProperty}]`))}function c(h,_){let{gen:g}=h;g.if(t._`Array.isArray(${_})`,()=>{g.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${_} : ${r.default.vErrors}.concat(${_})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function u({schemaEnv:h},_){if(_.async&&!h.$async)throw Error("async keyword in sync schema")}function l(h,_,g){if(g===void 0)throw Error(`keyword "${_}" failed to compile`);return h.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,t.stringify)(g)})}function d(h,_,g=!1){return!_.length||_.some((y)=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||g&&typeof h>"u")}e.validSchemaType=d;function f({schema:h,opts:_,self:g,errSchemaPath:y},m,S){if(Array.isArray(m.keyword)?!m.keyword.includes(S):m.keyword!==S)throw Error("ajv implementation error");let v=m.dependencies;if(v===null||v===void 0?void 0:v.some((w)=>!Object.prototype.hasOwnProperty.call(h,w)))throw Error(`parent schema must have dependencies of ${S}: ${v.join(",")}`);if(m.validateSchema){if(!m.validateSchema(h[S])){let w=`keyword "${S}" value is invalid at path "${y}": `+g.errorsText(m.validateSchema.errors);if(_.validateSchema==="log")g.logger.error(w);else throw Error(w)}}}e.validateKeywordUsage=f}),vN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=Se(),r=ke();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:f}){if(a!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let h=i.schema[a];return c===void 0?{schema:h,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:h[c],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||f===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:f,errSchemaPath:d}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:f}){if(l!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=a;if(c!==void 0){let{errorPath:g,dataPathArr:y,opts:m}=a;_(h.let("data",t._`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=t.str`${g}${(0,r.getErrorPath)(c,u,m.jsPropertySyntax)}`,i.parentDataProperty=t._`${c}`,i.dataPathArr=[...y,i.parentDataProperty]}if(l!==void 0){if(_(l instanceof t.Name?l:h.let("data",l,!0)),f!==void 0)i.propertyName=f}if(d)i.dataTypes=d;function _(g){i.data=g,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,g]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(d!==void 0)i.allErrors=d;i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),R0=H((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,a;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),SN=H((e,t)=>{var r=t.exports=function(s,i,a){if(typeof i=="function")a=i,i={};a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.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 o(s,i,a,c,u,l,d,f,h,_){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,f,h,_);for(var g in c){var y=c[g];if(Array.isArray(y)){if(g in r.arrayKeywords)for(var m=0;m<y.length;m++)o(s,i,a,y[m],u+"/"+g+"/"+m,l,u,g,c,m)}else if(g in r.propsKeywords){if(y&&typeof y=="object")for(var S in y)o(s,i,a,y[S],u+"/"+g+"/"+n(S),l,u,g,c,S)}else if(g in r.keywords||s.allKeys&&!(g in r.skipKeywords))o(s,i,a,y,u+"/"+g,l,u,g,c)}a(c,u,l,d,f,h,_)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),kl=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=ke(),r=R0(),o=SN(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,m=!0){if(typeof y=="boolean")return!0;if(m===!0)return!a(y);if(!m)return!1;return c(y)<=m}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(let m in y){if(i.has(m))return!0;let S=y[m];if(Array.isArray(S)&&S.some(a))return!0;if(typeof S=="object"&&a(S))return!0}return!1}function c(y){let m=0;for(let S in y){if(S==="$ref")return 1/0;if(m++,n.has(S))continue;if(typeof y[S]=="object")(0,t.eachItem)(y[S],(v)=>m+=c(v));if(m===1/0)return 1/0}return m}function u(y,m="",S){if(S!==!1)m=f(m);return l(y,y.parse(m))}e.getFullPath=u;function l(y,m){return y.serialize(m).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function f(y){return y?y.replace(d,""):""}e.normalizeId=f;function h(y,m,S){return S=f(S),y.resolve(m,S)}e.resolveUrl=h;let _=/^[a-z_][-a-z0-9._]*$/i;function g(y,m){if(typeof y=="boolean")return{};let{schemaId:S,uriResolver:v}=this.opts,w=f(y[S]||m),P={"":w},R=u(v,w,!1),b={},E=new Set;return o(y,{allKeys:!0},(N,F,Y,X)=>{if(X===void 0)return;let ze=R+F,He=P[X];if(typeof N[S]=="string")He=De.call(this,N[S]);at.call(this,N.$anchor),at.call(this,N.$dynamicAnchor),P[F]=He;function De(Ie){let O=this.opts.uriResolver.resolve;if(Ie=f(He?O(He,Ie):Ie),E.has(Ie))throw D(Ie);E.add(Ie);let q=this.refs[Ie];if(typeof q=="string")q=this.refs[q];if(typeof q=="object")C(N,q.schema,Ie);else if(Ie!==f(ze))if(Ie[0]==="#")C(N,b[Ie],Ie),b[Ie]=N;else this.refs[Ie]=ze;return Ie}function at(Ie){if(typeof Ie=="string"){if(!_.test(Ie))throw Error(`invalid anchor "${Ie}"`);De.call(this,`#${Ie}`)}}}),b;function C(N,F,Y){if(F!==void 0&&!r(N,F))throw D(Y)}function D(N){return Error(`reference "${N}" resolves to more than one schema`)}}e.getSchemaRefs=g}),ns=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=gN(),r=Tl(),o=w0(),n=Tl(),s=_N(),i=yN(),a=vN(),c=Se(),u=dr(),l=kl(),d=ke(),f=Il();function h(I){if(R(I)){if(E(I),P(I)){m(I);return}}_(I,()=>(0,t.topBoolOrEmptySchema)(I))}e.validateFunctionCode=h;function _({gen:I,validateName:M,schema:Z,schemaEnv:pe,opts:me},$e){if(me.code.es5)I.func(M,c._`${u.default.data}, ${u.default.valCxt}`,pe.$async,()=>{I.code(c._`"use strict"; ${v(Z,me)}`),y(I,me),I.code($e)});else I.func(M,c._`${u.default.data}, ${g(me)}`,pe.$async,()=>I.code(v(Z,me)).code($e))}function g(I){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${I.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function y(I,M){I.if(u.default.valCxt,()=>{if(I.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),I.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),I.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),I.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),M.dynamicRef)I.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(I.var(u.default.instancePath,c._`""`),I.var(u.default.parentData,c._`undefined`),I.var(u.default.parentDataProperty,c._`undefined`),I.var(u.default.rootData,u.default.data),M.dynamicRef)I.var(u.default.dynamicAnchors,c._`{}`)})}function m(I){let{schema:M,opts:Z,gen:pe}=I;_(I,()=>{if(Z.$comment&&M.$comment)X(I);if(N(I),pe.let(u.default.vErrors,null),pe.let(u.default.errors,0),Z.unevaluated)S(I);C(I),ze(I)})}function S(I){let{gen:M,validateName:Z}=I;I.evaluated=M.const("evaluated",c._`${Z}.evaluated`),M.if(c._`${I.evaluated}.dynamicProps`,()=>M.assign(c._`${I.evaluated}.props`,c._`undefined`)),M.if(c._`${I.evaluated}.dynamicItems`,()=>M.assign(c._`${I.evaluated}.items`,c._`undefined`))}function v(I,M){let Z=typeof I=="object"&&I[M.schemaId];return Z&&(M.code.source||M.code.process)?c._`/*# sourceURL=${Z} */`:c.nil}function w(I,M){if(R(I)){if(E(I),P(I)){b(I,M);return}}(0,t.boolOrEmptySchema)(I,M)}function P({schema:I,self:M}){if(typeof I=="boolean")return!I;for(let Z in I)if(M.RULES.all[Z])return!0;return!1}function R(I){return typeof I.schema!="boolean"}function b(I,M){let{schema:Z,gen:pe,opts:me}=I;if(me.$comment&&Z.$comment)X(I);F(I),Y(I);let $e=pe.const("_errs",u.default.errors);C(I,$e),pe.var(M,c._`${$e} === ${u.default.errors}`)}function E(I){(0,d.checkUnknownRules)(I),D(I)}function C(I,M){if(I.opts.jtd)return De(I,[],!1,M);let Z=(0,r.getSchemaTypes)(I.schema);De(I,Z,!(0,r.coerceAndCheckDataType)(I,Z),M)}function D(I){let{schema:M,errSchemaPath:Z,opts:pe,self:me}=I;if(M.$ref&&pe.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(M,me.RULES))me.logger.warn(`$ref: keywords ignored in schema at path "${Z}"`)}function N(I){let{schema:M,opts:Z}=I;if(M.default!==void 0&&Z.useDefaults&&Z.strictSchema)(0,d.checkStrictMode)(I,"default is ignored in the schema root")}function F(I){let M=I.schema[I.opts.schemaId];if(M)I.baseId=(0,l.resolveUrl)(I.opts.uriResolver,I.baseId,M)}function Y(I){if(I.schema.$async&&!I.schemaEnv.$async)throw Error("async schema in sync schema")}function X({gen:I,schemaEnv:M,schema:Z,errSchemaPath:pe,opts:me}){let $e=Z.$comment;if(me.$comment===!0)I.code(c._`${u.default.self}.logger.log(${$e})`);else if(typeof me.$comment=="function"){let st=c.str`${pe}/$comment`,dt=I.scopeValue("root",{ref:M.root});I.code(c._`${u.default.self}.opts.$comment(${$e}, ${st}, ${dt}.schema)`)}}function ze(I){let{gen:M,schemaEnv:Z,validateName:pe,ValidationError:me,opts:$e}=I;if(Z.$async)M.if(c._`${u.default.errors} === 0`,()=>M.return(u.default.data),()=>M.throw(c._`new ${me}(${u.default.vErrors})`));else{if(M.assign(c._`${pe}.errors`,u.default.vErrors),$e.unevaluated)He(I);M.return(c._`${u.default.errors} === 0`)}}function He({gen:I,evaluated:M,props:Z,items:pe}){if(Z instanceof c.Name)I.assign(c._`${M}.props`,Z);if(pe instanceof c.Name)I.assign(c._`${M}.items`,pe)}function De(I,M,Z,pe){let{gen:me,schema:$e,data:st,allErrors:dt,opts:wt,self:ct}=I,{RULES:Je}=ct;if($e.$ref&&(wt.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)($e,Je))){me.block(()=>Re(I,"$ref",Je.all.$ref.definition));return}if(!wt.jtd)Ie(I,M);me.block(()=>{for(let mt of Je.rules)Yt(mt);Yt(Je.post)});function Yt(mt){if(!(0,o.shouldUseGroup)($e,mt))return;if(mt.type){if(me.if((0,n.checkDataType)(mt.type,st,wt.strictNumbers)),at(I,mt),M.length===1&&M[0]===mt.type&&Z)me.else(),(0,n.reportTypeError)(I);me.endIf()}else at(I,mt);if(!dt)me.if(c._`${u.default.errors} === ${pe||0}`)}}function at(I,M){let{gen:Z,schema:pe,opts:{useDefaults:me}}=I;if(me)(0,s.assignDefaults)(I,M.type);Z.block(()=>{for(let $e of M.rules)if((0,o.shouldUseRule)(pe,$e))Re(I,$e.keyword,$e.definition,M.type)})}function Ie(I,M){if(I.schemaEnv.meta||!I.opts.strictTypes)return;if(O(I,M),!I.opts.allowUnionTypes)q(I,M);K(I,I.dataTypes)}function O(I,M){if(!M.length)return;if(!I.dataTypes.length){I.dataTypes=M;return}M.forEach((Z)=>{if(!k(I.dataTypes,Z))J(I,`type "${Z}" not allowed by context "${I.dataTypes.join(",")}"`)}),j(I,M)}function q(I,M){if(M.length>1&&!(M.length===2&&M.includes("null")))J(I,"use allowUnionTypes to allow union type keyword")}function K(I,M){let Z=I.self.RULES.all;for(let pe in Z){let me=Z[pe];if(typeof me=="object"&&(0,o.shouldUseRule)(I.schema,me)){let{type:$e}=me.definition;if($e.length&&!$e.some((st)=>z(M,st)))J(I,`missing type "${$e.join(",")}" for keyword "${pe}"`)}}}function z(I,M){return I.includes(M)||M==="number"&&I.includes("integer")}function k(I,M){return I.includes(M)||M==="integer"&&I.includes("number")}function j(I,M){let Z=[];for(let pe of I.dataTypes)if(k(M,pe))Z.push(pe);else if(M.includes("integer")&&pe==="number")Z.push("integer");I.dataTypes=Z}function J(I,M){let Z=I.schemaEnv.baseId+I.errSchemaPath;M+=` at "${Z}" (strictTypes)`,(0,d.checkStrictMode)(I,M,I.opts.strictTypes)}var ue=class{constructor(I,M,Z){if((0,i.validateKeywordUsage)(I,M,Z),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=Z,this.data=I.data,this.schema=I.schema[Z],this.$data=M.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(I,this.schema,Z,this.$data),this.schemaType=M.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=M,this.$data)this.schemaCode=I.gen.const("vSchema",Ot(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,M.schemaType,M.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(M.schemaType)}`);if("code"in M?M.trackErrors:M.errors!==!1)this.errsCount=I.gen.const("_errs",u.default.errors)}result(I,M,Z){this.failResult((0,c.not)(I),M,Z)}failResult(I,M,Z){if(this.gen.if(I),Z)Z();else this.error();if(M){if(this.gen.else(),M(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(I,M){this.failResult((0,c.not)(I),void 0,M)}fail(I){if(I===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(I),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);let{schemaCode:M}=this;this.fail(c._`${M} !== undefined && (${(0,c.or)(this.invalid$data(),I)})`)}error(I,M,Z){if(M){this.setParams(M),this._error(I,Z),this.setParams({});return}this._error(I,Z)}_error(I,M){(I?f.reportExtraError:f.reportError)(this,this.def.error,M)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(I){if(!this.allErrors)this.gen.if(I)}setParams(I,M){if(M)Object.assign(this.params,I);else this.params=I}block$data(I,M,Z=c.nil){this.gen.block(()=>{this.check$data(I,Z),M()})}check$data(I=c.nil,M=c.nil){if(!this.$data)return;let{gen:Z,schemaCode:pe,schemaType:me,def:$e}=this;if(Z.if((0,c.or)(c._`${pe} === undefined`,M)),I!==c.nil)Z.assign(I,!0);if(me.length||$e.validateSchema){if(Z.elseIf(this.invalid$data()),this.$dataError(),I!==c.nil)Z.assign(I,!1)}Z.else()}invalid$data(){let{gen:I,schemaCode:M,schemaType:Z,def:pe,it:me}=this;return(0,c.or)($e(),st());function $e(){if(Z.length){if(!(M instanceof c.Name))throw Error("ajv implementation error");let dt=Array.isArray(Z)?Z:[Z];return c._`${(0,n.checkDataTypes)(dt,M,me.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function st(){if(pe.validateSchema){let dt=I.scopeValue("validate$data",{ref:pe.validateSchema});return c._`!${dt}(${M})`}return c.nil}}subschema(I,M){let Z=(0,a.getSubschema)(this.it,I);(0,a.extendSubschemaData)(Z,this.it,I),(0,a.extendSubschemaMode)(Z,I);let pe={...this.it,...Z,items:void 0,props:void 0};return w(pe,M),pe}mergeEvaluated(I,M){let{it:Z,gen:pe}=this;if(!Z.opts.unevaluated)return;if(Z.props!==!0&&I.props!==void 0)Z.props=d.mergeEvaluated.props(pe,I.props,Z.props,M);if(Z.items!==!0&&I.items!==void 0)Z.items=d.mergeEvaluated.items(pe,I.items,Z.items,M)}mergeValidEvaluated(I,M){let{it:Z,gen:pe}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return pe.if(M,()=>this.mergeEvaluated(I,c.Name)),!0}};e.KeywordCxt=ue;function Re(I,M,Z,pe){let me=new ue(I,Z,M);if("code"in Z)Z.code(me,pe);else if(me.$data&&Z.validate)(0,i.funcKeywordCode)(me,Z);else if("macro"in Z)(0,i.macroKeywordCode)(me,Z);else if(Z.compile||Z.validate)(0,i.funcKeywordCode)(me,Z)}let ge=/^\/(?:[^~]|~0|~1)*$/,Ue=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Ot(I,{dataLevel:M,dataNames:Z,dataPathArr:pe}){let me,$e;if(I==="")return u.default.rootData;if(I[0]==="/"){if(!ge.test(I))throw Error(`Invalid JSON-pointer: ${I}`);me=I,$e=u.default.rootData}else{let ct=Ue.exec(I);if(!ct)throw Error(`Invalid JSON-pointer: ${I}`);let Je=+ct[1];if(me=ct[2],me==="#"){if(Je>=M)throw Error(wt("property/index",Je));return pe[M-Je]}if(Je>M)throw Error(wt("data",Je));if($e=Z[M-Je],!me)return $e}let st=$e,dt=me.split("/");for(let ct of dt)if(ct)$e=c._`${$e}${(0,c.getProperty)((0,d.unescapeJsonPointer)(ct))}`,st=c._`${st} && ${$e}`;return st;function wt(ct,Je){return`Cannot access ${ct} ${Je} levels up, current level is ${M}`}}e.getData=Ot}),oa=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed");this.errors=r,this.ajv=this.validation=!0}};e.default=t}),ss=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=kl();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`);this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),Ol=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=Se(),r=oa(),o=dr(),n=kl(),s=ke(),i=ns();var a=class{constructor(m){var S;this.refs={},this.dynamicAnchors={};let v;if(typeof m.schema=="object")v=m.schema;this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(S=m.baseId)!==null&&S!==void 0?S:(0,n.normalizeId)(v===null||v===void 0?void 0:v[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=v===null||v===void 0?void 0:v.$async,this.refs={}}};e.SchemaEnv=a;function c(m){let S=d.call(this,m);if(S)return S;let v=(0,n.getFullPath)(this.opts.uriResolver,m.root.baseId),{es5:w,lines:P}=this.opts.code,{ownProperties:R}=this.opts,b=new t.CodeGen(this.scope,{es5:w,lines:P,ownProperties:R}),E;if(m.$async)E=b.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let C=b.scopeName("validate");m.validateName=C;let D={gen:b,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===!0?{ref:m.schema,code:(0,t.stringify)(m.schema)}:{ref:m.schema}),validateName:C,ValidationError:E,schema:m.schema,schemaEnv:m,rootId:v,baseId:m.baseId||v,schemaPath:t.nil,errSchemaPath:m.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},N;try{this._compilations.add(m),(0,i.validateFunctionCode)(D),b.optimize(this.opts.code.optimize);let F=b.toString();if(N=`${b.scopeRefs(o.default.scope)}return ${F}`,this.opts.code.process)N=this.opts.code.process(N,m);let Y=Function(`${o.default.self}`,`${o.default.scope}`,N)(this,this.scope.get());if(this.scope.value(C,{ref:Y}),Y.errors=null,Y.schema=m.schema,Y.schemaEnv=m,m.$async)Y.$async=!0;if(this.opts.code.source===!0)Y.source={validateName:C,validateCode:F,scopeValues:b._values};if(this.opts.unevaluated){let{props:X,items:ze}=D;if(Y.evaluated={props:X instanceof t.Name?void 0:X,items:ze instanceof t.Name?void 0:ze,dynamicProps:X instanceof t.Name,dynamicItems:ze instanceof t.Name},Y.source)Y.source.evaluated=(0,t.stringify)(Y.evaluated)}return m.validate=Y,m}catch(F){if(delete m.validate,delete m.validateName,N)this.logger.error("Error compiling schema, function code:",N);throw F}finally{this._compilations.delete(m)}}e.compileSchema=c;function u(m,S,v){var w;v=(0,n.resolveUrl)(this.opts.uriResolver,S,v);let P=m.refs[v];if(P)return P;let R=h.call(this,m,v);if(R===void 0){let b=(w=m.localRefs)===null||w===void 0?void 0:w[v],{schemaId:E}=this.opts;if(b)R=new a({schema:b,schemaId:E,root:m,baseId:S})}if(R===void 0)return;return m.refs[v]=l.call(this,R)}e.resolveRef=u;function l(m){if((0,n.inlineRef)(m.schema,this.opts.inlineRefs))return m.schema;return m.validate?m:c.call(this,m)}function d(m){for(let S of this._compilations)if(f(S,m))return S}e.getCompilingSchema=d;function f(m,S){return m.schema===S.schema&&m.root===S.root&&m.baseId===S.baseId}function h(m,S){let v;while(typeof(v=this.refs[S])=="string")S=v;return v||this.schemas[S]||_.call(this,m,S)}function _(m,S){let v=this.opts.uriResolver.parse(S),w=(0,n._getFullPath)(this.opts.uriResolver,v),P=(0,n.getFullPath)(this.opts.uriResolver,m.baseId,void 0);if(Object.keys(m.schema).length>0&&w===P)return y.call(this,v,m);let R=(0,n.normalizeId)(w),b=this.refs[R]||this.schemas[R];if(typeof b=="string"){let E=_.call(this,m,b);if(typeof(E===null||E===void 0?void 0:E.schema)!=="object")return;return y.call(this,v,E)}if(typeof(b===null||b===void 0?void 0:b.schema)!=="object")return;if(!b.validate)c.call(this,b);if(R===(0,n.normalizeId)(S)){let{schema:E}=b,{schemaId:C}=this.opts,D=E[C];if(D)P=(0,n.resolveUrl)(this.opts.uriResolver,P,D);return new a({schema:E,schemaId:C,root:m,baseId:P})}return y.call(this,v,b)}e.resolveSchema=_;let g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(m,{baseId:S,schema:v,root:w}){var P;if(((P=m.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let E of m.fragment.slice(1).split("/")){if(typeof v==="boolean")return;let C=v[(0,s.unescapeFragment)(E)];if(C===void 0)return;v=C;let D=typeof v==="object"&&v[this.opts.schemaId];if(!g.has(E)&&D)S=(0,n.resolveUrl)(this.opts.uriResolver,S,D)}let R;if(typeof v!="boolean"&&v.$ref&&!(0,s.schemaHasRulesButRef)(v,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,S,v.$ref);R=_.call(this,w,E)}let{schemaId:b}=this.opts;if(R=R||new a({schema:v,schemaId:b,root:w,baseId:S}),R.schema!==R.root.schema)return R}}),bN=H((e,t)=>{t.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}}),E0=H((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=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 n(_){let g="",y=0,m=0;for(m=0;m<_.length;m++){if(y=_[m].charCodeAt(0),y===48)continue;if(!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";g+=_[m];break}for(m+=1;m<_.length;m++){if(y=_[m].charCodeAt(0),!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";g+=_[m]}return g}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(_){return _.length=0,!0}function a(_,g,y){if(_.length){let m=n(_);if(m!=="")g.push(m);else return y.error=!0,!1;_.length=0}return!0}function c(_){let g=0,y={error:!1,address:"",zone:""},m=[],S=[],v=!1,w=!1,P=a;for(let R=0;R<_.length;R++){let b=_[R];if(b==="["||b==="]")continue;if(b===":"){if(v===!0)w=!0;if(!P(S,m,y))break;if(++g>7){y.error=!0;break}if(R>0&&_[R-1]===":")v=!0;m.push(":");continue}else if(b==="%"){if(!P(S,m,y))break;P=i}else{S.push(b);continue}}if(S.length)if(P===i)y.zone=S.join("");else if(w)m.push(S.join(""));else m.push(n(S));return y.address=m.join(""),y}function u(_){if(l(_,":")<2)return{host:_,isIPV6:!1};let g=c(_);if(!g.error){let{address:y,address:m}=g;if(g.zone)y+="%"+g.zone,m+="%25"+g.zone;return{host:y,isIPV6:!0,escapedHost:m}}else return{host:_,isIPV6:!1}}function l(_,g){let y=0;for(let m=0;m<_.length;m++)if(_[m]===g)y++;return y}function d(_){let g=_,y=[],m=-1,S=0;while(S=g.length){if(S===1)if(g===".")break;else if(g==="/"){y.push("/");break}else{y.push(g);break}else if(S===2){if(g[0]==="."){if(g[1]===".")break;else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"){if(g[1]==="."||g[1]==="/"){y.push("/");break}}}else if(S===3){if(g==="/.."){if(y.length!==0)y.pop();y.push("/");break}}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"){if(g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."){if(g[3]==="/"){if(g=g.slice(3),y.length!==0)y.pop();continue}}}}if((m=g.indexOf("/",1))===-1){y.push(g);break}else y.push(g.slice(0,m)),g=g.slice(m)}return y.join("")}function f(_,g){let y=g!==!0?escape:unescape;if(_.scheme!==void 0)_.scheme=y(_.scheme);if(_.userinfo!==void 0)_.userinfo=y(_.userinfo);if(_.host!==void 0)_.host=y(_.host);if(_.path!==void 0)_.path=y(_.path);if(_.query!==void 0)_.query=y(_.query);if(_.fragment!==void 0)_.fragment=y(_.fragment);return _}function h(_){let g=[];if(_.userinfo!==void 0)g.push(_.userinfo),g.push("@");if(_.host!==void 0){let y=unescape(_.host);if(!o(y)){let m=u(y);if(m.isIPV6===!0)y=`[${m.escapedHost}]`;else y=_.host}g.push(y)}if(typeof _.port==="number"||typeof _.port==="string")g.push(":"),g.push(String(_.port));return g.length?g.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:h,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}}),$N=H((e,t)=>{let{isUUID:r}=E0(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(b){return n.indexOf(b)!==-1}function i(b){if(b.secure===!0)return!0;else if(b.secure===!1)return!1;else if(b.scheme)return b.scheme.length===3&&(b.scheme[0]==="w"||b.scheme[0]==="W")&&(b.scheme[1]==="s"||b.scheme[1]==="S")&&(b.scheme[2]==="s"||b.scheme[2]==="S");else return!1}function a(b){if(!b.host)b.error=b.error||"HTTP URIs must have a host.";return b}function c(b){let E=String(b.scheme).toLowerCase()==="https";if(b.port===(E?443:80)||b.port==="")b.port=void 0;if(!b.path)b.path="/";return b}function u(b){return b.secure=i(b),b.resourceName=(b.path||"/")+(b.query?"?"+b.query:""),b.path=void 0,b.query=void 0,b}function l(b){if(b.port===(i(b)?443:80)||b.port==="")b.port=void 0;if(typeof b.secure==="boolean")b.scheme=b.secure?"wss":"ws",b.secure=void 0;if(b.resourceName){let[E,C]=b.resourceName.split("?");b.path=E&&E!=="/"?E:void 0,b.query=C,b.resourceName=void 0}return b.fragment=void 0,b}function d(b,E){if(!b.path)return b.error="URN can not be parsed",b;let C=b.path.match(o);if(C){let D=E.scheme||b.scheme||"urn";b.nid=C[1].toLowerCase(),b.nss=C[2];let N=R(`${D}:${E.nid||b.nid}`);if(b.path=void 0,N)b=N.parse(b,E)}else b.error=b.error||"URN can not be parsed.";return b}function f(b,E){if(b.nid===void 0)throw Error("URN without nid cannot be serialized");let C=E.scheme||b.scheme||"urn",D=b.nid.toLowerCase(),N=R(`${C}:${E.nid||D}`);if(N)b=N.serialize(b,E);let F=b,Y=b.nss;return F.path=`${D||E.nid}:${Y}`,E.skipEscape=!0,F}function h(b,E){let C=b;if(C.uuid=C.nss,C.nss=void 0,!E.tolerant&&(!C.uuid||!r(C.uuid)))C.error=C.error||"UUID is not valid.";return C}function _(b){let E=b;return E.nss=(b.uuid||"").toLowerCase(),E}let g={scheme:"http",domainHost:!0,parse:a,serialize:c},y={scheme:"https",domainHost:g.domainHost,parse:a,serialize:c},m={scheme:"ws",domainHost:!0,parse:u,serialize:l},S={scheme:"wss",domainHost:m.domainHost,parse:m.parse,serialize:m.serialize},P={http:g,https:y,ws:m,wss:S,urn:{scheme:"urn",parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(P,null);function R(b){return b&&(P[b]||P[b.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:P,isValidSchemeName:s,getSchemeHandler:R}}),wN=H((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:a}=E0(),{SCHEMES:c,getSchemeHandler:u}=$N();function l(S,v){if(typeof S==="string")S=_(y(S,v),v);else if(typeof S==="object")S=y(_(S,v),v);return S}function d(S,v,w){let P=w?Object.assign({scheme:"null"},w):{scheme:"null"},R=f(y(S,P),y(v,P),P,!0);return P.skipEscape=!0,_(R,P)}function f(S,v,w,P){let R={};if(!P)S=y(_(S,w),w),v=y(_(v,w),w);if(w=w||{},!w.tolerant&&v.scheme)R.scheme=v.scheme,R.userinfo=v.userinfo,R.host=v.host,R.port=v.port,R.path=o(v.path||""),R.query=v.query;else{if(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)R.userinfo=v.userinfo,R.host=v.host,R.port=v.port,R.path=o(v.path||""),R.query=v.query;else{if(!v.path)if(R.path=S.path,v.query!==void 0)R.query=v.query;else R.query=S.query;else{if(v.path[0]==="/")R.path=o(v.path);else{if((S.userinfo!==void 0||S.host!==void 0||S.port!==void 0)&&!S.path)R.path="/"+v.path;else if(!S.path)R.path=v.path;else R.path=S.path.slice(0,S.path.lastIndexOf("/")+1)+v.path;R.path=o(R.path)}R.query=v.query}R.userinfo=S.userinfo,R.host=S.host,R.port=S.port}R.scheme=S.scheme}return R.fragment=v.fragment,R}function h(S,v,w){if(typeof S==="string")S=unescape(S),S=_(s(y(S,w),!0),{...w,skipEscape:!0});else if(typeof S==="object")S=_(s(S,!0),{...w,skipEscape:!0});if(typeof v==="string")v=unescape(v),v=_(s(y(v,w),!0),{...w,skipEscape:!0});else if(typeof v==="object")v=_(s(v,!0),{...w,skipEscape:!0});return S.toLowerCase()===v.toLowerCase()}function _(S,v){let w={host:S.host,scheme:S.scheme,userinfo:S.userinfo,port:S.port,path:S.path,query:S.query,nid:S.nid,nss:S.nss,uuid:S.uuid,fragment:S.fragment,reference:S.reference,resourceName:S.resourceName,secure:S.secure,error:""},P=Object.assign({},v),R=[],b=u(P.scheme||w.scheme);if(b&&b.serialize)b.serialize(w,P);if(w.path!==void 0)if(!P.skipEscape){if(w.path=escape(w.path),w.scheme!==void 0)w.path=w.path.split("%3A").join(":")}else w.path=unescape(w.path);if(P.reference!=="suffix"&&w.scheme)R.push(w.scheme,":");let E=n(w);if(E!==void 0){if(P.reference!=="suffix")R.push("//");if(R.push(E),w.path&&w.path[0]!=="/")R.push("/")}if(w.path!==void 0){let C=w.path;if(!P.absolutePath&&(!b||!b.absolutePath))C=o(C);if(E===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);R.push(C)}if(w.query!==void 0)R.push("?",w.query);if(w.fragment!==void 0)R.push("#",w.fragment);return R.join("")}let g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y(S,v){let w=Object.assign({},v),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},R=!1;if(w.reference==="suffix")if(w.scheme)S=w.scheme+":"+S;else S="//"+S;let b=S.match(g);if(b){if(P.scheme=b[1],P.userinfo=b[3],P.host=b[4],P.port=parseInt(b[5],10),P.path=b[6]||"",P.query=b[7],P.fragment=b[8],isNaN(P.port))P.port=b[5];if(P.host)if(i(P.host)===!1){let C=r(P.host);P.host=C.host.toLowerCase(),R=C.isIPV6}else R=!0;if(P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path)P.reference="same-document";else if(P.scheme===void 0)P.reference="relative";else if(P.fragment===void 0)P.reference="absolute";else P.reference="uri";if(w.reference&&w.reference!=="suffix"&&w.reference!==P.reference)P.error=P.error||"URI is not a "+w.reference+" reference.";let E=u(w.scheme||P.scheme);if(!w.unicodeSupport&&(!E||!E.unicodeSupport)){if(P.host&&(w.domainHost||E&&E.domainHost)&&R===!1&&a(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(C){P.error=P.error||"Host's domain name can not be converted to ASCII: "+C}}if(!E||E&&!E.skipNormalize){if(S.indexOf("%")!==-1){if(P.scheme!==void 0)P.scheme=unescape(P.scheme);if(P.host!==void 0)P.host=unescape(P.host)}if(P.path)P.path=escape(unescape(P.path));if(P.fragment)P.fragment=encodeURI(decodeURIComponent(P.fragment))}if(E&&E.parse)E.parse(P,w)}else P.error=P.error||"URI can not be parsed.";return P}let m={SCHEMES:c,normalize:l,resolve:d,resolveComponent:f,equal:h,serialize:_,parse:y};t.exports=m,t.exports.default=m,t.exports.fastUri=m}),RN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wN();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),Sm=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ns();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=Se();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=oa(),n=ss(),s=$0(),i=Ol(),a=Se(),c=kl(),u=Tl(),l=ke(),d=bN(),f=RN(),h=(O,q)=>new RegExp(O,q);h.code="new RegExp";let _=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S=200;function v(O){var q,K,z,k,j,J,ue,Re,ge,Ue,Ot,I,M,Z,pe,me,$e,st,dt,wt,ct,Je,Yt,mt,qr;let cr=O.strict,Mr=(q=O.code)===null||q===void 0?void 0:q.optimize,Br=Mr===!0||Mr===void 0?1:Mr||0,Wr=(z=(K=O.code)===null||K===void 0?void 0:K.regExp)!==null&&z!==void 0?z:h,Uo=(k=O.uriResolver)!==null&&k!==void 0?k:f.default;return{strictSchema:(J=(j=O.strictSchema)!==null&&j!==void 0?j:cr)!==null&&J!==void 0?J:!0,strictNumbers:(Re=(ue=O.strictNumbers)!==null&&ue!==void 0?ue:cr)!==null&&Re!==void 0?Re:!0,strictTypes:(Ue=(ge=O.strictTypes)!==null&&ge!==void 0?ge:cr)!==null&&Ue!==void 0?Ue:"log",strictTuples:(I=(Ot=O.strictTuples)!==null&&Ot!==void 0?Ot:cr)!==null&&I!==void 0?I:"log",strictRequired:(Z=(M=O.strictRequired)!==null&&M!==void 0?M:cr)!==null&&Z!==void 0?Z:!1,code:O.code?{...O.code,optimize:Br,regExp:Wr}:{optimize:Br,regExp:Wr},loopRequired:(pe=O.loopRequired)!==null&&pe!==void 0?pe:S,loopEnum:(me=O.loopEnum)!==null&&me!==void 0?me:S,meta:($e=O.meta)!==null&&$e!==void 0?$e:!0,messages:(st=O.messages)!==null&&st!==void 0?st:!0,inlineRefs:(dt=O.inlineRefs)!==null&&dt!==void 0?dt:!0,schemaId:(wt=O.schemaId)!==null&&wt!==void 0?wt:"$id",addUsedSchema:(ct=O.addUsedSchema)!==null&&ct!==void 0?ct:!0,validateSchema:(Je=O.validateSchema)!==null&&Je!==void 0?Je:!0,validateFormats:(Yt=O.validateFormats)!==null&&Yt!==void 0?Yt:!0,unicodeRegExp:(mt=O.unicodeRegExp)!==null&&mt!==void 0?mt:!0,int32range:(qr=O.int32range)!==null&&qr!==void 0?qr:!0,uriResolver:Uo}}var w=class{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...v(O)};let{es5:q,lines:K}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:g,es5:q,lines:K}),this.logger=F(O.logger);let z=O.validateFormats;if(O.validateFormats=!1,this.RULES=(0,s.getRules)(),P.call(this,y,O,"NOT SUPPORTED"),P.call(this,m,O,"DEPRECATED","warn"),this._metaOpts=D.call(this),O.formats)E.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords)C.call(this,O.keywords);if(typeof O.meta=="object")this.addMetaSchema(O.meta);b.call(this),O.validateFormats=z}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:O,meta:q,schemaId:K}=this.opts,z=d;if(K==="id")z={...d},z.id=z.$id,delete z.$id;if(q&&O)this.addMetaSchema(z,z[K],!1)}defaultMeta(){let{meta:O,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[q]||O:void 0}validate(O,q){let K;if(typeof O=="string"){if(K=this.getSchema(O),!K)throw Error(`no schema with key or ref "${O}"`)}else K=this.compile(O);let z=K(q);if(!("$async"in K))this.errors=K.errors;return z}compile(O,q){let K=this._addSchema(O,q);return K.validate||this._compileSchemaEnv(K)}compileAsync(O,q){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:K}=this.opts;return z.call(this,O,q);async function z(ge,Ue){await k.call(this,ge.$schema);let Ot=this._addSchema(ge,Ue);return Ot.validate||j.call(this,Ot)}async function k(ge){if(ge&&!this.getSchema(ge))await z.call(this,{$ref:ge},!0)}async function j(ge){try{return this._compileSchemaEnv(ge)}catch(Ue){if(!(Ue instanceof n.default))throw Ue;return J.call(this,Ue),await ue.call(this,Ue.missingSchema),j.call(this,ge)}}function J({missingSchema:ge,missingRef:Ue}){if(this.refs[ge])throw Error(`AnySchema ${ge} is loaded but ${Ue} cannot be resolved`)}async function ue(ge){let Ue=await Re.call(this,ge);if(!this.refs[ge])await k.call(this,Ue.$schema);if(!this.refs[ge])this.addSchema(Ue,ge,q)}async function Re(ge){let Ue=this._loading[ge];if(Ue)return Ue;try{return await(this._loading[ge]=K(ge))}finally{delete this._loading[ge]}}}addSchema(O,q,K,z=this.opts.validateSchema){if(Array.isArray(O)){for(let j of O)this.addSchema(j,void 0,K,z);return this}let k;if(typeof O==="object"){let{schemaId:j}=this.opts;if(k=O[j],k!==void 0&&typeof k!="string")throw Error(`schema ${j} must be string`)}return q=(0,c.normalizeId)(q||k),this._checkUnique(q),this.schemas[q]=this._addSchema(O,K,q,z,!0),this}addMetaSchema(O,q,K=this.opts.validateSchema){return this.addSchema(O,q,!0,K),this}validateSchema(O,q){if(typeof O=="boolean")return!0;let K;if(K=O.$schema,K!==void 0&&typeof K!="string")throw Error("$schema must be a string");if(K=K||this.opts.defaultMeta||this.defaultMeta(),!K)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let z=this.validate(K,O);if(!z&&q){let k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw Error(k)}return z}getSchema(O){let q;while(typeof(q=R.call(this,O))=="string")O=q;if(q===void 0){let{schemaId:K}=this.opts,z=new i.SchemaEnv({schema:{},schemaId:K});if(q=i.resolveSchema.call(this,z,O),!q)return;this.refs[O]=q}return q.validate||this._compileSchemaEnv(q)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let q=R.call(this,O);if(typeof q=="object")this._cache.delete(q.schema);return delete this.schemas[O],delete this.refs[O],this}case"object":{let q=O;this._cache.delete(q);let K=O[this.opts.schemaId];if(K)K=(0,c.normalizeId)(K),delete this.schemas[K],delete this.refs[K];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(let q of O)this.addKeyword(q);return this}addKeyword(O,q){let K;if(typeof O=="string"){if(K=O,typeof q=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=K}else if(typeof O=="object"&&q===void 0){if(q=O,K=q.keyword,Array.isArray(K)&&!K.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(X.call(this,K,q),!q)return(0,l.eachItem)(K,(k)=>ze.call(this,k)),this;De.call(this,q);let z={...q,type:(0,u.getJSONTypes)(q.type),schemaType:(0,u.getJSONTypes)(q.schemaType)};return(0,l.eachItem)(K,z.type.length===0?(k)=>ze.call(this,k,z):(k)=>z.type.forEach((j)=>ze.call(this,k,z,j))),this}getKeyword(O){let q=this.RULES.all[O];return typeof q=="object"?q.definition:!!q}removeKeyword(O){let{RULES:q}=this;delete q.keywords[O],delete q.all[O];for(let K of q.rules){let z=K.rules.findIndex((k)=>k.keyword===O);if(z>=0)K.rules.splice(z,1)}return this}addFormat(O,q){if(typeof q=="string")q=new RegExp(q);return this.formats[O]=q,this}errorsText(O=this.errors,{separator:q=", ",dataVar:K="data"}={}){if(!O||O.length===0)return"No errors";return O.map((z)=>`${K}${z.instancePath} ${z.message}`).reduce((z,k)=>z+q+k)}$dataMetaSchema(O,q){let K=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(let z of q){let k=z.split("/").slice(1),j=O;for(let J of k)j=j[J];for(let J in K){let ue=K[J];if(typeof ue!="object")continue;let{$data:Re}=ue.definition,ge=j[J];if(Re&&ge)j[J]=Ie(ge)}}return O}_removeAllSchemas(O,q){for(let K in O){let z=O[K];if(!q||q.test(K)){if(typeof z=="string")delete O[K];else if(z&&!z.meta)this._cache.delete(z.schema),delete O[K]}}}_addSchema(O,q,K,z=this.opts.validateSchema,k=this.opts.addUsedSchema){let j,{schemaId:J}=this.opts;if(typeof O=="object")j=O[J];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof O!="boolean")throw Error("schema must be object or boolean");let ue=this._cache.get(O);if(ue!==void 0)return ue;K=(0,c.normalizeId)(j||K);let Re=c.getSchemaRefs.call(this,O,K);if(ue=new i.SchemaEnv({schema:O,schemaId:J,meta:q,baseId:K,localRefs:Re}),this._cache.set(ue.schema,ue),k&&!K.startsWith("#")){if(K)this._checkUnique(K);this.refs[K]=ue}if(z)this.validateSchema(O,!0);return ue}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta)this._compileMetaSchema(O);else i.compileSchema.call(this,O);if(!O.validate)throw Error("ajv implementation error");return O.validate}_compileMetaSchema(O){let q=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=q}}};w.ValidationError=o.default,w.MissingRefError=n.default,e.default=w;function P(O,q,K,z="error"){for(let k in O){let j=k;if(j in q)this.logger[z](`${K}: option ${k}. ${O[j]}`)}}function R(O){return O=(0,c.normalizeId)(O),this.schemas[O]||this.refs[O]}function b(){let O=this.opts.schemas;if(!O)return;if(Array.isArray(O))this.addSchema(O);else for(let q in O)this.addSchema(O[q],q)}function E(){for(let O in this.opts.formats){let q=this.opts.formats[O];if(q)this.addFormat(O,q)}}function C(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let q in O){let K=O[q];if(!K.keyword)K.keyword=q;this.addKeyword(K)}}function D(){let O={...this.opts};for(let q of _)delete O[q];return O}let N={log(){},warn(){},error(){}};function F(O){if(O===!1)return N;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function X(O,q){let{RULES:K}=this;if((0,l.eachItem)(O,(z)=>{if(K.keywords[z])throw Error(`Keyword ${z} is already defined`);if(!Y.test(z))throw Error(`Keyword ${z} has invalid name`)}),!q)return;if(q.$data&&!(("code"in q)||("validate"in q)))throw Error('$data keyword must have "code" or "validate" function')}function ze(O,q,K){var z;let k=q===null||q===void 0?void 0:q.post;if(K&&k)throw Error('keyword with "post" flag cannot have "type"');let{RULES:j}=this,J=k?j.post:j.rules.find(({type:Re})=>Re===K);if(!J)J={type:K,rules:[]},j.rules.push(J);if(j.keywords[O]=!0,!q)return;let ue={keyword:O,definition:{...q,type:(0,u.getJSONTypes)(q.type),schemaType:(0,u.getJSONTypes)(q.schemaType)}};if(q.before)He.call(this,J,ue,q.before);else J.rules.push(ue);j.all[O]=ue,(z=q.implements)===null||z===void 0||z.forEach((Re)=>this.addKeyword(Re))}function He(O,q,K){let z=O.rules.findIndex((k)=>k.keyword===K);if(z>=0)O.rules.splice(z,0,q);else O.rules.push(q),this.logger.warn(`rule ${K} is not defined`)}function De(O){let{metaSchema:q}=O;if(q===void 0)return;if(O.$data&&this.opts.$data)q=Ie(q);O.validateSchema=this.compile(q,!0)}let at={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ie(O){return{anyOf:[O,at]}}});var EN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),bm=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=ss(),r=pr(),o=Se(),n=dr(),s=Ol(),i=ke(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:f,it:h}=l,{baseId:_,schemaEnv:g,validateName:y,opts:m,self:S}=h,{root:v}=g;if((f==="#"||f==="#/")&&_===v.baseId)return P();let w=s.resolveRef.call(S,v,_,f);if(w===void 0)throw new t.default(h.opts.uriResolver,_,f);if(w instanceof s.SchemaEnv)return R(w);return b(w);function P(){if(g===v)return u(l,y,g,g.$async);let E=d.scopeValue("root",{ref:v});return u(l,o._`${E}.validate`,v,v.$async)}function R(E){u(l,c(l,E),E,E.$async)}function b(E){let C=d.scopeValue("schema",m.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),D=d.name("valid"),N=l.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:C,errSchemaPath:f},D);l.mergeEvaluated(N),l.ok(D)}}};function c(l,d){let{gen:f}=l;return d.validate?f.scopeValue("validate",{ref:d.validate}):o._`${f.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,f,h){let{gen:_,it:g}=l,{allErrors:y,schemaEnv:m,opts:S}=g,v=S.passContext?n.default.this:o.nil;if(h)w();else P();function w(){if(!m.$async)throw Error("async schema referenced by sync schema");let E=_.let("valid");_.try(()=>{if(_.code(o._`await ${(0,r.callValidateCode)(l,d,v)}`),b(d),!y)_.assign(E,!0)},(C)=>{if(_.if(o._`!(${C} instanceof ${g.ValidationError})`,()=>_.throw(C)),R(C),!y)_.assign(E,!1)}),l.ok(E)}function P(){l.result((0,r.callValidateCode)(l,d,v),()=>b(d),()=>R(d))}function R(E){let C=o._`${E}.errors`;_.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${C} : ${n.default.vErrors}.concat(${C})`),_.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function b(E){var C;if(!g.opts.unevaluated)return;let D=(C=f===null||f===void 0?void 0:f.validate)===null||C===void 0?void 0:C.evaluated;if(g.props!==!0)if(D&&!D.dynamicProps){if(D.props!==void 0)g.props=i.mergeEvaluated.props(_,D.props,g.props)}else{let N=_.var("props",o._`${E}.evaluated.props`);g.props=i.mergeEvaluated.props(_,N,g.props,o.Name)}if(g.items!==!0)if(D&&!D.dynamicItems){if(D.items!==void 0)g.items=i.mergeEvaluated.items(_,D.items,g.items)}else{let N=_.var("items",o._`${E}.evaluated.items`);g.items=i.mergeEvaluated.items(_,N,g.items,o.Name)}}}e.callRef=u,e.default=a}),z0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=EN(),r=bm(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),zN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>t.str`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>t._`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data(t._`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),PN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),TN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;while(s<o)if(n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o){if(i=r.charCodeAt(s),(i&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),IN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o=TN(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?t._`${a}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data(t._`${d} ${l} ${c}`)}};e.default=n}),kN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pr(),r=ke(),o=Se(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,f=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:h}=d.opts.code,_=h.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,h),g=i.let("valid");i.try(()=>i.assign(g,o._`${_}(${l}, ${f}).test(${a})`),()=>i.assign(g,!1)),s.fail$data(o._`!${g}`)}else{let h=(0,t.usePattern)(s,u);s.fail$data(o._`!${h}.test(${a})`)}}};e.default=n}),ON=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),CN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pr(),r=Se(),o=ke(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:f}=d;if(!l&&a.length===0)return;let h=a.length>=f.loopRequired;if(d.allErrors)_();else g();if(f.strictRequired){let S=s.parentSchema.properties,{definedProperties:v}=s.it;for(let w of a)if((S===null||S===void 0?void 0:S[w])===void 0&&!v.has(w)){let P=`required property "${w}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,P,d.opts.strictRequired)}}function _(){if(h||l)s.block$data(r.nil,y);else for(let S of a)(0,t.checkReportMissingProp)(s,S)}function g(){let S=i.let("missing");if(h||l){let v=i.let("valid",!0);s.block$data(v,()=>m(S,v)),s.ok(v)}else i.if((0,t.checkMissingProp)(s,a,S)),(0,t.reportMissingProp)(s,S),i.else()}function y(){i.forOf("prop",c,(S)=>{s.setParams({missingProperty:S}),i.if((0,t.noPropertyInData)(i,u,S,f.ownProperties),()=>s.error())})}function m(S,v){s.setParams({missingProperty:S}),i.forOf(S,c,()=>{i.assign(v,(0,t.propertyInData)(i,u,S,f.ownProperties)),i.if((0,r.not)(v),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),NN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${a} ${i}`)}};e.default=r}),$m=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=R0();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),xN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Tl(),r=Se(),o=ke(),n=$m(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>r.str`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>r._`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:f,it:h}=i;if(!u&&!l)return;let _=a.let("valid"),g=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(_,y,r._`${f} === false`),i.ok(_);function y(){let w=a.let("i",r._`${c}.length`),P=a.let("j");i.setParams({i:w,j:P}),a.assign(_,!0),a.if(r._`${w} > 1`,()=>(m()?S:v)(w,P))}function m(){return g.length>0&&!g.some((w)=>w==="object"||w==="array")}function S(w,P){let R=a.name("item"),b=(0,t.checkDataTypes)(g,R,h.opts.strictNumbers,t.DataType.Wrong),E=a.const("indices",r._`{}`);a.for(r._`;${w}--;`,()=>{if(a.let(R,r._`${c}[${w}]`),a.if(b,r._`continue`),g.length>1)a.if(r._`typeof ${R} == "string"`,r._`${R} += "_"`);a.if(r._`typeof ${E}[${R}] == "number"`,()=>{a.assign(P,r._`${E}[${R}]`),i.error(),a.assign(_,!1).break()}).code(r._`${E}[${R}] = ${w}`)})}function v(w,P){let R=(0,o.useFunc)(a,n.default),b=a.name("outer");a.label(b).for(r._`;${w}--;`,()=>a.for(r._`${P} = ${w}; ${P}--;`,()=>a.if(r._`${R}(${c}[${w}], ${c}[${P}])`,()=>{i.error(),a.assign(_,!1).break(b)})))}}};e.default=s}),AN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o=$m(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;if(c||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`);else s.fail(t._`${l} !== ${a}`)}};e.default=n}),jN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o=$m(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw Error("enum must have non-empty array");let f=u.length>=d.opts.loopEnum,h,_=()=>h!==null&&h!==void 0?h:h=(0,r.useFunc)(i,o.default),g;if(f||c)g=i.let("valid"),s.block$data(g,y);else{if(!Array.isArray(u))throw Error("ajv implementation error");let S=i.const("vSchema",l);g=(0,t.or)(...u.map((v,w)=>m(S,w)))}s.pass(g);function y(){i.assign(g,!1),i.forOf("v",l,(S)=>i.if(t._`${_()}(${a}, ${S})`,()=>i.assign(g,!0).break()))}function m(S,v){let w=u[v];return typeof w==="object"&&w!==null?t._`${_()}(${a}, ${S}[${v}])`:t._`${a} === ${w}`}}};e.default=n}),P0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zN(),r=PN(),o=IN(),n=kN(),s=ON(),i=CN(),a=NN(),c=xN(),u=AN(),l=jN(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),T0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=Se(),r=ke(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let f=a.const("len",t._`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass(t._`${f} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let _=a.var("valid",t._`${f} <= ${i.length}`);a.if((0,t.not)(_),()=>h(_)),s.ok(_)}function h(_){a.forRange("i",i.length,f,(g)=>{if(s.subschema({keyword:l,dataProp:g,dataPropType:r.Type.Num},_),!d.allErrors)a.if((0,t.not)(_),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),I0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=Se(),r=ke(),o=pr(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);if(c.items=!0,(0,r.alwaysValidSchema)(c,a))return;i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:f,it:h}=i;if(y(l),h.opts.unevaluated&&c.length&&h.items!==!0)h.items=r.mergeEvaluated.items(u,c.length,h.items);let _=u.name("valid"),g=u.const("len",t._`${d}.length`);c.forEach((m,S)=>{if((0,r.alwaysValidSchema)(h,m))return;u.if(t._`${g} > ${S}`,()=>i.subschema({keyword:f,schemaProp:S,dataProp:S},_)),i.ok(_)});function y(m){let{opts:S,errSchemaPath:v}=h,w=c.length,P=w===m.minItems&&(w===m.maxItems||m[a]===!1);if(S.strictTuples&&!P){let R=`"${f}" is ${w}-tuple, but minItems or maxItems/${a} are not specified or different at path "${v}"`;(0,r.checkStrictMode)(h,R,S.strictTuples)}}}e.validateTuple=s,e.default=n}),qN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=I0(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),MN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o=pr(),n=T0(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>t.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>t._`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;if(u.items=!0,(0,r.alwaysValidSchema)(u,a))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),LN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:f,maxContains:h}=a;if(u.opts.next)l=f===void 0?1:f,d=h;else l=1;let _=s.const("len",t._`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let v=t._`${_} >= ${l}`;if(d!==void 0)v=t._`${v} && ${_} <= ${d}`;n.pass(v);return}u.items=!0;let g=s.name("valid");if(d===void 0&&l===1)m(g,()=>s.if(g,()=>s.break()));else if(l===0){if(s.let(g,!0),d!==void 0)s.if(t._`${c}.length > 0`,y)}else s.let(g,!1),y();n.result(g,()=>n.reset());function y(){let v=s.name("_valid"),w=s.let("count",0);m(v,()=>s.if(v,()=>S(w)))}function m(v,w){s.forRange("i",0,_,(P)=>{n.subschema({keyword:"contains",dataProp:P,dataPropType:r.Type.Num,compositeRule:!0},v),w()})}function S(v){if(s.code(t._`${v}++`),d===void 0)s.if(t._`${v} >= ${l}`,()=>s.assign(g,!0).break());else if(s.if(t._`${v} > ${d}`,()=>s.assign(g,!1).break()),l===1)s.assign(g,!0);else s.if(t._`${v} >= ${l}`,()=>s.assign(g,!0))}}};e.default=o}),wm=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=Se(),r=ke(),o=pr();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return t.str`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>t._`{property: ${c},
58
+ missingProperty: ${d},
59
+ depsCount: ${u},
60
+ deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let f=Array.isArray(c[d])?u:l;f[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:f}=c;if(Object.keys(u).length===0)return;let h=l.let("missing");for(let _ in u){let g=u[_];if(g.length===0)continue;let y=(0,o.propertyInData)(l,d,_,f.opts.ownProperties);if(c.setParams({property:_,depsCount:g.length,deps:g.join(", ")}),f.allErrors)l.if(y,()=>{for(let m of g)(0,o.checkReportMissingProp)(c,m)});else l.if(t._`${y} && (${(0,o.checkMissingProp)(c,g,h)})`),(0,o.reportMissingProp)(c,h),l.else()}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:f,it:h}=c,_=l.name("valid");for(let g in u){if((0,r.alwaysValidSchema)(h,u[g]))continue;l.if((0,o.propertyInData)(l,d,g,h.opts.ownProperties),()=>{let y=c.subschema({keyword:f,schemaProp:g},_);c.mergeValidEvaluated(y,_)},()=>l.var(_,!0)),c.ok(_)}}e.validateSchemaDeps=a,e.default=n}),DN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,(l)=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(u)}};e.default=o}),k0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pr(),r=Se(),o=dr(),n=ke(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>r._`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:f}=i;if(!d)throw Error("ajv implementation error");let{allErrors:h,opts:_}=f;if(f.props=!0,_.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(f,c))return;let g=(0,t.allSchemaProperties)(u.properties),y=(0,t.allSchemaProperties)(u.patternProperties);m(),i.ok(r._`${d} === ${o.default.errors}`);function m(){a.forIn("key",l,(R)=>{if(!g.length&&!y.length)w(R);else a.if(S(R),()=>w(R))})}function S(R){let b;if(g.length>8){let E=(0,n.schemaRefOrVal)(f,u.properties,"properties");b=(0,t.isOwnProperty)(a,E,R)}else if(g.length)b=(0,r.or)(...g.map((E)=>r._`${R} === ${E}`));else b=r.nil;if(y.length)b=(0,r.or)(b,...y.map((E)=>r._`${(0,t.usePattern)(i,E)}.test(${R})`));return(0,r.not)(b)}function v(R){a.code(r._`delete ${l}[${R}]`)}function w(R){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){v(R);return}if(c===!1){if(i.setParams({additionalProperty:R}),i.error(),!h)a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(f,c)){let b=a.name("valid");if(_.removeAdditional==="failing")P(R,b,!1),a.if((0,r.not)(b),()=>{i.reset(),v(R)});else if(P(R,b),!h)a.if((0,r.not)(b),()=>a.break())}}function P(R,b,E){let C={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};if(E===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(C,b)}}};e.default=s}),UN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ns(),r=pr(),o=ke(),n=k0(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;if(d.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let f=(0,r.allSchemaProperties)(c);for(let m of f)d.definedProperties.add(m);if(d.opts.unevaluated&&f.length&&d.props!==!0)d.props=o.mergeEvaluated.props(a,(0,o.toHash)(f),d.props);let h=f.filter((m)=>!(0,o.alwaysValidSchema)(d,c[m]));if(h.length===0)return;let _=a.name("valid");for(let m of h){if(g(m))y(m);else{if(a.if((0,r.propertyInData)(a,l,m,d.opts.ownProperties)),y(m),!d.allErrors)a.else().var(_,!0);a.endIf()}i.it.definedProperties.add(m),i.ok(_)}function g(m){return d.opts.useDefaults&&!d.compositeRule&&c[m].default!==void 0}function y(m){i.subschema({keyword:"properties",schemaProp:m,dataProp:m},_)}}};e.default=s}),FN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pr(),r=Se(),o=ke(),n=ke(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:f}=d,h=(0,t.allSchemaProperties)(c),_=h.filter((P)=>(0,o.alwaysValidSchema)(d,c[P]));if(h.length===0||_.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;let g=f.strictSchema&&!f.allowMatchingProperties&&l.properties,y=a.name("valid");if(d.props!==!0&&!(d.props instanceof r.Name))d.props=(0,n.evaluatedPropsToName)(a,d.props);let{props:m}=d;S();function S(){for(let P of h){if(g)v(P);if(d.allErrors)w(P);else a.var(y,!0),w(P),a.if(y)}}function v(P){for(let R in g)if(new RegExp(P).test(R))(0,o.checkStrictMode)(d,`property ${R} matches pattern ${P} (use allowMatchingProperties)`)}function w(P){a.forIn("key",u,(R)=>{a.if(r._`${(0,t.usePattern)(i,P)}.test(${R})`,()=>{let b=_.includes(P);if(!b)i.subschema({keyword:"patternProperties",schemaProp:P,dataProp:R,dataPropType:n.Type.Str},y);if(d.opts.unevaluated&&m!==!0)a.assign(r._`${m}[${R}]`,!0);else if(!b&&!d.allErrors)a.if((0,r.not)(y),()=>a.break())})})}}};e.default=s}),VN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ke(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),ZN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pr().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),HN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),f=s.name("_valid");n.setParams({passing:d}),s.block(h),n.result(l,()=>n.reset(),()=>n.error(!0));function h(){u.forEach((_,g)=>{let y;if((0,r.alwaysValidSchema)(c,_))s.var(f,!0);else y=n.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f);if(g>0)s.if(t._`${f} && ${l}`).assign(l,!1).assign(d,t._`[${d}, ${g}]`).else();s.if(f,()=>{if(s.assign(l,!0),s.assign(d,g),y)n.mergeEvaluated(y,t.Name)})})}}};e.default=o}),GN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ke(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),KN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;if(a.then===void 0&&a.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),f=i.name("_valid");if(h(),s.reset(),u&&l){let g=i.let("ifClause");s.setParams({ifClause:g}),i.if(f,_("then",g),_("else",g))}else if(u)i.if(f,_("then"));else i.if((0,t.not)(f),_("else"));s.pass(d,()=>s.error(!0));function h(){let g=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f);s.mergeEvaluated(g)}function _(g,y){return()=>{let m=s.subschema({keyword:g},f);if(i.assign(d,f),s.mergeValidEvaluated(m,d),y)i.assign(y,t._`${g}`);else s.setParams({ifClause:g})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),JN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ke(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),O0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=T0(),r=qN(),o=I0(),n=MN(),s=LN(),i=wm(),a=DN(),c=k0(),u=UN(),l=FN(),d=VN(),f=ZN(),h=HN(),_=GN(),g=KN(),y=JN();function m(S=!1){let v=[d.default,f.default,h.default,_.default,g.default,y.default,a.default,c.default,i.default,u.default,l.default];if(S)v.push(r.default,n.default);else v.push(t.default,o.default);return v.push(s.default),v}e.default=m}),BN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:f,schemaEnv:h,self:_}=l;if(!d.validateFormats)return;if(a)g();else y();function g(){let m=s.scopeValue("formats",{ref:_.formats,code:d.code.formats}),S=s.const("fDef",t._`${m}[${u}]`),v=s.let("fType"),w=s.let("format");s.if(t._`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>s.assign(v,t._`${S}.type || "string"`).assign(w,t._`${S}.validate`),()=>s.assign(v,t._`"string"`).assign(w,S)),o.fail$data((0,t.or)(P(),R()));function P(){if(d.strictSchema===!1)return t.nil;return t._`${u} && !${w}`}function R(){let b=h.$async?t._`(${S}.async ? await ${w}(${i}) : ${w}(${i}))`:t._`${w}(${i})`,E=t._`(typeof ${w} == "function" ? ${b} : ${w}.test(${i}))`;return t._`${w} && ${w} !== true && ${v} === ${n} && !${E}`}}function y(){let m=_.formats[c];if(!m){P();return}if(m===!0)return;let[S,v,w]=R(m);if(S===n)o.pass(b());function P(){if(d.strictSchema===!1){_.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${f}"`}}function R(E){let C=E instanceof RegExp?(0,t.regexpCode)(E):d.code.formats?t._`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,D=s.scopeValue("formats",{key:c,ref:E,code:C});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,t._`${D}.validate`];return["string",E,D]}function b(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!h.$async)throw Error("async format in sync schema");return t._`await ${w}(${i})`}return typeof v=="function"?t._`${w}(${i})`:t._`${w}.test(${i})`}}}};e.default=r}),C0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[BN().default];e.default=t}),N0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),x0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=z0(),r=P0(),o=O0(),n=C0(),s=N0(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),WN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),Rm=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=WN(),o=Ol(),n=ss(),s=ke(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>t._`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:f}=a,{oneOf:h}=d;if(!f.opts.discriminator)throw Error("discriminator: requires discriminator option");let _=l.propertyName;if(typeof _!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!h)throw Error("discriminator: requires oneOf keyword");let g=c.let("valid",!1),y=c.const("tag",t._`${u}${(0,t.getProperty)(_)}`);c.if(t._`typeof ${y} == "string"`,()=>m(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:y,tagName:_})),a.ok(g);function m(){let w=v();c.if(!1);for(let P in w)c.elseIf(t._`${y} === ${P}`),c.assign(g,S(w[P]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:y,tagName:_}),c.endIf()}function S(w){let P=c.name("valid"),R=a.subschema({keyword:"oneOf",schemaProp:w},P);return a.mergeEvaluated(R,t.Name),P}function v(){var w;let P={},R=E(d),b=!0;for(let N=0;N<h.length;N++){let F=h[N];if((F===null||F===void 0?void 0:F.$ref)&&!(0,s.schemaHasRulesButRef)(F,f.self.RULES)){let X=F.$ref;if(F=o.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,X),F instanceof o.SchemaEnv)F=F.schema;if(F===void 0)throw new n.default(f.opts.uriResolver,f.baseId,X)}let Y=(w=F===null||F===void 0?void 0:F.properties)===null||w===void 0?void 0:w[_];if(typeof Y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);b=b&&(R||E(F)),C(Y,N)}if(!b)throw Error(`discriminator: "${_}" must be required`);return P;function E({required:N}){return Array.isArray(N)&&N.includes(_)}function C(N,F){if(N.const)D(N.const,F);else if(N.enum)for(let Y of N.enum)D(Y,F);else throw Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function D(N,F){if(typeof N!="string"||N in P)throw Error(`discriminator: "${_}" values must be unique strings`);P[N]=F}}}};e.default=i}),YN=H((e,t)=>{t.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}}),A0=H((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Sm(),o=x0(),n=Rm(),s=YN(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((h)=>this.addVocabulary(h)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let h=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(h,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=ns();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=Se();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=oa();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=ss();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),j0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=Se(),r=dr(),o=Ol(),n=bm(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let f=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,h=d.errSchemaPath==="#"?d.validateName:a(c);l.if(t._`!${f}`,()=>l.assign(f,h))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:f,baseId:h,localRefs:_,meta:g}=u.root,{schemaId:y}=d.opts,m=new o.SchemaEnv({schema:l,schemaId:y,root:f,baseId:h,localRefs:_,meta:g});return o.compileSchema.call(d,m),(0,n.getValidate)(c,m)}e.default=s}),q0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=Se(),r=dr(),o=bm(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)f();else{let _=c.let("valid",!1);f(_),i.ok(_)}function f(_){if(l.schemaEnv.root.dynamicAnchors[d]){let g=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(g,h(g,_),h(l.validateName,_))}else h(l.validateName,_)()}function h(_,g){return g?()=>c.block(()=>{(0,o.callRef)(i,_),c.let(g,!0)}):()=>(0,o.callRef)(i,_)}}e.dynamicRef=s,e.default=n}),XN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=j0(),r=ke(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),QN=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=q0(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),M0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=j0(),r=q0(),o=XN(),n=QN(),s=[t.default,r.default,o.default,n.default];e.default=s}),ex=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wm(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),tx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wm(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),rx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ke(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),L0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ex(),r=tx(),o=rx(),n=[t.default,r.default,o.default];e.default=n}),ox=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o=dr(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:d,props:f}=l;if(f instanceof t.Name)i.if(t._`${f} !== true`,()=>i.forIn("key",c,(y)=>i.if(_(f,y),()=>h(y))));else if(f!==!0)i.forIn("key",c,(y)=>f===void 0?h(y):i.if(g(f,y),()=>h(y)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function h(y){if(a===!1){if(s.setParams({unevaluatedProperty:y}),s.error(),!d)i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let m=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:y,dataPropType:r.Type.Str},m),!d)i.if((0,t.not)(m),()=>i.break())}}function _(y,m){return t._`!${y} || !${y}[${m}]`}function g(y,m){let S=[];for(let v in y)if(y[v]===!0)S.push(t._`${m} !== ${v}`);return(0,t.and)(...S)}}};e.default=n}),nx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),r=ke(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",t._`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let f=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(f),()=>d(f,u)),n.ok(f)}c.items=!0;function d(f,h){s.forRange("i",h,l,(_)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:_,dataPropType:r.Type.Num},f),!c.allErrors)s.if((0,t.not)(f),()=>s.break())})}}};e.default=o}),D0=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ox(),r=nx(),o=[t.default,r.default];e.default=o}),sx=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),ix=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),ax=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),cx=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),ux=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),lx=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),dx=H((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),px=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=sx(),r=ix(),o=ax(),n=cx(),s=ux(),i=lx(),a=dx(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach((f)=>this.addMetaSchema(f,void 0,!1)),this;function d(f,h){return l?f.$dataMetaSchema(h,c):h}}e.default=u}),fx=H((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Sm(),o=x0(),n=M0(),s=L0(),i=D0(),a=Rm(),c=px(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((g)=>this.addVocabulary(g)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:y}=this.opts;if(!y)return;c.default.call(this,g),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=ns();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=Se();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=oa();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var _=ss();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return _.default}})}),mx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=z0(),r=P0(),o=O0(),n=M0(),s=L0(),i=D0(),a=C0(),c=N0(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),hx=H((e,t)=>{t.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}}}}),gx=H((e,t)=>{t.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"}}}}}),_x=H((e,t)=>{t.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"}}}}),yx=H((e,t)=>{t.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"}}}}),vx=H((e,t)=>{t.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"}}}}),Sx=H((e,t)=>{t.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"}}}}),bx=H((e,t)=>{t.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}}}}),$x=H((e,t)=>{t.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:[]}}}}),wx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hx(),r=gx(),o=_x(),n=yx(),s=vx(),i=Sx(),a=bx(),c=$x(),u=["/properties"];function l(d){return[t,r,o,n,s,f(this,i),a,f(this,c)].forEach((h)=>this.addMetaSchema(h,void 0,!1)),this;function f(h,_){return d?h.$dataMetaSchema(_,u):_}}e.default=l}),Rx=H((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Sm(),o=mx(),n=Rm(),s=wx(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(f={}){super({...f,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((f)=>this.addVocabulary(f)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:f,meta:h}=this.opts;if(!h)return;s.default.call(this,f),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=ns();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=Se();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=oa();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=ss();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),Ex=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(N,F){return{validate:N,compare:F}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(f(!0),h),"iso-time":t(c(),l),"iso-date-time":t(f(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"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:D,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:v,int32:{type:"number",validate:R},int64:{type:"number",validate:b},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\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,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\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,_),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},e.formatNames=Object.keys(e.fullFormats);function r(N){return N%4===0&&(N%100!==0||N%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(N){let F=o.exec(N);if(!F)return!1;let Y=+F[1],X=+F[2],ze=+F[3];return X>=1&&X<=12&&ze>=1&&ze<=(X===2&&r(Y)?29:n[X])}function i(N,F){if(!(N&&F))return;if(N>F)return 1;if(N<F)return-1;return 0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(N){return function(Y){let X=a.exec(Y);if(!X)return!1;let ze=+X[1],He=+X[2],De=+X[3],at=X[4],Ie=X[5]==="-"?-1:1,O=+(X[6]||0),q=+(X[7]||0);if(O>23||q>59||N&&!at)return!1;if(ze<=23&&He<=59&&De<60)return!0;let K=He-q*Ie,z=ze-O*Ie-(K<0?1:0);return(z===23||z===-1)&&(K===59||K===-1)&&De<61}}function u(N,F){if(!(N&&F))return;let Y=new Date("2020-01-01T"+N).valueOf(),X=new Date("2020-01-01T"+F).valueOf();if(!(Y&&X))return;return Y-X}function l(N,F){if(!(N&&F))return;let Y=a.exec(N),X=a.exec(F);if(!(Y&&X))return;if(N=Y[1]+Y[2]+Y[3],F=X[1]+X[2]+X[3],N>F)return 1;if(N<F)return-1;return 0}let d=/t|\s/i;function f(N){let F=c(N);return function(X){let ze=X.split(d);return ze.length===2&&s(ze[0])&&F(ze[1])}}function h(N,F){if(!(N&&F))return;let Y=new Date(N).valueOf(),X=new Date(F).valueOf();if(!(Y&&X))return;return Y-X}function _(N,F){if(!(N&&F))return;let[Y,X]=N.split(d),[ze,He]=F.split(d),De=i(Y,ze);if(De===void 0)return;return De||u(X,He)}let g=/\/|:/,y=/^(?:[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 m(N){return g.test(N)&&y.test(N)}let S=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(N){return S.lastIndex=0,S.test(N)}let w=-2147483648,P=2147483647;function R(N){return Number.isInteger(N)&&N<=P&&N>=w}function b(N){return Number.isInteger(N)}function E(){return!0}let C=/[^\\]\\Z/;function D(N){if(C.test(N))return!1;try{return new RegExp(N),!0}catch(F){return!1}}}),zx=H((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=A0(),r=Se(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:c})=>r.str`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>r._`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:f}=a,{opts:h,self:_}=f;if(!h.validateFormats)return;let g=new t.KeywordCxt(f,_.RULES.all.format.definition,"format");if(g.$data)y();else m();function y(){let v=c.scopeValue("formats",{ref:_.formats,code:h.code.formats}),w=c.const("fmt",r._`${v}[${g.schemaCode}]`);a.fail$data((0,r.or)(r._`typeof ${w} != "object"`,r._`${w} instanceof RegExp`,r._`typeof ${w}.compare != "function"`,S(w)))}function m(){let v=g.schema,w=_.formats[v];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw Error(`"${d}": format "${v}" does not define "compare" function`);let P=c.scopeValue("formats",{key:v,ref:w,code:h.code.formats?r._`${h.code.formats}${(0,r.getProperty)(v)}`:void 0});a.fail$data(S(P))}function S(v){return r._`${v}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=(a)=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),Px=H((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=Ex(),o=zx(),n=Se(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,f]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(c(u,l.formats||r.formatNames,d,f),l.keywords)(0,o.default)(u);return u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw Error(`Unknown format "${u}"`);return d};function c(u,l,d,f){var h,_;(h=(_=u.opts.code).formats)!==null&&h!==void 0||(_.formats=n._`require("ajv-formats/dist/formats").${f}`);for(let g of l)u.addFormat(g,d[g])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),U0=A0(),Tx=fx(),Ix=Rx(),kx=Ya(Px(),1),Ox=kx.default;function vm(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ox(t),t}var Cl=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=vm(Ix.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Og(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=vm(Tx.Ajv2019);return this._ajvDraft7??=vm(U0.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id==="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return(o)=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},b6=U0.Ajv;import Em from"node:process";var W0=Symbol.for("mcp.completable");function Pm(e){return!!e&&typeof e==="object"&&W0 in e}function Nx(e){return e[W0]?.complete}function xx(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function Ax(e,t){let r={},o=(n)=>t===void 0||n===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))r.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))r.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))r.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))r.resourceSubscriptions=[...e.resourceSubscriptions];return r}var Nl=1024;function F0(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[sn]:t}}}}function jx(e){let t=ho(ta).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}var qx=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),Y0=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=Nl,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){if(this._serverCapabilities=e,t!==void 0)this._serverInfo=t}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=jx(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=Ax(t,this._serverCapabilities);return this._subs.set(e.id,r),F0({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!qx.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t==="string"?t:void 0,o=Mx(e.method,r),n=[];for(let[s,i]of this._subs)if(xx(i,o))n.push(F0({method:e.method,params:e.params??{}},s));return n}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[sn]:t,...this._serverInfo!==void 0&&{[Sr]:this._serverInfo}}}});return this._subs.clear(),e}};function Mx(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var Lx=8,Dx=600000;function Ux(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??Lx,roundTimeoutMs:e?.roundTimeoutMs??Dx,legacyShim:e?.legacyShim??!0}}function X0(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new le(B.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=ZS(o);if(n===void 0)throw new le(B.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function Fx(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map((o)=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function zm(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new le(B.InternalError,t)}var Vx=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;while(!0){if(u+=1,u>s)return zm(e,d0(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,f=typeof c.requestState==="string"?c.requestState:void 0;if(!d&&f===void 0)throw new le(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let h;if(d){let y=this._host.resolvedClientCapabilities(o),m=[];for(let[v,w]of Object.entries(l)){let{embedded:P,required:R}=X0(e,v,w);if(P.method!=="roots/list"&&P.params===void 0)throw new le(B.InternalError,`Handler for ${e} returned an input request '${v}' of kind '${P.method}' without params`);if(_l(R,y)!==void 0)return zm(e,`Cannot request input '${v}' (${P.method}): the client on this 2025-era connection did not declare the required capability${y===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);m.push([v,P])}let S=f0(a);try{let v={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:S.signal},w=await Promise.all(m.map(async([P,R])=>{try{return[P,await this._dispatchLeg(R,v)]}catch(b){throw S.abort(b),b}}));h=Object.fromEntries(w)}catch(v){if(a.aborted)throw v;return zm(e,`Fulfilling input required by '${e}' failed: ${v instanceof Error?v.message:String(v)}`)}finally{S.dispose()}}else await p0(l0,a);let _={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:ra(f)}};if(f!==void 0){let y=await this._host.verifyRequestState(f,_,e);if(y!==void 0)_=pm(_,y)}let g=await t(r,_);if(!Hr(g))return g;c=g}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:Fx()};return await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},Zx=new Set(["tools/call","prompts/get","resources/read"]),Hx,Q0,eb;function Tm(e,t){Q0(e,t)}function Im(e){return eb(e)}var tb=class extends mm{_clientCapabilities;_clientVersion;static{Hx=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},Q0=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},eb=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Vx({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Cl,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=Ux(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)om(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Yf(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=El(fo,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[io],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(fo.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ve(Pe.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=hm(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=Zx.has(e);if(r===void 0&&!o)return async(n,s)=>{let i=await t(n,s);if(Hr(i))throw new le(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i};return async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Hr(i)){if(!o)throw new le(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:yl(i,r)}}return async(r,o)=>{let n=ho(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new le(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Hr(i))return i;let a=Xf(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new le(c.reason==="not-in-era"?B.InternalError:B.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&rs(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!=="string")throw new le(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s==="string"){let d=await this._verifyRequestState(s,o,e);if(d!==void 0)i=pm(o,d)}let a;try{a=await t(r,i)}catch(d){if(d instanceof le&&d.code===B.UrlElicitationRequired){if(!n)throw d;throw new le(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw d}if(!Hr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new le(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??nn}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState==="string";if(!u&&!l)throw new le(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let d=this._inputRequestCapabilityView(o);for(let[f,h]of Object.entries(c)){let{embedded:_,required:g}=X0(e,f,h),y=_l(g,d);if(y!==void 0)throw new Sl({requiredCapabilities:y},`Cannot request input '${f}' (${_.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new le(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Vr]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ve(Pe.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ve(Pe.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ve(Pe.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ve(Pe.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ve(Pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ve(Pe.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ve(Pe.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ve(Pe.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ve(Pe.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ve(Pe.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ve(Pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ve(Pe.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ve(Pe.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ve(Pe.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=GS(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??nn;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Yf(this._supportedProtocolVersions),capabilities:Gx(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ve(Pe.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],a=i.some((d)=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some((d)=>d.type==="tool_use");if(a){if(i.some((d)=>d.type!=="tool_result"))throw new le(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new le(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),f=new Set(i.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(d.size!==f.size||![...d].every((h)=>f.has(h)))throw new le(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ve(Pe.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ve(Pe.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ve(Pe.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new le(B.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){if(a instanceof le)throw a;throw new le(B.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ve(Pe.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function Gx(e){return{...e}}var sa=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Z0;try{let r=yo(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}constructor(e,t){if(this.server=new tb(e,t),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?yo(t.inputSchema,"input"):Z0,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)r.outputSchema=yo(t.outputSchema,"output");return r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new le(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new le(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);if(await this.validateToolOutput(r,n,e.params.name),Hr(n))return n;return this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof le&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let o=await un(e.inputSchema,t??{});if(!o.success)throw new le(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(Hr(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new le(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await un(e.outputSchema,t.structuredContent);if(!o.success)throw new le(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return im(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return am(e),this.handleResourceCompletion(e,e.params.ref);default:throw new le(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new le(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new le(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return na;let o=B0(J0(r.argsSchema)?.[e.params.argument.name]);if(!Pm(o))return na;let n=Nx(o);if(!n)return na;return K0(await n(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((n)=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return na;throw new le(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return na;return K0(await o(e.params.argument.value,e.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new le(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new le(B.InvalidParams,`Resource ${r} disabled`);return yl(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return yl(await n.readCallback(r,s,t),n.cacheHint)}throw new vl(e.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?u0(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new le(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new le(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,r,o){let n=r.cacheHint,s=r;if(n!==void 0){om(n,`resource ${e}`);let i={...r};delete i.cacheHint,s=i}if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let i=this._createRegisteredResource(e,r.title,t,s,o);if(n!==void 0)i.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,r.title,t,s,o);if(n!==void 0)i.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(e,t,r,o,n){let s={name:e,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:(i)=>{if(i.uri!==void 0&&i.uri!==r){if(delete this._registeredResources[r],i.uri)this._registeredResources[i.uri]=s}if(i.name!==void 0)s.name=i.name;if(i.title!==void 0)s.title=i.title;if(i.metadata!==void 0)s.metadata=i.metadata;if(i.callback!==void 0)s.readCallback=i.callback;if(i.enabled!==void 0)s.enabled=i.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(e,t,r,o,n){let s={resourceTemplate:r,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(a)=>{if(a.name!==void 0&&a.name!==e){if(delete this._registeredResourceTemplates[e],a.name)this._registeredResourceTemplates[a.name]=s}if(a.title!==void 0)s.title=a.title;if(a.template!==void 0)s.resourceTemplate=a.template;if(a.metadata!==void 0)s.metadata=a.metadata;if(a.callback!==void 0)s.readCallback=a.callback;if(a.enabled!==void 0)s.enabled=a.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let i=r.uriTemplate.variableNames;if(Array.isArray(i)&&i.some((a)=>!!r.completeCallback(a)))this.setCompletionRequestHandler();return s}_createRegisteredPrompt(e,t,r,o,n,s,i){let a=o,c=n,u={title:t,description:r,argsSchema:o,icons:s,_meta:i,handler:G0(e,o,n),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:(l)=>{if(l.name!==void 0&&l.name!==e){if(delete this._registeredPrompts[e],l.name)this._registeredPrompts[l.name]=u}if(l.title!==void 0)u.title=l.title;if(l.description!==void 0)u.description=l.description;if(l.icons!==void 0)u.icons=l.icons;if(l._meta!==void 0)u._meta=l._meta;let d=!1;if(l.argsSchema!==void 0)u.argsSchema=l.argsSchema,a=l.argsSchema,d=!0;if(l.callback!==void 0)c=l.callback,d=!0;if(d)u.handler=G0(e,a,c);if(l.enabled!==void 0)u.enabled=l.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let l=J0(o);if(l){if(Object.values(l).some((d)=>Pm(B0(d))))this.setCompletionRequestHandler()}}return u}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u){if(ym(e),o!==void 0)try{let f=yo(o,"input");this._toolInputSchemaJson[e]=f;let h=cm(f);if(!h.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${h.reason}`)}catch{}let l=u,d={title:t,description:r,inputSchema:o,outputSchema:n,outputSchemaJson:H0(n),annotations:s,icons:i,execution:a,_meta:c,handler:u,executor:V0(o,u),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:(f)=>{if(f.name!==void 0&&f.name!==e){if(typeof f.name==="string")ym(f.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],f.name)delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=d,e=f.name}if(f.title!==void 0)d.title=f.title;if(f.description!==void 0)d.description=f.description;let h=!1;if(f.paramsSchema!==void 0)d.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[e],h=!0;if(f.callback!==void 0)d.handler=f.callback,l=f.callback,h=!0;if(h)d.executor=V0(d.inputSchema,l);if(f.outputSchema!==void 0)d.outputSchema=f.outputSchema,d.outputSchemaJson=H0(f.outputSchema);if(f.annotations!==void 0)d.annotations=f.annotations;if(f.icons!==void 0)d.icons=f.icons;if(f._meta!==void 0)d._meta=f._meta;if(f.enabled!==void 0)d.enabled=f.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,n,zl(s),zl(i),a,c,void 0,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,_meta:a}=t,c=this._createRegisteredPrompt(e,o,n,zl(s),r,i,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function V0(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var Z0={type:"object",properties:{}};function H0(e){if(e===void 0)return;try{return yo(e,"output")}catch{return}}function G0(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await un(t,n);if(!i.success)throw new le(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function K0(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var na={completion:{values:[],hasMore:!1}};function J0(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function Kx(e){return e?.type==="optional"}function B0(e){if(!Kx(e))return e;return e.def?.innerType??e}var Jx=class{_readBuffer;_started=!1;_closed=!1;constructor(e=Em.stdin,t=Em.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new gm({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=(e)=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=(e)=>{this.onerror?.(e)};_onstdouterror=(e)=>{this.onerror?.(e),this.close().catch(()=>{})};async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){while(!0)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._closed)return;if(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send(e){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((t,r)=>{let o=_m(e),n=!1,s=(a)=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(a)},i=()=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t()};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else if(!n)this._stdout.once("drain",i)})}},rb=3000,Bx=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor(e,t,r){this._wire=e,this._onInstanceClose=t,this._outboundIntercept=r}async start(){}async send(e,t){if(Qi(e)||Rl(e)){let{id:r}=e;if(r!==void 0)this._settle(r)}if(this._closed)return;if(this._outboundIntercept?.(e)==="handled")return;return this._wire.send(e,t)}setProtocolVersion=(e)=>{this._wire.setProtocolVersion?.(e)};deliver(e,t){if(this._closed)return;if(Qt(e))this._pendingRequests.add(e.id);else if(_o(e)&&e.method==="notifications/cancelled"){let r=e.params?.requestId;if(r!==void 0)this._settle(r)}this.onmessage?.(e,t)}async whenRequestsAnswered(e){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((t)=>{let r=()=>{clearTimeout(o),t(!0)},o=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((n)=>n!==r),t(!1)},e);this._drainWaiters.push(r)})}async close(){if(this._closed)return;this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}_settle(e){if(this._pendingRequests.delete(e),this._pendingRequests.size===0)this._releaseDrainWaiters()}_releaseDrainWaiters(){let e=this._drainWaiters;this._drainWaiters=[];for(let t of e)t()}};function Wx(e){let t=e.params;if(e.method==="initialize"&&!um(t)){let s=t!==null&&typeof t==="object"&&typeof t.protocolVersion==="string"?t.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!bl(t))return{kind:"legacy",reason:"no-claim"};let r=dn(t),o=(r===void 0?[]:wl(r))[0];if(o!==void 0)return{kind:"invalid-envelope",issue:o};let n=$l(t);if(n===void 0||!go.includes(n))return{kind:"unsupported-revision",requested:n??"unknown"};return{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function ob(e,t={}){let r=t.legacy??"serve",o=t.transport??new Jx,n={phase:"opening"},s,i=!1,a=()=>i||n.phase==="closed",c=(E)=>{try{t.onerror?.(E)}catch{}},u=(E,C,D,N)=>o.send({jsonrpc:"2.0",id:E,error:{code:C,message:D,...N!==void 0&&{data:N}}}).catch((F)=>c(fr(F))),l=new Y0(t.maxSubscriptions??Nl),d=(E)=>{if(!_o(E))return;let C=l.routeOutbound(E);if(C==="passthrough")return;for(let D of C)o.send({jsonrpc:"2.0",...D}).catch((N)=>c(fr(N)));return"handled"},f=async(E)=>{if(Qt(E)&&E.method==="subscriptions/listen"){let C=dn(E.params),D=bl(E.params)?(C===void 0?[]:wl(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},N=$l(E.params),F;if(D!==void 0)F={jsonrpc:"2.0",id:E.id,error:{code:-32602,message:`Invalid _meta envelope: ${D.key}: ${D.problem}`}};else if(N===void 0||!go.includes(N)){let Y=new os({supported:[...go],requested:N??"unknown"});F={jsonrpc:"2.0",id:E.id,error:{code:Y.code,message:Y.message,data:Y.data}}}else F=l.serve(E);return await o.send("error"in F?F:{jsonrpc:"2.0",method:F.method,params:F.params}).catch((Y)=>c(fr(Y))),!0}if(_o(E)&&E.method==="notifications/cancelled"){let C=E.params?.requestId;if(C!==void 0&&l.cancel(C))return!0}return!1},h=(E,C,D)=>{let N=lm({kind:"legacy",reason:C,...D!==void 0&&{requestedVersion:D}},go);if(N===void 0)return Promise.resolve();return c(Error(`Rejected 2025-era request on a modern-only stdio connection (${N.cell}): ${N.message}`)),u(E.id,N.code,N.message,N.data)},_=(E)=>{if(i||E===s)return;R()},g=async(E,C)=>{let D=await e({era:E}),N=D instanceof sa?D.server:D;if(E==="modern")fm(N,C),Tm(N,go),l.setServerCapabilities(N.getCapabilities(),Im(N));let F=new Bx(o,()=>_(F),E==="modern"?d:void 0);return await D.connect(F),{product:D,channel:F}},y=(E)=>E.product.close().catch((C)=>c(fr(C))),m=async(E)=>{s=E.channel;try{if(!await E.channel.whenRequestsAnswered(rb))c(Error(`Discarded the probe instance with requests still unanswered after ${rb}ms; continuing with the fallback`));await E.product.close()}catch(C){c(fr(C))}finally{s=void 0}},S=async(E)=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&Qt(E)&&E.method==="initialize"&&!um(E.params)){await h(E,"initialize",E.params!==null&&typeof E.params==="object"&&typeof E.params.protocolVersion==="string"?E.params.protocolVersion:void 0);return}if(n.era==="modern"&&await f(E))return;n.instance.channel.deliver(E);return}if(!Qt(E)&&!_o(E)){c(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=Wx(E);switch(C.kind){case"invalid-envelope":{let D=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(Qt(E))await u(E.id,B.InvalidParams,D,{envelope:C.issue});else c(Error(`Discarded a notification with a malformed envelope: ${D}`));return}case"unsupported-revision":if(Qt(E)){let D=new os({supported:[...go],requested:C.requested});c(D),await u(E.id,D.code,D.message,D.data)}else c(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(Qt(E)&&E.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver(E,{classification:C.classification});return}let D=await g("modern",C.revision);if(a()){await y(D);return}n={phase:"probe",instance:D},D.channel.deliver(E,{classification:C.classification});return}if(n.phase==="probe"){if(_o(E)){n.instance.channel.deliver(E,{classification:C.classification});return}n={phase:"pinned",era:"modern",instance:n.instance}}else{let D=await g("modern",C.revision);if(a()){await y(D);return}n={phase:"pinned",era:"modern",instance:D}}if(await f(E))return;n.instance.channel.deliver(E,{classification:C.classification});return;case"legacy":{if(r==="reject"){if(Qt(E))await h(E,C.reason,C.requestedVersion);return}if(n.phase==="probe"){if(await m(n.instance),a())return;n={phase:"opening"}}let D=await g("legacy");if(a()){await y(D);return}n={phase:"pinned",era:"legacy",instance:D},n.instance.channel.deliver(E);return}}},v=[],w=!1,P=async()=>{if(w)return;w=!0;try{while(v.length>0){let E=v.shift();try{await S(E)}catch(C){if(Qt(E))await u(E.id,B.InternalError,"Internal server error");c(fr(C))}}}finally{w=!1}},R=async()=>{if(i||n.phase==="closed")return;i=!0;let E=n;n={phase:"closed"};for(let C of l.teardownAll())await o.send(C).catch((D)=>c(fr(D)));if(E.phase==="probe"||E.phase==="pinned")await E.instance.product.close().catch((C)=>c(fr(C)));await o.close().catch((C)=>c(fr(C)))};o.onmessage=(E)=>{v.push(E),P()},o.onerror=(E)=>{if(c(E),n.phase==="probe"||n.phase==="pinned")n.instance.channel.onerror?.(E)},o.onclose=()=>{if(i||n.phase==="closed")return;i=!0;let E=n;if(n={phase:"closed"},E.phase==="probe"||E.phase==="pinned")E.instance.product.close().catch((C)=>c(fr(C)))};let b=o.start().catch((E)=>{throw c(fr(E)),E});return b.catch(()=>{}),{close:async()=>{await b.catch(()=>{}),await R()}}}function fr(e){return e instanceof Error?e:Error(String(e))}class Qe extends Error{exitCode;statusCode;constructor(e,t=1,r){super(e);this.exitCode=t;this.statusCode=r;this.name="CliError"}}class pn extends Qe{constructor(e){super("Could not reach the account service to renew the session; try again.",Bt.NETWORK);this.name="RefreshUnavailableError",this.cause=e}}var Bt={SUCCESS:0,ERROR:1,USAGE:2,AUTH:3,RATE_LIMITED:4,NETWORK:5};var nb="grove-cli/0.1.6";class fn{baseUrl;apiKey;token;timeout;verbose;userAgent;extraHeaders;onUnauthorized;constructor(e,t={}){this.baseUrl=e.replace(/\/$/,""),this.apiKey=t.apiKey,this.token=t.token,this.timeout=t.timeout??30000,this.verbose=t.verbose??!1,this.userAgent=t.userAgent??nb,this.extraHeaders=t.headers??{},this.onUnauthorized=t.onUnauthorized}authHeader(){if(this.apiKey)return{"X-API-Key":this.apiKey};if(this.token)return{Authorization:`Bearer ${this.token}`};return{}}buildUrl(e,t){let r=new URL(`${this.baseUrl}${e}`);if(t)for(let[o,n]of Object.entries(t))r.searchParams.set(o,n);return r.toString()}async request(e,t,r={}){try{return await this.attemptRequest(e,t,r)}catch(o){if(!(o instanceof Qe&&o.statusCode===401)||!this.onUnauthorized)throw o;let s;try{s=await this.onUnauthorized(this.token)}catch(i){if(i instanceof pn)throw i;throw o}if(!s)throw o;return this.token=s.token,this.attemptRequest(e,t,r)}}async attemptRequest(e,t,r={}){let o=this.buildUrl(t,r.params),n={...this.extraHeaders,"User-Agent":this.userAgent,...this.authHeader(),...r.body!==void 0?{"Content-Type":"application/json"}:{}},s={method:e,headers:n,signal:AbortSignal.timeout(this.timeout)};if(r.body!==void 0)s.body=JSON.stringify(r.body);if(this.verbose)process.stderr.write(`--> ${e} ${o}
61
+ `);let i;try{i=await fetch(o,s)}catch(c){let u=c instanceof Error?c.message:String(c);throw new Qe(`Cannot reach API at ${this.baseUrl}: ${u}`,Bt.NETWORK)}if(this.verbose)process.stderr.write(`<-- ${i.status} ${i.statusText}
62
+ `);if(i.status===204)return null;if(i.ok){let c=await i.json();if(c&&typeof c==="object"&&"data"in c&&Object.keys(c).length===1)return c.data;return c}let a=`${i.status} ${i.statusText}`;try{let c=await i.json();if(typeof c.message==="string")a=c.message;else if(typeof c.error==="string")a=c.error}catch{}switch(i.status){case 401:throw new Qe("Session expired. Run `grove auth login` to re-authenticate.",Bt.AUTH,401);case 429:{let c=i.headers.get("Retry-After"),u=c&&/^\d+$/.test(c)?`Rate limited. Retry in ${c}s`:"Rate limited. Try again later";throw new Qe(u,Bt.RATE_LIMITED,429)}default:if(i.status>=500)throw new Qe(`Server error: ${a}`,Bt.ERROR,i.status);throw new Qe(a,Bt.ERROR,i.status)}}get(e,t){return this.request("GET",e,{params:t})}post(e,t){return this.request("POST",e,{body:t})}patch(e,t){return this.request("PATCH",e,{body:t})}put(e,t){return this.request("PUT",e,{body:t})}delete(e){return this.request("DELETE",e)}async listSources(e){let t={};if(e)t.groupId=e;return this.adminKeyRead("/api/v1/sources",t,"listing sources")}getSource(e){return this.adminKeyRead(`/api/v1/sources/${encodeURIComponent(e)}`,void 0,"reading a source by id")}async adminKeyRead(e,t,r){try{return await this.get(e,t)}catch(o){if(this.apiKey&&o instanceof Qe&&o.statusCode===403)throw new Qe(`Admin API key required: ${r} with an API key needs a key in the server's ADMIN_API_KEYS (a plain API_KEYS key gets 403). Use an admin-key profile, or authenticate as a user to read your own subscriptions.`,o.exitCode,403);throw o}}listAccessRequests(e){let t={};if(e.status)t.status=e.status;if(e.page)t.page=e.page;if(e.limit)t.limit=e.limit;return this.get("/api/v1/admin/access-requests",t)}resolveAccessRequest(e,t){return this.post(`/api/v1/admin/access-requests/${encodeURIComponent(e)}/resolve`,t)}revokeEntitlement(e,t){return this.post(`/api/v1/admin/entitlements/${encodeURIComponent(e)}/revoke`,t)}async getRaw(e,t){let r=this.buildUrl(e,t),n={method:"GET",headers:{...this.extraHeaders,"Content-Type":"application/json","User-Agent":this.userAgent,...this.authHeader()},signal:AbortSignal.timeout(this.timeout)};if(this.verbose)process.stderr.write(`--> GET ${r}
63
+ `);let s;try{s=await fetch(r,n)}catch(i){let a=i instanceof Error?i.message:String(i);throw new Qe(`Cannot reach API at ${this.baseUrl}: ${a}`,Bt.NETWORK)}if(this.verbose)process.stderr.write(`<-- ${s.status} ${s.statusText}
64
+ `);if(s.ok)return s.text();throw new Qe(`${s.status} ${s.statusText}`,Bt.ERROR)}}import{dirname as iZ,join as aZ}from"node:path";import{isDeepStrictEqual as D4}from"node:util";import fI from"node:process";import $n from"node:fs";import mI from"node:path";import Ia from"node:crypto";import U4 from"node:assert";var mn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var km=new Set(["__proto__","prototype","constructor"]),Yx=new Set("0123456789");function xl(e){let t=[],r="",o="start",n=!1;for(let s of e)switch(s){case"\\":{if(o==="index")throw Error("Invalid character in an index");if(o==="indexEnd")throw Error("Invalid character after an index");if(n)r+=s;o="property",n=!n;break}case".":{if(o==="index")throw Error("Invalid character in an index");if(o==="indexEnd"){o="property";break}if(n){n=!1,r+=s;break}if(km.has(r))return[];t.push(r),r="",o="property";break}case"[":{if(o==="index")throw Error("Invalid character in an index");if(o==="indexEnd"){o="index";break}if(n){n=!1,r+=s;break}if(o==="property"){if(km.has(r))return[];t.push(r),r=""}o="index";break}case"]":{if(o==="index"){t.push(Number.parseInt(r,10)),r="",o="indexEnd";break}if(o==="indexEnd")throw Error("Invalid character after an index")}default:{if(o==="index"&&!Yx.has(s))throw Error("Invalid character in an index");if(o==="indexEnd")throw Error("Invalid character after an index");if(o==="start")o="property";if(n)n=!1,r+="\\";r+=s}}if(n)r+="\\";switch(o){case"property":{if(km.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function Om(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 sb(e,t){if(Om(e,t))throw Error("Cannot use string index")}function ib(e,t,r){if(!mn(e)||typeof t!=="string")return r===void 0?e:r;let o=xl(t);if(o.length===0)return r;for(let n=0;n<o.length;n++){let s=o[n];if(Om(e,s))e=n===o.length-1?void 0:null;else e=e[s];if(e===void 0||e===null){if(n!==o.length-1)return r;break}}return e===void 0?r:e}function Cm(e,t,r){if(!mn(e)||typeof t!=="string")return e;let o=e,n=xl(t);for(let s=0;s<n.length;s++){let i=n[s];if(sb(e,i),s===n.length-1)e[i]=r;else if(!mn(e[i]))e[i]=typeof n[s+1]==="number"?[]:{};e=e[i]}return o}function ab(e,t){if(!mn(e)||typeof t!=="string")return!1;let r=xl(t);for(let o=0;o<r.length;o++){let n=r[o];if(sb(e,n),o===r.length-1)return delete e[n],!0;if(e=e[n],!mn(e))return!1}}function cb(e,t){if(!mn(e)||typeof t!=="string")return!1;let r=xl(t);if(r.length===0)return!1;for(let o of r){if(!mn(e)||!(o in e)||Om(e,o))return!1;e=e[o]}return!0}import Be from"node:path";import ub from"node:os";import Nm from"node:process";var vo=ub.homedir(),xm=ub.tmpdir(),{env:is}=Nm,Xx=(e)=>{let t=Be.join(vo,"Library");return{data:Be.join(t,"Application Support",e),config:Be.join(t,"Preferences",e),cache:Be.join(t,"Caches",e),log:Be.join(t,"Logs",e),temp:Be.join(xm,e)}},Qx=(e)=>{let t=is.APPDATA||Be.join(vo,"AppData","Roaming"),r=is.LOCALAPPDATA||Be.join(vo,"AppData","Local");return{data:Be.join(r,e,"Data"),config:Be.join(t,e,"Config"),cache:Be.join(r,e,"Cache"),log:Be.join(r,e,"Log"),temp:Be.join(xm,e)}},e1=(e)=>{let t=Be.basename(vo);return{data:Be.join(is.XDG_DATA_HOME||Be.join(vo,".local","share"),e),config:Be.join(is.XDG_CONFIG_HOME||Be.join(vo,".config"),e),cache:Be.join(is.XDG_CACHE_HOME||Be.join(vo,".cache"),e),log:Be.join(is.XDG_STATE_HOME||Be.join(vo,".local","state"),e),temp:Be.join(xm,t,e)}};function Am(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Nm.platform==="darwin")return Xx(e);if(Nm.platform==="win32")return Qx(e);return e1(e)}import c1 from"node:path";import Ne from"node:fs";import{promisify as Tt}from"node:util";var t1=(e,t)=>{let{onError:r}=t;return function(...n){return e.apply(void 0,n).catch(r)}},br=t1;var r1=(e,t)=>{let{onError:r}=t;return function(...n){try{return e.apply(void 0,n)}catch(s){return r(s)}}},mr=r1;var lb=250;var o1=(e,t)=>{let{isRetriable:r}=t;return function(n){let{timeout:s}=n,i=n.interval??lb,a=Date.now()+s;return function c(...u){return e.apply(void 0,u).catch((l)=>{if(!r(l))throw l;if(Date.now()>=a)throw l;let d=Math.round(i*Math.random());if(d>0)return new Promise((h)=>setTimeout(h,d)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},$r=o1;var n1=(e,t)=>{let{isRetriable:r}=t;return function(n){let{timeout:s}=n,i=Date.now()+s;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}}}},wr=n1;import pb from"node:process";var ia={isChangeErrorOk:(e)=>{if(!ia.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!db&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!ia.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(!ia.isNodeError(e))throw e;if(ia.isChangeErrorOk(e))return;throw e}},jm=ia;var aa={onError:jm.onChangeError},qt={onError:()=>{return}},db=pb.getuid?!pb.getuid():!1,St={isRetriable:jm.isRetriableError};var s1={attempt:{chmod:br(Tt(Ne.chmod),aa),chown:br(Tt(Ne.chown),aa),close:br(Tt(Ne.close),qt),fsync:br(Tt(Ne.fsync),qt),mkdir:br(Tt(Ne.mkdir),qt),realpath:br(Tt(Ne.realpath),qt),stat:br(Tt(Ne.stat),qt),unlink:br(Tt(Ne.unlink),qt),chmodSync:mr(Ne.chmodSync,aa),chownSync:mr(Ne.chownSync,aa),closeSync:mr(Ne.closeSync,qt),existsSync:mr(Ne.existsSync,qt),fsyncSync:mr(Ne.fsync,qt),mkdirSync:mr(Ne.mkdirSync,qt),realpathSync:mr(Ne.realpathSync,qt),statSync:mr(Ne.statSync,qt),unlinkSync:mr(Ne.unlinkSync,qt)},retry:{close:$r(Tt(Ne.close),St),fsync:$r(Tt(Ne.fsync),St),open:$r(Tt(Ne.open),St),readFile:$r(Tt(Ne.readFile),St),rename:$r(Tt(Ne.rename),St),stat:$r(Tt(Ne.stat),St),write:$r(Tt(Ne.write),St),writeFile:$r(Tt(Ne.writeFile),St),closeSync:wr(Ne.closeSync,St),fsyncSync:wr(Ne.fsyncSync,St),openSync:wr(Ne.openSync,St),readFileSync:wr(Ne.readFileSync,St),renameSync:wr(Ne.renameSync,St),statSync:wr(Ne.statSync,St),writeSync:wr(Ne.writeSync,St),writeFileSync:wr(Ne.writeFileSync,St)}},_t=s1;import hn from"node:process";var fb="utf8",qm=438,mb=511;var hb={},gb=hn.geteuid?hn.geteuid():-1,_b=hn.getegid?hn.getegid():-1;var yb=1000,vb=!!hn.getuid,rK=hn.getuid?!hn.getuid():!1,Mm=128;var Sb=(e)=>e instanceof Error&&("code"in e);var Lm=(e)=>typeof e==="string",Al=(e)=>e===void 0;import a1 from"node:path";import as from"node:process";import bb from"node:process";var $b=bb.platform==="linux",jl=bb.platform==="win32";var Dm=["SIGHUP","SIGINT","SIGTERM"];if(!jl)Dm.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if($b)Dm.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wb=Dm;class Rb{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(jl&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))as.kill(as.pid,"SIGTERM");else as.kill(as.pid,e)},this.hook=()=>{as.once("exit",()=>this.exit());for(let e of wb)try{as.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Eb=new Rb;var i1=Eb.register,zb=i1;var Wt={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),o="tmp-",n=`.tmp-${r}${t}`;return`${e}${n}`},get:(e,t,r=!0)=>{let o=Wt.truncate(t(e));if(o in Wt.store)return Wt.get(e,t,r);return Wt.store[o]=r,[o,()=>delete Wt.store[o]]},purge:(e)=>{if(!Wt.store[e])return;delete Wt.store[e],_t.attempt.unlink(e)},purgeSync:(e)=>{if(!Wt.store[e])return;delete Wt.store[e],_t.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Wt.store)Wt.purgeSync(e)},truncate:(e)=>{let t=a1.basename(e);if(t.length<=Mm)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let o=t.length-Mm;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-o)}${r[3]}`}};zb(Wt.purgeSyncAll);var ca=Wt;function Um(e,t,r=hb){if(Lm(r))return Um(e,t,{encoding:r});let n={timeout:r.timeout??yb},s=null,i=null,a=null;try{let c=_t.attempt.realpathSync(e),u=!!c;e=c||e,[i,s]=ca.get(e,r.tmpCreate||ca.create,r.tmpPurge!==!1);let l=vb&&Al(r.chown),d=Al(r.mode);if(u&&(l||d)){let f=_t.attempt.statSync(e);if(f){if(r={...r},l)r.chown={uid:f.uid,gid:f.gid};if(d)r.mode=f.mode}}if(!u){let f=c1.dirname(e);_t.attempt.mkdirSync(f,{mode:mb,recursive:!0})}if(a=_t.retry.openSync(n)(i,"w",r.mode||qm),r.tmpCreated)r.tmpCreated(i);if(Lm(t))_t.retry.writeSync(n)(a,t,0,r.encoding||fb);else if(!Al(t))_t.retry.writeSync(n)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)_t.retry.fsyncSync(n)(a);else _t.attempt.fsync(a);if(_t.retry.closeSync(n)(a),a=null,r.chown&&(r.chown.uid!==gb||r.chown.gid!==_b))_t.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==qm)_t.attempt.chmodSync(i,r.mode);try{_t.retry.renameSync(n)(i,e)}catch(f){if(!Sb(f))throw f;if(f.code!=="ENAMETOOLONG")throw f;_t.retry.renameSync(n)(i,ca.truncate(e))}s(),i=null}finally{if(a)_t.attempt.closeSync(a);if(i)ca.purge(i)}}var gI=rp(Wz(),1),_I=rp(yP(),1);var $F=(e,t,r,o)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let n=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(t,r);if(!wF(n,s)&&o)return;Object.defineProperty(e,r,s)},wF=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)},RF=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},EF=(e,t)=>`/* Wrapped ${e}*/
65
+ ${t}`,zF=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),PF=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),TF=(e,t,r)=>{let o=r===""?"":`with ${r.trim()}() `,n=EF.bind(null,o,t.toString());Object.defineProperty(n,"name",PF);let{writable:s,enumerable:i,configurable:a}=zF;Object.defineProperty(e,"toString",{value:n,writable:s,enumerable:i,configurable:a})};function Wh(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:o}=e;for(let n of Reflect.ownKeys(t))$F(e,t,n,r);return RF(e,t),TF(e,t,o),e}var IF=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:o=Number.POSITIVE_INFINITY,before:n=!1,after:s=!0}=t;if(r<0||o<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!n&&!s)throw Error("Both `before` and `after` are false, function wouldn't be called.");let i,a,c,u=function(...l){let d=this,f=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(s)c=e.apply(d,l)},h=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(s)c=e.apply(d,l)},_=n&&!i;if(clearTimeout(i),i=setTimeout(f,r),o>0&&o!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(h,o);if(_)c=e.apply(d,l);return c};return Wh(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},Yh=IF;var wn=rp(uI(),1);var N4=Object.prototype.toString;function dI(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return N4.call(e)===r}function pI(e){return dI(e,Uint8Array,"[object Uint8Array]")}function x4(e){return dI(e,ArrayBuffer,"[object ArrayBuffer]")}function A4(e){return pI(e)||x4(e)}function j4(e){if(!pI(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function q4(e){if(!A4(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function pg(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((n,s)=>n+s.length,0);let r=new Uint8Array(t),o=0;for(let n of e)j4(n),r.set(n,o),o+=n.length;return r}var lI={utf8:new globalThis.TextDecoder("utf8")};function fg(e,t="utf8"){return q4(e),lI[t]??=new globalThis.TextDecoder(t),lI[t].decode(e)}function M4(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}var L4=new globalThis.TextEncoder;function Bd(e){return M4(e),L4.encode(e)}var Z5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var F4=_I.default.default,hI="aes-256-cbc",As=()=>Object.create(null),V4=(e)=>e!==void 0&&e!==null,Z4=(e,t)=>{let r=new Set(["undefined","symbol","function"]),o=typeof t;if(r.has(o))throw TypeError(`Setting a value of type \`${o}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Wd="__internal__",mg=`${Wd}.migrations.version`;class Yd{path;events;#o;#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=Am(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 s=new gI.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});F4(s);let i={...t.rootSchema,type:"object",properties:t.schema};this.#o=s.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=mI.resolve(t.cwd,`${t.configName??"config"}${r}`);let o=this.store,n=Object.assign(As(),t.defaults,o);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(n);try{U4.deepEqual(o,n)}catch{this.store=n}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 ${Wd} key, as it's used to manage this module internal operations.`);let{store:r}=this,o=(n,s)=>{if(Z4(n,s),this.#e.accessPropertiesByDotNotation)Cm(r,n,s);else r[n]=s};if(typeof e==="object"){let n=e;for(let[s,i]of Object.entries(n))o(s,i)}else o(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return cb(this.store,e);return e in this.store}reset(...e){for(let t of e)if(V4(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)ab(t,e);else delete t[e];this.store=t}clear(){this.store=As();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=$n.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(As(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),As();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return As();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:fg(e);try{let t=e.slice(0,16),r=Ia.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),o=Ia.createDecipheriv(hI,r,t),n=e.slice(17),s=typeof n==="string"?Bd(n):n;return fg(pg([o.update(s),o.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),o=()=>{let n=r,s=e();if(D4(s,n))return;r=s,t.call(this,s,n)};return this.events.addEventListener("change",o),()=>{this.events.removeEventListener("change",o)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#o)return;if(this.#o(e)||!this.#o.errors)return;let r=this.#o.errors.map(({instancePath:o,message:n=""})=>`\`${o.slice(1)}\` ${n}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){$n.mkdirSync(mI.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=Ia.randomBytes(16),o=Ia.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),n=Ia.createCipheriv(hI,o,r);t=pg([r,Bd(":"),n.update(Bd(t)),n.final()])}if(fI.env.SNAP)$n.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Um(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){$n.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!$n.existsSync(this.path))this._write(As());if(fI.platform==="win32")$n.watch(this.path,{persistent:!1},Yh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else $n.watchFile(this.path,{persistent:!1},Yh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let o=this._get(mg,"0.0.0"),n=Object.keys(e).filter((i)=>this._shouldPerformMigration(i,o,t)),s={...this.store};for(let i of n)try{if(r)r(this,{fromVersion:o,toVersion:i,finalVersion:t,versions:n});let a=e[i];a?.(this),this._set(mg,i),o=i,s={...this.store}}catch(a){throw this.store=s,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(o)||!wn.default.eq(o,t))this._set(mg,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Wd)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Wd}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return wn.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&wn.default.satisfies(t,e))return!1;return wn.default.satisfies(r,e)}if(wn.default.lte(e,t))return!1;if(wn.default.gt(e,r))return!1;return!0}_get(e,t){return ib(this.store,e,t)}_set(e,t){let{store:r}=this;Cm(r,e,t),this.store=r}}import{chmodSync as cZ,existsSync as uZ}from"fs";import{randomBytes as yI}from"node:crypto";import{closeSync as H4,linkSync as G4,openSync as K4,readFileSync as J4,renameSync as B4,statSync as W4,unlinkSync as vI,writeSync as Y4}from"node:fs";var SI=30000,X4=8000,Q4=2*SI,eZ=100;function tZ(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function hg(e){try{let t=JSON.parse(J4(e,"utf8"));if(typeof t.pid==="number"&&typeof t.ts==="number"&&typeof t.nonce==="string")return t;return null}catch{return null}}function rZ(e,t,r){if(t)return r-t.ts;try{return r-W4(e).mtimeMs}catch{return}}function oZ(e,t,r){let o=rZ(e,t,r);if(o===void 0)return!1;if(o>SI)return!0;return t!==null&&o>X4&&!tZ(t.pid)}function nZ(e,t){let r=`${e}.stale-${process.pid}-${yI(4).toString("hex")}`;try{B4(e,r)}catch{return}let o=hg(r);if(o&&t&&o.nonce!==t.nonce)try{G4(r,e)}catch{}try{vI(r)}catch{}}function sZ(e,t){let r;try{r=K4(e,"wx",384)}catch(o){if(o.code==="EEXIST")return!1;throw o}try{Y4(r,JSON.stringify(t))}finally{H4(r)}return!0}async function bI(e){let t={pid:process.pid,ts:0,nonce:yI(8).toString("hex")},r=Date.now();for(;;){let o=Date.now();if(t.ts=o,sZ(e,t))return{release:()=>{if(hg(e)?.nonce!==t.nonce)return;try{vI(e)}catch{}}};let n=hg(e);if(oZ(e,n,o)){nZ(e,n);continue}if(o-r>=Q4)return null;await new Promise((s)=>setTimeout(s,eZ))}}var gg=null;function lZ(e){try{if(uZ(e.path))cZ(e.path,384)}catch{}}function ka(){if(!gg){let e=new Yd({projectName:"grove-cli",configFileMode:384,defaults:{currentProfile:"default",profiles:{}}});lZ(e),gg=e}return gg}function vg(e,t){let r=ka(),o=r.get("profiles");o[e]=t,r.set("profiles",o)}function Do(e){return ka().get("profiles")[e]??null}function Xd(){return ka().get("currentProfile")}function EI(){let e=Xd();return Do(e)}var zI="https://grove.iis.tools",$I="No API URL configured. Run: grove auth login (or set GROVE_API_URL)";function PI(e){let{apiUrl:t,token:r,apiKey:o}=e,n=process.env.GROVE_API_URL,s=process.env.GROVE_TOKEN,i=process.env.GROVE_API_KEY,a=o??i;if(a){let d=t??n??wI(e.profile);if(!d)throw new Qe($I,Bt.AUTH);return{apiUrl:d,token:a,authType:"api-key"}}let c=r??s,u=t??n??wI(e.profile);if(c&&u)return{apiUrl:u,token:c,authType:"jwt"};if(c)throw new Qe($I,Bt.AUTH);let l=e.profile?Do(e.profile):EI();if(l){let d=c??l.token??l.apiKey,f=u??l.baseUrl;if(d&&f){let h=l.apiKey&&!c?"api-key":"jwt";return{apiUrl:f,token:d,authType:h}}}throw new Qe("Not authenticated. Run: grove auth login",Bt.AUTH)}function wI(e){return(e?Do(e):EI())?.baseUrl}function Sg(e){return e.accountUrl??process.env.GROVE_ACCOUNT_URL??"https://account.iis.tools"}function dZ(e){let t=Sg(e);return new fn(t,{verbose:e.verbose,timeout:e.timeout?parseInt(e.timeout,10):void 0})}var _g=8000,yg=new Map;function pZ(e){return aZ(iZ(ka().path),`refresh-${encodeURIComponent(e)}.lock`)}function TI(e,t={},r){let o=`${ka().path}\x00${e}`,n=yg.get(o);if(n)return n;let s=gZ(e,t,r).finally(()=>{yg.delete(o)});return yg.set(o,s),s}var fZ=30000;function mZ(e){let t=e.split(".")[1];if(!t)return!1;try{let{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return typeof r==="number"&&r*1000>Date.now()+fZ}catch{return!1}}function RI(e,t){if(t===void 0||!e?.token||!e.refreshToken)return null;if(e.token===t||!mZ(e.token))return null;return{token:e.token,refreshToken:e.refreshToken}}function hZ(e){return e instanceof Qe&&(e.statusCode===400||e.statusCode===401)}async function gZ(e,t,r){let o=RI(Do(e),r);if(o)return o;let n;try{n=await bI(pZ(e))}catch(s){throw new pn(s)}if(!n)throw new pn;try{let s=Do(e);if(!s?.refreshToken)return null;let i=RI(s,r);if(i)return i;let a=t.timeout?parseInt(t.timeout,10):_g,u=await dZ({...t,timeout:String(Math.min(a||_g,_g))}).post("/auth/refresh",{refreshToken:s.refreshToken});return vg(e,{...s,token:u.accessToken,refreshToken:u.refreshToken}),{token:u.accessToken,refreshToken:u.refreshToken}}catch(s){if(hZ(s))return null;throw new pn(s)}finally{n.release()}}import{spawn as _Z}from"node:child_process";import{createHash as yZ,randomBytes as II}from"node:crypto";import{createServer as vZ}from"node:http";function SZ(){return II(32).toString("base64url")}function bZ(e){return yZ("sha256").update(e).digest("base64url")}var $Z="<!doctype html><html><body><h2>Signed in to Grove.</h2><p>You can close this window.</p></body></html>",wZ="<!doctype html><html><body><h2>Sign-in link invalid or expired.</h2><p>Start the sign-in again.</p></body></html>";async function kI(e){let t=SZ(),r=II(16).toString("hex"),o=vZ(),n,s=new Promise((l,d)=>{n={resolve:l,reject:d}});s.catch(()=>{}),o.on("request",(l,d)=>{let f=new URL(l.url??"/","http://localhost");if(l.method!=="GET"||f.pathname!=="/callback"){d.writeHead(404).end();return}let h=f.searchParams.get("code");if(!h||f.searchParams.get("state")!==r){d.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}).end(wZ);return}d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}).end($Z),n?.resolve(h)}),await new Promise((l,d)=>{o.once("error",d),o.listen(0,"127.0.0.1",()=>l())});let{port:i}=o.address(),a=`http://localhost:${i}/callback`,c=new URL(`${e.accountUrl.replace(/\/$/,"")}/auth/cli`);c.searchParams.set("response_type","code"),c.searchParams.set("code_challenge",bZ(t)),c.searchParams.set("code_challenge_method","S256"),c.searchParams.set("redirect_uri",a),c.searchParams.set("state",r),c.searchParams.set("service","Grove");let u=!1;return{authUrl:c.toString(),redirectUri:a,codeVerifier:t,port:i,waitForCode:()=>s,close:()=>{if(u)return;u=!0,n?.reject(Error("login listener closed")),o.closeAllConnections(),o.close()}}}function OI(e,t,r){return new fn(e).post("/auth/token",{code:r,codeVerifier:t.codeVerifier,redirectUri:t.redirectUri})}function CI(e=process.env,t=process.platform){if(e.SSH_CONNECTION||e.SSH_TTY)return!0;return t==="linux"&&!e.DISPLAY&&!e.WAYLAND_DISPLAY}function NI(e,t=process.platform){let[r,o]=t==="darwin"?["open",[e]]:t==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise((n,s)=>{let i=_Z(r,o,{stdio:"ignore"});i.once("error",s),i.once("exit",(a)=>{if(a===0)n();else s(Error(`${r} exited with ${a}`))})})}import{randomUUID as RZ}from"node:crypto";var EZ=300000,zZ=50000,PZ=1e4;class Rn{deps;current;canAutoRefresh;pending=null;live=null;revokedRefreshToken;reloginSpent=!1;closed=!1;constructor(e,t){this.deps=t;this.current=e?.client??null,this.canAutoRefresh=e?.canAutoRefresh??!1}static fixed(e,t){return new Rn({client:e,canAutoRefresh:t})}get canLogin(){return this.deps!==void 0}clientForCall(){if(this.current||!this.deps)return this.current;let e=this.safeBuild();if(!e)return null;if(this.revokedRefreshToken!==void 0&&e.refreshToken===this.revokedRefreshToken)return null;return this.adopt(e),this.live?.abort(),this.current}mayLogin(){if(!this.deps)return!1;if(this.live||this.pending)return!0;return this.revokedRefreshToken===void 0||!this.reloginSpent}markRevoked(e){if(!this.deps||this.current!==e)return;this.current=null,this.canAutoRefresh=!1,this.revokedRefreshToken=this.safeBuild()?.refreshToken??"",this.reloginSpent=!1}close(){this.closed=!0,this.live?.abort()}get loginWaitMs(){return this.deps?.loginWaitMs??zZ}get progressIntervalMs(){return this.deps?.progressIntervalMs??PZ}openBrowser(e){let t=this.deps?.openBrowser,r={failed:!1,failure:new Promise(()=>{})},o=()=>{r.failed=!0};if(!t)r.failed=!0,r.failure=Promise.resolve("open-failed");else r.failure=Promise.resolve().then(()=>t(e.url)).then(()=>new Promise(()=>{}),()=>(o(),"open-failed"));e.browser=r}beginLogin(){if(this.pending)return{pending:this.pending,created:!1};let e=this.deps;if(!e)throw Error("this session has no login");if(this.revokedRefreshToken!==void 0)this.reloginSpent=!0;let t=this.startPending(e);return this.pending=t,t.catch(()=>{if(this.pending===t)this.pending=null}),{pending:t,created:!0}}safeBuild(){try{return this.deps?.build()??null}catch{return null}}adopt(e){this.current=e.client,this.canAutoRefresh=e.canAutoRefresh,this.revokedRefreshToken=void 0,this.reloginSpent=!1}async startPending(e){let t=await e.startLogin(),r=e.ttlMs??EZ,o,n=new Promise((u)=>o=u),s=!1,i=(u)=>{if(s)return;s=!0,clearTimeout(a),t.close(),this.pending=null,this.live=null,o(u)},a=setTimeout(()=>i("expired"),r);a.unref(),t.waitForCode().then(async(u)=>{try{await e.complete(t,u);let l=this.safeBuild();if(!l){i("failed");return}this.adopt(l),i("signed-in")}catch{i("failed")}},()=>{});let c={url:t.authUrl,elicitationId:RZ(),expiresAt:Date.now()+r,elicited:!1,browser:null,done:n,abort:()=>i("aborted")};if(this.live=c,this.closed)c.abort();return c}}var Oa="0.1.1",xI=`grove-mcp/${Oa}`;function AI(){let e=process.env.GROVE_PROFILE,t=e??Xd(),r=Boolean(process.env.GROVE_TOKEN||process.env.GROVE_API_KEY),o=Do(t);if(!r&&!o)return null;let n=PI({profile:e}),s=n.authType==="jwt"&&!!o?.refreshToken;return{client:new fn(n.apiUrl,{apiKey:n.authType==="api-key"?n.token:void 0,token:n.authType==="jwt"?n.token:void 0,userAgent:xI,onUnauthorized:s?(a)=>TI(t,{accountUrl:process.env.GROVE_ACCOUNT_URL},a):void 0}),canAutoRefresh:s,refreshToken:o?.refreshToken}}async function TZ(e){if(CI())throw Error("no browser available in a remote or display-less session");await NI(e)}function jI(e={}){let t=Sg({}),r=process.env.GROVE_PROFILE??Xd();return new Rn(AI(),{build:AI,startLogin:()=>kI({accountUrl:t}),complete:async(o,n)=>{let s=await OI(t,o,n);vg(r,{baseUrl:process.env.GROVE_API_URL??Do(r)?.baseUrl??zI,token:s.accessToken,refreshToken:s.refreshToken})},ttlMs:e.ttlMs,loginWaitMs:e.loginWaitMs,progressIntervalMs:e.progressIntervalMs,openBrowser:e.openBrowser??TZ})}function qI(e){return{content:[{type:"text",text:JSON.stringify(e===null||e===void 0?{ok:!0}:e,null,2)}]}}function MI(e,t=!0){if(!t&&e instanceof Qe&&e.statusCode===401)return{content:[{type:"text",text:"Error: access token expired — set a fresh GROVE_TOKEN, or run `grove auth login` to re-authenticate."}],isError:!0};return{content:[{type:"text",text:`Error: ${e instanceof Error?e.message:String(e)}`}],isError:!0}}function Jr(e,t){let r={};for(let[o,n]of Object.entries(t)){let s=e[o];if(s!==void 0&&s!==null)r[n]=String(s)}return r}var IZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function ft(){return p().refine((e)=>IZ.test(e),{message:"must be a Grove ID (a UUID)"})}var kZ=/^[A-Za-z0-9_-]{1,128}$/;function LI(){return p().refine((e)=>kZ.test(e),{message:"must be an Orchard feed ID (letters, digits, - and _)"})}function lt(e){if(e===""||/^\.+$/.test(e))throw Error(`invalid path segment ${JSON.stringify(e)}`);return encodeURIComponent(e)}var DI={name:"grove_news",description:`List the user's articles ("what's new", "my unread", "what I bookmarked"). Returns summaries; open one with grove_read.`,inputShape:{source:ft().optional().describe("Source ID."),group:ft().optional().describe("Group ID."),isRead:Q().optional().describe("true = read only, false = unread only; omit for both."),engagement:p().optional().describe("like, dislike, bookmark or favorite."),topic:p().optional().describe('Topic name, e.g. "technology".'),sort:fe(["newest","oldest"]).optional().describe("Default newest."),limit:G().int().positive().optional().describe("Max articles (default 50)."),offset:G().int().min(0).optional().describe("Articles to skip (paging).")},annotations:{readOnlyHint:!0},handler:(e,t)=>{let r=Jr(t,{source:"sourceId",group:"groupId",engagement:"engagement",topic:"topic",offset:"offset"});if(t.isRead!==void 0)r.isRead=String(t.isRead);return r.sort=t.sort??"newest",r.limit=String(t.limit??50),e.get("/api/v1/articles",r)}},UI={name:"grove_read",description:'Open one article ("summarize this"). Default: metadata. full:true: the readable body, which also marks it read.',inputShape:{id:ft().describe("Article ID."),full:Q().optional().describe("true = full body (marks the article read).")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0},handler:(e,t)=>{let r=t.id;return e.get(t.full===!0?`/api/v1/articles/${lt(r)}/content`:`/api/v1/articles/${lt(r)}`)}};var bg=/^[A-Za-z0-9_-]{1,32}$/,FI="(?:global|[a-z]{2}(?:-[a-z]{2})?)",OZ=new RegExp(`^${FI}(?:,${FI}){0,19}$`,"i"),CZ=["browse","trailing","history","latest"],VI={name:"grove_charts",description:"What is charting in the stores (apps, games, books, podcasts). facets:true -> valid stores/regions. Else kind: browse -> charts + top entries; trailing -> dropped entries; latest -> a chart's ranked entries; history -> its snapshots (latest/history need sourceId from browse).",inputShape:{kind:fe(CZ).optional().describe("What to fetch; omit with facets."),facets:Q().optional().describe("Return { stores, regions }; kind ignored."),store:p().refine((e)=>bg.test(e),{message:"must be a store name, e.g. apple"}).optional().describe("browse/trailing: store filter."),subtype:p().refine((e)=>bg.test(e),{message:"must be a subtype name, e.g. top-free"}).optional().describe("browse: subtype filter."),medium:p().refine((e)=>bg.test(e),{message:"must be a medium name, e.g. app"}).optional().describe("browse/trailing: medium filter."),region:p().refine((e)=>OZ.test(e),{message:'must be "global" or ISO codes like us or en-us (comma list for browse)'}).optional().describe("browse/trailing: e.g. us; browse takes a comma list."),sourceId:ft().optional().describe("latest/history: source.id from browse.")},annotations:{readOnlyHint:!0},handler:async(e,t)=>{if(t.facets===!0){let[o,n]=await Promise.all([e.get("/api/v1/charts/stores"),e.get("/api/v1/charts/regions")]);return{stores:o,regions:n}}let r=t.kind;switch(r){case"browse":return e.get("/api/v1/charts/browse",Jr(t,{store:"store",medium:"medium",subtype:"subtype",region:"region"}));case"trailing":if(String(t.region??"").includes(","))throw Error("trailing takes a single region; a comma list is for browse");return e.get("/api/v1/charts/trailing",Jr(t,{store:"store",medium:"medium",region:"region"}));case"history":case"latest":{let o=t.sourceId;if(!o)throw Error(`sourceId is required for kind "${r}"`);return e.get(`/api/v1/charts/${lt(o)}/${r==="history"?"snapshots":"latest"}`)}default:throw Error("kind (browse|trailing|history|latest) or facets:true is required")}}};var NZ='Filter by source kind: one of news, blog, video_channel, newsletter, website. Comma-list for multiple values with OR-semantics (e.g. "blog,news"). video_channel is a normal selectable kind here (not just an opt-in seam) — it is hidden by default only on the unfiltered mixed-list view. Orchard migrated its former news kind to website (~132k feeds); news still resolves via a back-compat alias, but website is the current spelling for feeds on unrecognised domains.',xZ=`Filter by coarse category (e.g. "music"). One of Orchard's curated coarse category values, distinct from topics — use grove_discover_facets to fetch the current live list rather than assuming a fixed count. Case-insensitive. Comma-list for multiple values with OR-semantics (e.g. "music,technology").`,AZ='Filter by language (e.g. "en"). Comma-list for multiple values with OR-semantics (e.g. "en,de"). Orchard family-matches a base tag to its regional subtags (en matches en-US). Pass "all" to disable the en,de default applied on trending/browse — search never applies a default.',$g={sourceKind:"sourceKind",category:"category",language:"language",limit:"limit",cursor:"cursor"},ZI={name:"grove_discover",description:'Find feeds to follow ("feeds about X"). query -> search; topic or sort -> browse; neither -> trending. Returns data[] (feedUrl, orchardFeedId) + nextCursor.',inputShape:{query:p().optional().describe("Free-text search; selects search."),topic:p().optional().describe('Topic, e.g. "technology"; selects browse unless query is set.'),sort:fe(["popular","active","new"]).optional().describe("Selects browse; not with query."),sourceKind:p().optional().describe(NZ),category:p().optional().describe(xZ),language:p().optional().describe(AZ),limit:G().int().min(1).max(200).optional().describe("Max results (1-200)."),cursor:p().optional().describe("nextCursor from a prior page.")},annotations:{readOnlyHint:!0},handler:(e,t)=>{let r=t.query;if(r&&t.sort)throw Error("sort is not supported together with query (search has no sort order)");if(r){let o=Jr(t,{...$g,topic:"topic"});return o.q=r,e.get("/api/v1/discover/search",o)}if(t.topic||t.sort)return e.get("/api/v1/discover/browse",Jr(t,{...$g,topic:"topic",sort:"sort"}));return e.get("/api/v1/discover",Jr(t,$g))}},HI={name:"grove_discover_facets",description:"Valid category and language values for grove_discover's filters, with live feed counts. Call before filtering. Returns { categories, languages }.",inputShape:{kind:fe(["categories","languages"]).optional().describe("Only this vocabulary; omit for both.")},annotations:{readOnlyHint:!0},handler:async(e,t)=>{let r=t.kind,[o,n]=await Promise.all([r==="languages"?void 0:e.get("/api/v1/discover/categories"),r==="categories"?void 0:e.get("/api/v1/discover/languages")]);return{...o,...n}}},GI={name:"grove_discover_preview",description:"Preview a catalog feed's recent items (live fetch) before following it. Rate-limited per user.",inputShape:{orchardFeedId:LI().describe("orchardFeedId from grove_discover.")},annotations:{readOnlyHint:!0},handler:(e,t)=>e.get(`/api/v1/discover/${lt(t.orchardFeedId)}/preview`)};var jZ=["like","dislike","bookmark","favorite"],qZ=[...jZ,"read","unread"],KI=100,JI={name:"grove_engage",description:"Like, dislike, bookmark, favorite, or mark read/unread, for one or more articles. Reactions are the user's taste signal: act only on an explicit request. undo:true reverses it.",inputShape:{articleIds:x(ft()).min(1).max(KI).describe(`Article IDs (1-${KI}).`),action:fe(qZ).describe("What to record."),undo:Q().optional().describe("true = reverse it (remove the like, or flip read/unread).")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0},handler:async(e,t)=>{let{articleIds:r,action:o}=t,n=t.undo===!0,s=o==="read"||o==="unread"?o==="read"!==n?"read":"unread":o;if(s==="read"){let u=await e.post("/api/v1/articles/mark-read",{articleIds:r});return{action:s,applied:u?.marked??r.length}}let i=[],a=0,c;for(let u of r)try{if(s==="unread")await e.patch(`/api/v1/articles/${lt(u)}`,{isRead:!1});else{let l=`/api/v1/articles/${lt(u)}/engagements/${lt(s)}`;if(n)await e.delete(l);else await e.put(l)}a+=1}catch(l){c??=l,i.push({articleId:u,error:l instanceof Error?l.message:String(l)})}if(a===0&&c!==void 0)throw c;return i.length>0?{action:s,applied:a,failed:i}:{action:s,applied:a}}};var BI={name:"grove_groups",description:"List the user's groups (folders), or with id one group and its sources.",inputShape:{id:ft().optional().describe("Group ID; omit to list.")},annotations:{readOnlyHint:!0},handler:(e,t)=>{let r=t.id;return e.get(r?`/api/v1/groups/${lt(r)}`:"/api/v1/groups")}},WI={name:"grove_group_edit",description:"Organize groups: create (needs name), add_source / remove_source (need groupId and sourceId). remove_source leaves the subscription.",inputShape:{action:fe(["create","add_source","remove_source"]).describe("create, add_source or remove_source."),name:p().optional().describe("New group name (create)."),groupId:ft().optional().describe("Group ID (add_source, remove_source)."),sourceId:ft().optional().describe("Source ID (add_source, remove_source).")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1},handler:(e,t)=>{let r=t.action;if(r==="create"){if(!t.name)throw Error("action 'create' needs name");return e.post("/api/v1/groups",{name:t.name})}let{groupId:o,sourceId:n}=t;if(!o||!n)throw Error(`action '${r}' needs groupId and sourceId`);return r==="add_source"?e.post(`/api/v1/groups/${lt(o)}/sources`,{sourceId:n}):e.delete(`/api/v1/groups/${lt(o)}/sources/${lt(n)}`)}};var YI={name:"grove_opml",description:"Bulk-move subscriptions via OPML. import (needs xml) and import_url (needs url; rate-limited) subscribe to every feed in it; export returns the user's subscriptions as OPML XML.",inputShape:{action:fe(["import","import_url","export"]).describe("import (inline XML), import_url, or export."),xml:p().optional().describe("OPML document as XML (import)."),url:p().optional().describe("URL of an OPML file (import_url).")},annotations:{readOnlyHint:!1,destructiveHint:!1},handler:(e,t)=>{let r=t.action;if(r==="export")return e.getRaw("/api/v1/opml/export");if(r==="import"){if(!t.xml)throw Error("action 'import' needs xml");return e.post("/api/v1/opml/import",{xml:t.xml})}if(!t.url)throw Error("action 'import_url' needs url");return e.post("/api/v1/opml/import-url",{url:t.url})}};var XI={name:"grove_overview",description:'Account numbers ("how many unread?"): { counts: unread overall/per source/per group, stats: totals }.',inputShape:{},annotations:{readOnlyHint:!0},handler:async(e)=>{let[t,r]=await Promise.all([e.get("/api/v1/counts"),e.get("/api/v1/stats")]);return{counts:t,stats:r}}};var QI={name:"grove_sources",description:"List the user's subscriptions, or with id one source in full. An API-key profile needs an admin API key.",inputShape:{id:ft().optional().describe("Source ID for full detail; omit to list."),group:ft().optional().describe("When listing: only this group ID.")},annotations:{readOnlyHint:!0},handler:(e,t)=>{let r=t.id;return r?e.getSource(r):e.listSources(t.group)}},ek={name:"grove_subscribe",description:'Follow a feed ("add this feed"). url (e.g. feedUrl from grove_discover) registers it; sourceId follows an existing source instead. groupId files it in a group.',inputShape:{url:p().optional().describe("Feed URL (this or sourceId)."),orchardFeedId:p().optional().describe("With url: that feed's orchardFeedId from grove_discover."),sourceId:ft().optional().describe("Existing source ID, instead of url."),name:p().optional().describe("Display name."),groupId:ft().optional().describe("Group ID to file it in.")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0},handler:async(e,t)=>{let{url:r,sourceId:o}=t;if((r?1:0)+(o?1:0)!==1)throw Error("pass exactly one of url or sourceId");let n,s=o;if(r){let a={url:r};if(t.name)a.name=t.name;if(t.orchardFeedId)a.orchardFeedId=t.orchardFeedId;let c=await e.post("/api/v1/sources",a);n=c,s=c?.id}else{let a={sourceId:o};if(t.name)a.displayName=t.name;n=await e.post("/api/v1/sources/subscribe",a)}let i=t.groupId;if(!i)return n;try{if(!s)throw Error("subscribe response carried no source id");return await e.post(`/api/v1/groups/${lt(i)}/sources`,{sourceId:s}),{subscription:n,group:{groupId:i,added:!0}}}catch(a){let c=a instanceof Error?a.message:String(a);return{subscription:n,group:{groupId:i,added:!1,error:c}}}}},tk={name:"grove_unsubscribe",description:"Stop following a feed: deletes the subscription. Only on an explicit request.",inputShape:{id:ft().describe("Source ID.")},annotations:{readOnlyHint:!1,destructiveHint:!0},handler:(e,t)=>e.delete(`/api/v1/sources/${lt(t.id)}`)},rk={name:"grove_refresh",description:"Fetch new articles now: one source (sourceId) or all subscriptions. Rate-limited: an excess call is a no-op, not an error.",inputShape:{sourceId:ft().optional().describe("Source ID; omit for all subscriptions.")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1},handler:(e,t)=>{let r=t.sourceId;return e.post(r?`/api/v1/sources/${lt(r)}/poll`:"/api/v1/sources/refresh")}};var Rg=[DI,UI,XI,QI,BI,ZI,HI,GI,VI,JI,ek,tk,rk,WI],wg={opml:YI};function ok(e){let t=[...Rg];for(let r of(e??"").split(",")){let o=r.trim();if(!o)continue;let n=o.startsWith("+")?o.slice(1):"",s=Object.hasOwn(wg,n)?wg[n]:void 0;if(!s)throw Error(`GROVE_MCP_TOOLS: unknown entry '${o}' (valid: ${Object.keys(wg).map((i)=>`+${i}`).join(", ")})`);if(!t.includes(s))t.push(s)}return t}var MZ="grove-mcp",LZ=Oa,DZ=3600000,UZ=["Grove is the user's personal RSS feed service: their feed subscriptions, the articles polled from them, and their reactions (like, bookmark, read state). Use these tools for anything about their news feeds, reading list or followed sources.","- Read news: grove_news (list), grove_read (open one; full:true for the body), grove_overview (unread counts).","- React to articles: grove_engage (like/dislike/bookmark/favorite/read/unread, undo:true reverses). Reactions are the user's taste signal: only act on an explicit request.","- Find new feeds: grove_discover (query, topic or sort, else trending), grove_discover_facets for valid category/language values, grove_discover_preview before following.","- Store charts (top apps, games, books, podcasts): grove_charts (read-only; facets:true lists the valid stores and regions).","- Manage feeds: grove_sources, grove_subscribe, grove_unsubscribe, grove_refresh, grove_groups, grove_group_edit. grove_unsubscribe, grove_group_edit and grove_subscribe change what the user has set up, and a subscription puts third-party content into every later grove_news: confirm with the user before calling them unless they asked directly."].join(`
66
+ `);function Ca(e){return{content:[{type:"text",text:`Error: ${e}`}],isError:!0}}var sk="If you have the Grove CLI, you can run `grove auth login` instead.";function ep(e){return e.mayLogin()?`Call the tool again for a sign-in link. ${sk}`:"Restart the MCP server (or, if you have the Grove CLI, run `grove auth login`), then call the tool again."}function Qd(e,t){let r=t?`Sign in to Grove in the browser window that opened on the computer running the Grove MCP server, or open ${e.url} there.`:`Sign in to Grove: open ${e.url} in a browser on the computer running the Grove MCP server (the sign-in returns to 127.0.0.1 there; over SSH, forward the port first).`;return Ca(`${r} After signing in, ask again. ${sk}`)}var FZ={expired:"Grove sign-in timed out.",aborted:"Grove sign-in was cancelled.",failed:"Grove sign-in failed: the sign-in code could not be exchanged."};function VZ(e,t){if(t.mcpReq.envelope)return!1;return Boolean(e.server.getClientCapabilities()?.elicitation?.url)}async function ZZ(e,t){let r=Math.max(1,t.expiresAt-Date.now())+5000,o=e.mcpReq.elicitInput({mode:"url",message:"Sign in to Grove",url:t.url,elicitationId:t.elicitationId},{timeout:r}).then((n)=>n.action==="accept"?new Promise(()=>{}):"dismissed",()=>"elicit-failed");return Promise.race([t.done,o])}async function nk(e,t,r,o,n){let s,i,a=new Promise((u)=>{s=setTimeout(()=>u("waiting"),r),s.unref()}),c=t.mcpReq._meta?.progressToken;if(c!==void 0){let u=0;i=setInterval(()=>{u+=1,t.mcpReq.notify({method:"notifications/progress",params:{progressToken:c,progress:u,message:"Waiting for you to sign in to Grove"}}).catch(()=>{})},o),i.unref()}try{return await Promise.race(n?[e.done,a,n]:[e.done,a])}finally{clearTimeout(s),clearInterval(i)}}async function HZ(e,t,r){let o=t.clientForCall();if(o)return o;if(!t.mayLogin())return Ca(`Grove sign-in required. ${ep(t)}`);let n,s;try{let u=t.beginLogin();s=u.created,n=await u.pending}catch(u){let l=u instanceof Error?u.message:String(u);return Ca(`could not start the Grove sign-in (${l}). ${ep(t)}`)}let i=null;if(s&&VZ(e,r)){if(n.elicited=!0,i=await ZZ(r,n),i==="signed-in")try{await e.server.createElicitationCompletionNotifier(n.elicitationId)()}catch{}if(i==="dismissed"||i==="elicit-failed")n.elicited=!1}else if(!s&&n.elicited){if(i=await nk(n,r,t.loginWaitMs,t.progressIntervalMs),i==="waiting")return Qd(n,!1)}if(i===null||i==="dismissed"||i==="elicit-failed"){if(s)t.openBrowser(n);let u=n.browser;if(!u||u.failed)return Qd(n,!1);if(i=await nk(n,r,t.loginWaitMs,t.progressIntervalMs,u.failure),i==="waiting")return Qd(n,!0);if(i==="open-failed")return Qd(n,!1)}let a=t.clientForCall();if(a)return a;let c=FZ[i==="expired"||i==="aborted"?i:"failed"];return Ca(`${c} ${ep(t)}`)}function ik(e,t=!0,r=Rg){let o=e instanceof Rn?e:Rn.fixed(e,t),n=new sa({name:MZ,version:LZ},{instructions:UZ,cacheHints:{"tools/list":{ttlMs:DZ,cacheScope:"public"}}});for(let s of r)n.registerTool(s.name,{description:s.description,annotations:s.annotations,inputSchema:T(s.inputShape)},async(i,a)=>{let c=await HZ(n,o,a);if("content"in c)return c;let u=o.canAutoRefresh;try{let l=await s.handler(c,i);return qI(l)}catch(l){if(u&&o.canLogin&&l instanceof Qe&&l.statusCode===401)return o.markRevoked(c),Ca(`the Grove session ended (sign-in revoked or expired). ${ep(o)}`);return MI(l,u)}});return n}if(process.argv[2]==="--describe")process.stdout.write(`Grove MCP server — attach Grove (RSS feeds) to an LLM/agent: read news, manage feeds, engage, discover sources
67
+ `),process.exit(0);if(process.argv[2]==="--schema")process.exit(0);if(process.argv[2]==="--version"||process.argv[2]==="-v")process.stdout.write(`${Oa}
68
+ `),process.exit(0);async function GZ(){let e=jI(),t=ok(process.env.GROVE_MCP_TOOLS);ob(()=>ik(e,!0,t),{legacy:"serve",onerror:(r)=>{process.stderr.write(`grove-mcp transport error: ${r.message}
69
+ `)}}),process.stdin.once("end",()=>e.close()),process.stdin.once("close",()=>e.close()),process.stderr.write(`grove-mcp server connected (stdio)
70
+ `)}GZ().catch((e)=>{let t=e instanceof Error?e.message:String(e);process.stderr.write(`grove-mcp failed to start: ${t}
71
+ `),process.exit(1)});