@visuallyjs/browser-ui-svelte-mcp 1.1.0

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/index.js ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
+ var Rv=Object.create;var Is=Object.defineProperty;var Nv=Object.getOwnPropertyDescriptor;var jv=Object.getOwnPropertyNames;var Dv=Object.getPrototypeOf,Mv=Object.prototype.hasOwnProperty;var Tn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),As=(e,t)=>{for(var r in t)Is(e,r,{get:t[r],enumerable:!0})},Zv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jv(t))!Mv.call(e,o)&&o!==r&&Is(e,o,{get:()=>t[o],enumerable:!(n=Nv(t,o))||n.enumerable});return e};var Os=(e,t,r)=>(r=e!=null?Rv(Dv(e)):{},Zv(t||!e||!e.__esModule?Is(r,"default",{value:e,enumerable:!0}):r,e));var io=v(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.regexpCode=G.getEsmExportName=G.getProperty=G.safeStringify=G.stringify=G.strConcat=G.addCodeArg=G.str=G._=G.nil=G._Code=G.Name=G.IDENTIFIER=G._CodeOrName=void 0;var no=class{};G._CodeOrName=no;G.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var gr=class extends no{constructor(t){if(super(),!G.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};G.Name=gr;var Qe=class extends no{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof gr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};G._Code=Qe;G.nil=new Qe("");function Bp(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Ha(r,t[n]),r.push(e[++n]);return new Qe(r)}G._=Bp;var Ua=new Qe("+");function Kp(e,...t){let r=[oo(e[0])],n=0;for(;n<t.length;)r.push(Ua),Ha(r,t[n]),r.push(Ua,oo(e[++n]));return n$(r),new Qe(r)}G.str=Kp;function Ha(e,t){t instanceof Qe?e.push(...t._items):t instanceof gr?e.push(t):e.push(s$(t))}G.addCodeArg=Ha;function n$(e){let t=1;for(;t<e.length-1;){if(e[t]===Ua){let r=o$(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function o$(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof gr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof gr))return`"${e}${t.slice(1)}`}function i$(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kp`${e}${t}`}G.strConcat=i$;function s$(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function a$(e){return new Qe(oo(e))}G.stringify=a$;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}G.safeStringify=oo;function c$(e){return typeof e=="string"&&G.IDENTIFIER.test(e)?new Qe(`.${e}`):Bp`[${e}]`}G.getProperty=c$;function u$(e){if(typeof e=="string"&&G.IDENTIFIER.test(e))return new Qe(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}G.getEsmExportName=u$;function l$(e){return new Qe(e.toString())}G.regexpCode=l$});var Ja=v(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.ValueScope=Fe.ValueScopeName=Fe.Scope=Fe.varKinds=Fe.UsedValueState=void 0;var qe=io(),Ba=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},zi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(zi||(Fe.UsedValueState=zi={}));Fe.varKinds={const:new qe.Name("const"),let:new qe.Name("let"),var:new qe.Name("var")};var Ei=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof qe.Name?t:this.name(t)}name(t){return new qe.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Fe.Scope=Ei;var Ti=class extends qe.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,qe._)`.${new qe.Name(r)}[${n}]`}};Fe.ValueScopeName=Ti;var d$=(0,qe._)`\n`,Ka=class extends Ei{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?d$:qe.nil}}get(){return this._scope}name(t){return new Ti(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let l=a.get(s);if(l)return l}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,qe._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=qe.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,zi.Started);let l=r(u);if(l){let d=this.opts.es5?Fe.varKinds.var:Fe.varKinds.const;i=(0,qe._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))i=(0,qe._)`${i}${l}${this.opts._n}`;else throw new Ba(u);c.set(u,zi.Completed)})}return i}};Fe.ValueScope=Ka});var F=v(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.or=L.and=L.not=L.CodeGen=L.operators=L.varKinds=L.ValueScopeName=L.ValueScope=L.Scope=L.Name=L.regexpCode=L.stringify=L.getProperty=L.nil=L.strConcat=L.str=L._=void 0;var K=io(),ot=Ja(),Ft=io();Object.defineProperty(L,"_",{enumerable:!0,get:function(){return Ft._}});Object.defineProperty(L,"str",{enumerable:!0,get:function(){return Ft.str}});Object.defineProperty(L,"strConcat",{enumerable:!0,get:function(){return Ft.strConcat}});Object.defineProperty(L,"nil",{enumerable:!0,get:function(){return Ft.nil}});Object.defineProperty(L,"getProperty",{enumerable:!0,get:function(){return Ft.getProperty}});Object.defineProperty(L,"stringify",{enumerable:!0,get:function(){return Ft.stringify}});Object.defineProperty(L,"regexpCode",{enumerable:!0,get:function(){return Ft.regexpCode}});Object.defineProperty(L,"Name",{enumerable:!0,get:function(){return Ft.Name}});var Oi=Ja();Object.defineProperty(L,"Scope",{enumerable:!0,get:function(){return Oi.Scope}});Object.defineProperty(L,"ValueScope",{enumerable:!0,get:function(){return Oi.ValueScope}});Object.defineProperty(L,"ValueScopeName",{enumerable:!0,get:function(){return Oi.ValueScopeName}});Object.defineProperty(L,"varKinds",{enumerable:!0,get:function(){return Oi.varKinds}});L.operators={GT:new K._Code(">"),GTE:new K._Code(">="),LT:new K._Code("<"),LTE:new K._Code("<="),EQ:new K._Code("==="),NEQ:new K._Code("!=="),NOT:new K._Code("!"),OR:new K._Code("||"),AND:new K._Code("&&"),ADD:new K._Code("+")};var Et=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Wa=class extends Et{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ot.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Qr(this.rhs,t,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Pi=class extends Et{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof K.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Qr(this.rhs,t,r),this}get names(){let t=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Ai(t,this.rhs)}},Ga=class extends Pi{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Ya=class extends Et{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Qa=class extends Et{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Xa=class extends Et{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},ec=class extends Et{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Qr(this.code,t,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},so=class extends Et{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(f$(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>vr(t,r.names),{})}},Tt=class extends so{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},tc=class extends so{},Yr=class extends Tt{};Yr.kind="else";var _r=class e extends Tt{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Yr(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Jp(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Qr(this.condition,t,r),this}get names(){let t=super.names;return Ai(t,this.condition),this.else&&vr(t,this.else.names),t}};_r.kind="if";var yr=class extends Tt{};yr.kind="for";var rc=class extends yr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Qr(this.iteration,t,r),this}get names(){return vr(super.names,this.iteration.names)}},nc=class extends yr{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?ot.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Ai(super.names,this.from);return Ai(t,this.to)}},Ii=class extends yr{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Qr(this.iterable,t,r),this}get names(){return vr(super.names,this.iterable.names)}},ao=class extends Tt{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};ao.kind="func";var co=class extends so{render(t){return"return "+super.render(t)}};co.kind="return";var oc=class extends Tt{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&vr(t,this.catch.names),this.finally&&vr(t,this.finally.names),t}},uo=class extends Tt{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};uo.kind="catch";var lo=class extends Tt{render(t){return"finally"+super.render(t)}};lo.kind="finally";var ic=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
4
+ `:""},this._extScope=t,this._scope=new ot.Scope({parent:t}),this._nodes=[new tc]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new Wa(t,i,n)),i}const(t,r,n){return this._def(ot.varKinds.const,t,r,n)}let(t,r,n){return this._def(ot.varKinds.let,t,r,n)}var(t,r,n){return this._def(ot.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Pi(t,r,n))}add(t,r){return this._leafNode(new Ga(t,L.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==K.nil&&this._leafNode(new ec(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,K.addCodeArg)(r,o));return r.push("}"),new K._Code(r)}if(t,r,n){if(this._blockNode(new _r(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new _r(t))}else(){return this._elseNode(new Yr)}endIf(){return this._endBlockNode(_r,Yr)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new rc(t),r)}forRange(t,r,n,o,i=this.opts.es5?ot.varKinds.var:ot.varKinds.let){let s=this._scope.toName(t);return this._for(new nc(i,s,r,n),()=>o(s))}forOf(t,r,n,o=ot.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof K.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,K._)`${s}.length`,a=>{this.var(i,(0,K._)`${s}[${a}]`),n(i)})}return this._for(new Ii("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?ot.varKinds.var:ot.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,K._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Ii("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(yr)}label(t){return this._leafNode(new Ya(t))}break(t){return this._leafNode(new Qa(t))}return(t){let r=new co;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(co)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new oc;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new uo(i),r(i)}return n&&(this._currNode=o.finally=new lo,this.code(n)),this._endBlockNode(uo,lo)}throw(t){return this._leafNode(new Xa(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=K.nil,n,o){return this._blockNode(new ao(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ao)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof _r))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};L.CodeGen=ic;function vr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ai(e,t){return t instanceof K._CodeOrName?vr(e,t.names):e}function Qr(e,t,r){if(e instanceof K.Name)return n(e);if(!o(e))return e;return new K._Code(e._items.reduce((i,s)=>(s instanceof K.Name&&(s=n(s)),s instanceof K._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof K._Code&&i._items.some(s=>s instanceof K.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function f$(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Jp(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,K._)`!${sc(e)}`}L.not=Jp;var p$=Wp(L.operators.AND);function m$(...e){return e.reduce(p$)}L.and=m$;var h$=Wp(L.operators.OR);function g$(...e){return e.reduce(h$)}L.or=g$;function Wp(e){return(t,r)=>t===K.nil?r:r===K.nil?t:(0,K._)`${sc(t)} ${e} ${sc(r)}`}function sc(e){return e instanceof K.Name?e:(0,K._)`(${e})`}});var J=v(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.checkStrictMode=V.getErrorPath=V.Type=V.useFunc=V.setEvaluated=V.evaluatedPropsToName=V.mergeEvaluated=V.eachItem=V.unescapeJsonPointer=V.escapeJsonPointer=V.escapeFragment=V.unescapeFragment=V.schemaRefOrVal=V.schemaHasRulesButRef=V.schemaHasRules=V.checkUnknownRules=V.alwaysValidSchema=V.toHash=void 0;var ee=F(),_$=io();function y$(e){let t={};for(let r of e)t[r]=!0;return t}V.toHash=y$;function v$(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Qp(e,t),!Xp(t,e.self.RULES.all))}V.alwaysValidSchema=v$;function Qp(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||rm(e,`unknown keyword: "${i}"`)}V.checkUnknownRules=Qp;function Xp(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}V.schemaHasRules=Xp;function x$(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}V.schemaHasRulesButRef=x$;function b$({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ee._)`${r}`}return(0,ee._)`${e}${t}${(0,ee.getProperty)(n)}`}V.schemaRefOrVal=b$;function w$(e){return em(decodeURIComponent(e))}V.unescapeFragment=w$;function $$(e){return encodeURIComponent(cc(e))}V.escapeFragment=$$;function cc(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}V.escapeJsonPointer=cc;function em(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}V.unescapeJsonPointer=em;function k$(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}V.eachItem=k$;function Gp({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof ee.Name?(i instanceof ee.Name?e(o,i,s):t(o,i,s),s):i instanceof ee.Name?(t(o,s,i),i):r(i,s);return a===ee.Name&&!(c instanceof ee.Name)?n(o,c):c}}V.mergeEvaluated={props:Gp({mergeNames:(e,t,r)=>e.if((0,ee._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ee._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ee._)`${r} || {}`).code((0,ee._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ee._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ee._)`${r} || {}`),uc(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:tm}),items:Gp({mergeNames:(e,t,r)=>e.if((0,ee._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ee._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ee._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ee._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function tm(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ee._)`{}`);return t!==void 0&&uc(e,r,t),r}V.evaluatedPropsToName=tm;function uc(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ee._)`${t}${(0,ee.getProperty)(n)}`,!0))}V.setEvaluated=uc;var Yp={};function S$(e,t){return e.scopeValue("func",{ref:t,code:Yp[t.code]||(Yp[t.code]=new _$._Code(t.code))})}V.useFunc=S$;var ac;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ac||(V.Type=ac={}));function z$(e,t,r){if(e instanceof ee.Name){let n=t===ac.Num;return r?n?(0,ee._)`"[" + ${e} + "]"`:(0,ee._)`"['" + ${e} + "']"`:n?(0,ee._)`"/" + ${e}`:(0,ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ee.getProperty)(e).toString():"/"+cc(e)}V.getErrorPath=z$;function rm(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}V.checkStrictMode=rm});var Pt=v(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});var Te=F(),E$={data:new Te.Name("data"),valCxt:new Te.Name("valCxt"),instancePath:new Te.Name("instancePath"),parentData:new Te.Name("parentData"),parentDataProperty:new Te.Name("parentDataProperty"),rootData:new Te.Name("rootData"),dynamicAnchors:new Te.Name("dynamicAnchors"),vErrors:new Te.Name("vErrors"),errors:new Te.Name("errors"),this:new Te.Name("this"),self:new Te.Name("self"),scope:new Te.Name("scope"),json:new Te.Name("json"),jsonPos:new Te.Name("jsonPos"),jsonLen:new Te.Name("jsonLen"),jsonPart:new Te.Name("jsonPart")};lc.default=E$});var fo=v(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.extendErrors=Pe.resetErrorsCount=Pe.reportExtraError=Pe.reportError=Pe.keyword$DataError=Pe.keywordError=void 0;var W=F(),Ci=J(),Re=Pt();Pe.keywordError={message:({keyword:e})=>(0,W.str)`must pass "${e}" keyword validation`};Pe.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,W.str)`"${e}" keyword must be ${t} ($data)`:(0,W.str)`"${e}" keyword is invalid ($data)`};function T$(e,t=Pe.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=im(e,t,r);n??(s||a)?nm(i,c):om(o,(0,W._)`[${c}]`)}Pe.reportError=T$;function P$(e,t=Pe.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=im(e,t,r);nm(o,a),i||s||om(n,Re.default.vErrors)}Pe.reportExtraError=P$;function I$(e,t){e.assign(Re.default.errors,t),e.if((0,W._)`${Re.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,W._)`${Re.default.vErrors}.length`,t),()=>e.assign(Re.default.vErrors,null)))}Pe.resetErrorsCount=I$;function A$({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,Re.default.errors,a=>{e.const(s,(0,W._)`${Re.default.vErrors}[${a}]`),e.if((0,W._)`${s}.instancePath === undefined`,()=>e.assign((0,W._)`${s}.instancePath`,(0,W.strConcat)(Re.default.instancePath,i.errorPath))),e.assign((0,W._)`${s}.schemaPath`,(0,W.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,W._)`${s}.schema`,r),e.assign((0,W._)`${s}.data`,n))})}Pe.extendErrors=A$;function nm(e,t){let r=e.const("err",t);e.if((0,W._)`${Re.default.vErrors} === null`,()=>e.assign(Re.default.vErrors,(0,W._)`[${r}]`),(0,W._)`${Re.default.vErrors}.push(${r})`),e.code((0,W._)`${Re.default.errors}++`)}function om(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,W._)`new ${e.ValidationError}(${t})`):(r.assign((0,W._)`${n}.errors`,t),r.return(!1))}var xr={keyword:new W.Name("keyword"),schemaPath:new W.Name("schemaPath"),params:new W.Name("params"),propertyName:new W.Name("propertyName"),message:new W.Name("message"),schema:new W.Name("schema"),parentSchema:new W.Name("parentSchema")};function im(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,W._)`{}`:O$(e,t,r)}function O$(e,t,r={}){let{gen:n,it:o}=e,i=[C$(o,r),R$(e,r)];return N$(e,t,i),n.object(...i)}function C$({errorPath:e},{instancePath:t}){let r=t?(0,W.str)`${e}${(0,Ci.getErrorPath)(t,Ci.Type.Str)}`:e;return[Re.default.instancePath,(0,W.strConcat)(Re.default.instancePath,r)]}function R$({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,W.str)`${t}/${e}`;return r&&(o=(0,W.str)`${o}${(0,Ci.getErrorPath)(r,Ci.Type.Str)}`),[xr.schemaPath,o]}function N$(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([xr.keyword,o],[xr.params,typeof t=="function"?t(e):t||(0,W._)`{}`]),c.messages&&n.push([xr.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([xr.schema,s],[xr.parentSchema,(0,W._)`${l}${d}`],[Re.default.data,i]),u&&n.push([xr.propertyName,u])}});var am=v(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.boolOrEmptySchema=Xr.topBoolOrEmptySchema=void 0;var j$=fo(),D$=F(),M$=Pt(),Z$={message:"boolean schema is false"};function q$(e){let{gen:t,schema:r,validateName:n}=e;r===!1?sm(e,!1):typeof r=="object"&&r.$async===!0?t.return(M$.default.data):(t.assign((0,D$._)`${n}.errors`,null),t.return(!0))}Xr.topBoolOrEmptySchema=q$;function F$(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),sm(e)):r.var(t,!0)}Xr.boolOrEmptySchema=F$;function sm(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,j$.reportError)(o,Z$,void 0,t)}});var dc=v(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.getRules=en.isJSONType=void 0;var L$=["string","number","integer","boolean","null","object","array"],V$=new Set(L$);function U$(e){return typeof e=="string"&&V$.has(e)}en.isJSONType=U$;function H$(){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:{}}}en.getRules=H$});var fc=v(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.shouldUseRule=Lt.shouldUseGroup=Lt.schemaHasRulesForType=void 0;function B$({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&cm(e,n)}Lt.schemaHasRulesForType=B$;function cm(e,t){return t.rules.some(r=>um(e,r))}Lt.shouldUseGroup=cm;function um(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Lt.shouldUseRule=um});var po=v(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.reportTypeError=Ie.checkDataTypes=Ie.checkDataType=Ie.coerceAndCheckDataType=Ie.getJSONTypes=Ie.getSchemaTypes=Ie.DataType=void 0;var K$=dc(),J$=fc(),W$=fo(),Z=F(),lm=J(),tn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(tn||(Ie.DataType=tn={}));function G$(e){let t=dm(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ie.getSchemaTypes=G$;function dm(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(K$.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ie.getJSONTypes=dm;function Y$(e,t){let{gen:r,data:n,opts:o}=e,i=Q$(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,J$.schemaHasRulesForType)(e,t[0]));if(s){let a=mc(t,n,o.strictNumbers,tn.Wrong);r.if(a,()=>{i.length?X$(e,t,i):hc(e)})}return s}Ie.coerceAndCheckDataType=Y$;var fm=new Set(["string","number","integer","boolean","null"]);function Q$(e,t){return t?e.filter(r=>fm.has(r)||t==="array"&&r==="array"):[]}function X$(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,Z._)`typeof ${o}`),a=n.let("coerced",(0,Z._)`undefined`);i.coerceTypes==="array"&&n.if((0,Z._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,Z._)`${o}[0]`).assign(s,(0,Z._)`typeof ${o}`).if(mc(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,Z._)`${a} !== undefined`);for(let u of r)(fm.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),hc(e),n.endIf(),n.if((0,Z._)`${a} !== undefined`,()=>{n.assign(o,a),ek(e,a)});function c(u){switch(u){case"string":n.elseIf((0,Z._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Z._)`"" + ${o}`).elseIf((0,Z._)`${o} === null`).assign(a,(0,Z._)`""`);return;case"number":n.elseIf((0,Z._)`${s} == "boolean" || ${o} === null
5
+ || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,Z._)`+${o}`);return;case"integer":n.elseIf((0,Z._)`${s} === "boolean" || ${o} === null
6
+ || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,Z._)`+${o}`);return;case"boolean":n.elseIf((0,Z._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,Z._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Z._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Z._)`${s} === "string" || ${s} === "number"
7
+ || ${s} === "boolean" || ${o} === null`).assign(a,(0,Z._)`[${o}]`)}}}function ek({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Z._)`${t} !== undefined`,()=>e.assign((0,Z._)`${t}[${r}]`,n))}function pc(e,t,r,n=tn.Correct){let o=n===tn.Correct?Z.operators.EQ:Z.operators.NEQ,i;switch(e){case"null":return(0,Z._)`${t} ${o} null`;case"array":i=(0,Z._)`Array.isArray(${t})`;break;case"object":i=(0,Z._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,Z._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,Z._)`typeof ${t} ${o} ${e}`}return n===tn.Correct?i:(0,Z.not)(i);function s(a=Z.nil){return(0,Z.and)((0,Z._)`typeof ${t} == "number"`,a,r?(0,Z._)`isFinite(${t})`:Z.nil)}}Ie.checkDataType=pc;function mc(e,t,r,n){if(e.length===1)return pc(e[0],t,r,n);let o,i=(0,lm.toHash)(e);if(i.array&&i.object){let s=(0,Z._)`typeof ${t} != "object"`;o=i.null?s:(0,Z._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=Z.nil;i.number&&delete i.integer;for(let s in i)o=(0,Z.and)(o,pc(s,t,r,n));return o}Ie.checkDataTypes=mc;var tk={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Z._)`{type: ${e}}`:(0,Z._)`{type: ${t}}`};function hc(e){let t=rk(e);(0,W$.reportError)(t,tk)}Ie.reportTypeError=hc;function rk(e){let{gen:t,data:r,schema:n}=e,o=(0,lm.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var mm=v(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.assignDefaults=void 0;var rn=F(),nk=J();function ok(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)pm(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>pm(e,i,o.default))}Ri.assignDefaults=ok;function pm(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,rn._)`${i}${(0,rn.getProperty)(t)}`;if(o){(0,nk.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,rn._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,rn._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,rn._)`${a} = ${(0,rn.stringify)(r)}`)}});var Xe=v(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var se=F(),gc=J(),Vt=Pt(),ik=J();function sk(e,t){let{gen:r,data:n,it:o}=e;r.if(yc(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,se._)`${t}`},!0),e.error()})}X.checkReportMissingProp=sk;function ak({gen:e,data:t,it:{opts:r}},n,o){return(0,se.or)(...n.map(i=>(0,se.and)(yc(e,t,i,r.ownProperties),(0,se._)`${o} = ${i}`)))}X.checkMissingProp=ak;function ck(e,t){e.setParams({missingProperty:t},!0),e.error()}X.reportMissingProp=ck;function hm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,se._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=hm;function _c(e,t,r){return(0,se._)`${hm(e)}.call(${t}, ${r})`}X.isOwnProperty=_c;function uk(e,t,r,n){let o=(0,se._)`${t}${(0,se.getProperty)(r)} !== undefined`;return n?(0,se._)`${o} && ${_c(e,t,r)}`:o}X.propertyInData=uk;function yc(e,t,r,n){let o=(0,se._)`${t}${(0,se.getProperty)(r)} === undefined`;return n?(0,se.or)(o,(0,se.not)(_c(e,t,r))):o}X.noPropertyInData=yc;function gm(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}X.allSchemaProperties=gm;function lk(e,t){return gm(t).filter(r=>!(0,gc.alwaysValidSchema)(e,t[r]))}X.schemaProperties=lk;function dk({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let l=u?(0,se._)`${e}, ${t}, ${n}${o}`:t,d=[[Vt.default.instancePath,(0,se.strConcat)(Vt.default.instancePath,i)],[Vt.default.parentData,s.parentData],[Vt.default.parentDataProperty,s.parentDataProperty],[Vt.default.rootData,Vt.default.rootData]];s.opts.dynamicRef&&d.push([Vt.default.dynamicAnchors,Vt.default.dynamicAnchors]);let f=(0,se._)`${l}, ${r.object(...d)}`;return c!==se.nil?(0,se._)`${a}.call(${c}, ${f})`:(0,se._)`${a}(${f})`}X.callValidateCode=dk;var fk=(0,se._)`new RegExp`;function pk({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,se._)`${o.code==="new RegExp"?fk:(0,ik.useFunc)(e,o)}(${r}, ${n})`})}X.usePattern=pk;function mk(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,se._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:gc.Type.Num},i),t.if((0,se.not)(i),a)})}}X.validateArray=mk;function hk(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,gc.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,se._)`${s} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,se.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}X.validateUnion=hk});var vm=v(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.validateKeywordUsage=ht.validSchemaType=ht.funcKeywordCode=ht.macroKeywordCode=void 0;var Ne=F(),br=Pt(),gk=Xe(),_k=fo();function yk(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=ym(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:Ne.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}ht.macroKeywordCode=yk;function vk(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;bk(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,l=ym(n,o,u),d=n.let("valid");e.block$data(d,f),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function f(){if(t.errors===!1)h(),t.modifying&&_m(e),g(()=>e.error());else{let x=t.async?p():m();t.modifying&&_m(e),g(()=>xk(e,x))}}function p(){let x=n.let("ruleErrs",null);return n.try(()=>h((0,Ne._)`await `),w=>n.assign(d,!1).if((0,Ne._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(x,(0,Ne._)`${w}.errors`),()=>n.throw(w))),x}function m(){let x=(0,Ne._)`${l}.errors`;return n.assign(x,null),h(Ne.nil),x}function h(x=t.async?(0,Ne._)`await `:Ne.nil){let w=c.opts.passContext?br.default.this:br.default.self,$=!("compile"in t&&!a||t.schema===!1);n.assign(d,(0,Ne._)`${x}${(0,gk.callValidateCode)(e,l,w,$)}`,t.modifying)}function g(x){var w;n.if((0,Ne.not)((w=t.valid)!==null&&w!==void 0?w:d),x)}}ht.funcKeywordCode=vk;function _m(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ne._)`${n.parentData}[${n.parentDataProperty}]`))}function xk(e,t){let{gen:r}=e;r.if((0,Ne._)`Array.isArray(${t})`,()=>{r.assign(br.default.vErrors,(0,Ne._)`${br.default.vErrors} === null ? ${t} : ${br.default.vErrors}.concat(${t})`).assign(br.default.errors,(0,Ne._)`${br.default.vErrors}.length`),(0,_k.extendErrors)(e)},()=>e.error())}function bk({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ym(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ne.stringify)(r)})}function wk(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}ht.validSchemaType=wk;function $k({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ht.validateKeywordUsage=$k});var bm=v(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.extendSubschemaMode=Ut.extendSubschemaData=Ut.getSubschema=void 0;var gt=F(),xm=J();function kk(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new 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:(0,gt._)`${e.schemaPath}${(0,gt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,gt._)`${e.schemaPath}${(0,gt.getProperty)(t)}${(0,gt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,xm.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ut.getSubschema=kk;function Sk(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new 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",(0,gt._)`${t.data}${(0,gt.getProperty)(r)}`,!0);c(f),e.errorPath=(0,gt.str)`${u}${(0,xm.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,gt._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let u=o instanceof gt.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);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]}}Ut.extendSubschemaData=Sk;function zk(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ut.extendSubschemaMode=zk});var vc=v((eM,wm)=>{"use strict";wm.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var km=v((tM,$m)=>{"use strict";var Ht=$m.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Ni(t,n,o,e,"",e)};Ht.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ht.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ht.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ht.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 Ni(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Ht.arrayKeywords)for(var f=0;f<d.length;f++)Ni(e,t,r,d[f],o+"/"+l+"/"+f,i,o,l,n,f)}else if(l in Ht.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ni(e,t,r,d[p],o+"/"+l+"/"+Ek(p),i,o,l,n,p)}else(l in Ht.keywords||e.allKeys&&!(l in Ht.skipKeywords))&&Ni(e,t,r,d,o+"/"+l,i,o,l,n)}r(n,o,i,s,a,c,u)}}function Ek(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var mo=v(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.getSchemaRefs=Le.resolveUrl=Le.normalizeId=Le._getFullPath=Le.getFullPath=Le.inlineRef=void 0;var Tk=J(),Pk=vc(),Ik=km(),Ak=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ok(e,t=!0){return typeof e=="boolean"?!0:t===!0?!xc(e):t?Sm(e)<=t:!1}Le.inlineRef=Ok;var Ck=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function xc(e){for(let t in e){if(Ck.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(xc)||typeof r=="object"&&xc(r))return!0}return!1}function Sm(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Ak.has(r)&&(typeof e[r]=="object"&&(0,Tk.eachItem)(e[r],n=>t+=Sm(n)),t===1/0))return 1/0}return t}function zm(e,t="",r){r!==!1&&(t=nn(t));let n=e.parse(t);return Em(e,n)}Le.getFullPath=zm;function Em(e,t){return e.serialize(t).split("#")[0]+"#"}Le._getFullPath=Em;var Rk=/#\/?$/;function nn(e){return e?e.replace(Rk,""):""}Le.normalizeId=nn;function Nk(e,t,r){return r=nn(r),e.resolve(t,r)}Le.resolveUrl=Nk;var jk=/^[a-z_][-a-z0-9._]*$/i;function Dk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=nn(e[r]||t),i={"":o},s=zm(n,o,!1),a={},c=new Set;return Ik(e,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,g=i[m];typeof d[r]=="string"&&(g=x.call(this,d[r])),w.call(this,d.$anchor),w.call(this,d.$dynamicAnchor),i[f]=g;function x($){let I=this.opts.uriResolver.resolve;if($=nn(g?I(g,$):$),c.has($))throw l($);c.add($);let A=this.refs[$];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?u(d,A.schema,$):$!==nn(h)&&($[0]==="#"?(u(d,a[$],$),a[$]=d):this.refs[$]=h),$}function w($){if(typeof $=="string"){if(!jk.test($))throw new Error(`invalid anchor "${$}"`);x.call(this,`#${$}`)}}}),a;function u(d,f,p){if(f!==void 0&&!Pk(d,f))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Le.getSchemaRefs=Dk});var _o=v(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getData=Bt.KeywordCxt=Bt.validateFunctionCode=void 0;var Om=am(),Tm=po(),wc=fc(),ji=po(),Mk=mm(),go=vm(),bc=bm(),P=F(),j=Pt(),Zk=mo(),It=J(),ho=fo();function qk(e){if(Nm(e)&&(jm(e),Rm(e))){Vk(e);return}Cm(e,()=>(0,Om.topBoolOrEmptySchema)(e))}Bt.validateFunctionCode=qk;function Cm({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,P._)`${j.default.data}, ${j.default.valCxt}`,n.$async,()=>{e.code((0,P._)`"use strict"; ${Pm(r,o)}`),Lk(e,o),e.code(i)}):e.func(t,(0,P._)`${j.default.data}, ${Fk(o)}`,n.$async,()=>e.code(Pm(r,o)).code(i))}function Fk(e){return(0,P._)`{${j.default.instancePath}="", ${j.default.parentData}, ${j.default.parentDataProperty}, ${j.default.rootData}=${j.default.data}${e.dynamicRef?(0,P._)`, ${j.default.dynamicAnchors}={}`:P.nil}}={}`}function Lk(e,t){e.if(j.default.valCxt,()=>{e.var(j.default.instancePath,(0,P._)`${j.default.valCxt}.${j.default.instancePath}`),e.var(j.default.parentData,(0,P._)`${j.default.valCxt}.${j.default.parentData}`),e.var(j.default.parentDataProperty,(0,P._)`${j.default.valCxt}.${j.default.parentDataProperty}`),e.var(j.default.rootData,(0,P._)`${j.default.valCxt}.${j.default.rootData}`),t.dynamicRef&&e.var(j.default.dynamicAnchors,(0,P._)`${j.default.valCxt}.${j.default.dynamicAnchors}`)},()=>{e.var(j.default.instancePath,(0,P._)`""`),e.var(j.default.parentData,(0,P._)`undefined`),e.var(j.default.parentDataProperty,(0,P._)`undefined`),e.var(j.default.rootData,j.default.data),t.dynamicRef&&e.var(j.default.dynamicAnchors,(0,P._)`{}`)})}function Vk(e){let{schema:t,opts:r,gen:n}=e;Cm(e,()=>{r.$comment&&t.$comment&&Mm(e),Jk(e),n.let(j.default.vErrors,null),n.let(j.default.errors,0),r.unevaluated&&Uk(e),Dm(e),Yk(e)})}function Uk(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,P._)`${r}.evaluated`),t.if((0,P._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,P._)`${e.evaluated}.props`,(0,P._)`undefined`)),t.if((0,P._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,P._)`${e.evaluated}.items`,(0,P._)`undefined`))}function Pm(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,P._)`/*# sourceURL=${r} */`:P.nil}function Hk(e,t){if(Nm(e)&&(jm(e),Rm(e))){Bk(e,t);return}(0,Om.boolOrEmptySchema)(e,t)}function Rm({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 Nm(e){return typeof e.schema!="boolean"}function Bk(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&Mm(e),Wk(e),Gk(e);let i=n.const("_errs",j.default.errors);Dm(e,i),n.var(t,(0,P._)`${i} === ${j.default.errors}`)}function jm(e){(0,It.checkUnknownRules)(e),Kk(e)}function Dm(e,t){if(e.opts.jtd)return Im(e,[],!1,t);let r=(0,Tm.getSchemaTypes)(e.schema),n=(0,Tm.coerceAndCheckDataType)(e,r);Im(e,r,!n,t)}function Kk(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,It.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Jk(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,It.checkStrictMode)(e,"default is ignored in the schema root")}function Wk(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Zk.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Gk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Mm({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,P._)`${j.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,P.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,P._)`${j.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function Yk(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,P._)`${j.default.errors} === 0`,()=>t.return(j.default.data),()=>t.throw((0,P._)`new ${o}(${j.default.vErrors})`)):(t.assign((0,P._)`${n}.errors`,j.default.vErrors),i.unevaluated&&Qk(e),t.return((0,P._)`${j.default.errors} === 0`))}function Qk({gen:e,evaluated:t,props:r,items:n}){r instanceof P.Name&&e.assign((0,P._)`${t}.props`,r),n instanceof P.Name&&e.assign((0,P._)`${t}.items`,n)}function Im(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,It.schemaHasRulesButRef)(i,l))){o.block(()=>qm(e,"$ref",l.all.$ref.definition));return}c.jtd||Xk(e,t),o.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){(0,wc.shouldUseGroup)(i,f)&&(f.type?(o.if((0,ji.checkDataType)(f.type,s,c.strictNumbers)),Am(e,f),t.length===1&&t[0]===f.type&&r&&(o.else(),(0,ji.reportTypeError)(e)),o.endIf()):Am(e,f),a||o.if((0,P._)`${j.default.errors} === ${n||0}`))}}function Am(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,Mk.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,wc.shouldUseRule)(n,i)&&qm(e,i.keyword,i.definition,t.type)})}function Xk(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(eS(e,t),e.opts.allowUnionTypes||tS(e,t),rS(e,e.dataTypes))}function eS(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Zm(e.dataTypes,r)||$c(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),oS(e,t)}}function tS(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&$c(e,"use allowUnionTypes to allow union type keyword")}function rS(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,wc.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>nS(t,s))&&$c(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function nS(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Zm(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function oS(e,t){let r=[];for(let n of e.dataTypes)Zm(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function $c(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,It.checkStrictMode)(e,t,e.opts.strictTypes)}var Di=class{constructor(t,r,n){if((0,go.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,It.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Fm(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,go.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",j.default.errors))}result(t,r,n){this.failResult((0,P.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,P.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,P._)`${r} !== undefined && (${(0,P.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ho.reportExtraError:ho.reportError)(this,this.def.error,r)}$dataError(){(0,ho.reportError)(this,this.def.$dataError||ho.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ho.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=P.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=P.nil,r=P.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,P.or)((0,P._)`${o} === undefined`,r)),t!==P.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==P.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,P.or)(s(),a());function s(){if(n.length){if(!(r instanceof P.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,P._)`${(0,ji.checkDataTypes)(c,r,i.opts.strictNumbers,ji.DataType.Wrong)}`}return P.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,P._)`!${c}(${r})`}return P.nil}}subschema(t,r){let n=(0,bc.getSubschema)(this.it,t);(0,bc.extendSubschemaData)(n,this.it,t),(0,bc.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return Hk(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=It.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=It.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,P.Name)),!0}};Bt.KeywordCxt=Di;function qm(e,t,r,n){let o=new Di(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,go.funcKeywordCode)(o,r):"macro"in r?(0,go.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,go.funcKeywordCode)(o,r)}var iS=/^\/(?:[^~]|~0|~1)*$/,sS=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Fm(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return j.default.rootData;if(e[0]==="/"){if(!iS.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=j.default.rootData}else{let u=sS.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=t)throw new Error(c("property/index",l));return n[t-l]}if(l>t)throw new Error(c("data",l));if(i=r[t-l],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,P._)`${i}${(0,P.getProperty)((0,It.unescapeJsonPointer)(u))}`,s=(0,P._)`${s} && ${i}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Bt.getData=Fm});var Mi=v(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var kc=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Sc.default=kc});var yo=v(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});var zc=mo(),Ec=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,zc.resolveUrl)(t,r,n),this.missingSchema=(0,zc.normalizeId)((0,zc.getFullPath)(t,this.missingRef))}};Tc.default=Ec});var qi=v(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.resolveSchema=et.getCompilingSchema=et.resolveRef=et.compileSchema=et.SchemaEnv=void 0;var it=F(),aS=Mi(),wr=Pt(),st=mo(),Lm=J(),cS=_o(),on=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,st.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};et.SchemaEnv=on;function Ic(e){let t=Vm.call(this,e);if(t)return t;let r=(0,st.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new it.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:aS.default,code:(0,it._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:wr.default.data,parentData:wr.default.parentData,parentDataProperty:wr.default.parentDataProperty,dataNames:[wr.default.data],dataPathArr:[it.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,it.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:it.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,it._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,cS.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let d=s.toString();l=`${s.scopeRefs(wr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${wr.default.self}`,`${wr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof it.Name?void 0:m,items:h instanceof it.Name?void 0:h,dynamicProps:m instanceof it.Name,dynamicItems:h instanceof it.Name},p.source&&(p.source.evaluated=(0,it.stringify)(p.evaluated))}return e.validate=p,e}catch(d){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(e)}}et.compileSchema=Ic;function uS(e,t,r){var n;r=(0,st.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=fS.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new on({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=lS.call(this,i)}et.resolveRef=uS;function lS(e){return(0,st.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ic.call(this,e)}function Vm(e){for(let t of this._compilations)if(dS(t,e))return t}et.getCompilingSchema=Vm;function dS(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function fS(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Zi.call(this,e,t)}function Zi(e,t){let r=this.opts.uriResolver.parse(t),n=(0,st._getFullPath)(this.opts.uriResolver,r),o=(0,st.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Pc.call(this,r,e);let i=(0,st.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Zi.call(this,e,s);return typeof a?.schema!="object"?void 0:Pc.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Ic.call(this,s),i===(0,st.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,st.resolveUrl)(this.opts.uriResolver,o,u)),new on({schema:a,schemaId:c,root:e,baseId:o})}return Pc.call(this,r,s)}}et.resolveSchema=Zi;var pS=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Pc(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Lm.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!pS.has(a)&&u&&(t=(0,st.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Lm.schemaHasRulesButRef)(r,this.RULES)){let a=(0,st.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Zi.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new on({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var Um=v((aM,mS)=>{mS.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 Cc=v((cM,Gm)=>{"use strict";var hS=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Bm=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),Ac=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Km=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),gS=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Oc(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var _S=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Hm(e){return e.length=0,!0}function yS(e,t,r){if(e.length){let n=Oc(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function vS(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=yS;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(s=!0),!a(o,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=Hm}else{o.push(u);continue}}return o.length&&(a===Hm?r.zone=o.join(""):s?n.push(o.join("")):n.push(Oc(o))),r.address=n.join(""),r}function Jm(e){if(xS(e,":")<2)return{host:e,isIPV6:!1};let t=vS(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xS(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function bS(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){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]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var wS={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},$S=/[@/?#:]/g,kS=/[@/?#]/g;function Wm(e,t){let r=t?kS:$S;return r.lastIndex=0,e.replace(r,n=>wS[n])}function SS(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(Ac(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&Km(s)?r+=s:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function zS(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ac(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&Km(i)?t+=i:t+="%"+o,r+=2;continue}}gS(e[r])?t+=e[r]:t+=escape(e[r])}return t}function ES(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Ac(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function TS(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Bm(r)){let n=Jm(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Wm(r,!1)}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}Gm.exports={nonSimpleDomain:_S,recomposeAuthority:TS,reescapeHostDelimiters:Wm,normalizePercentEncoding:SS,normalizePathEncoding:zS,escapePreservingEscapes:ES,removeDotSegments:bS,isIPv4:Bm,isUUID:hS,normalizeIPv6:Jm,stringArrayToHexStripped:Oc}});var th=v((uM,eh)=>{"use strict";var{isUUID:PS}=Cc(),IS=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,AS=["http","https","ws","wss","urn","urn:uuid"];function OS(e){return AS.indexOf(e)!==-1}function Rc(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?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"):!1}function Ym(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Qm(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function CS(e){return e.secure=Rc(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RS(e){if((e.port===(Rc(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function NS(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(IS);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=Nc(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function jS(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=Nc(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function DS(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!PS(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function MS(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Xm={scheme:"http",domainHost:!0,parse:Ym,serialize:Qm},ZS={scheme:"https",domainHost:Xm.domainHost,parse:Ym,serialize:Qm},Fi={scheme:"ws",domainHost:!0,parse:CS,serialize:RS},qS={scheme:"wss",domainHost:Fi.domainHost,parse:Fi.parse,serialize:Fi.serialize},FS={scheme:"urn",parse:NS,serialize:jS,skipNormalize:!0},LS={scheme:"urn:uuid",parse:DS,serialize:MS,skipNormalize:!0},Li={http:Xm,https:ZS,ws:Fi,wss:qS,urn:FS,"urn:uuid":LS};Object.setPrototypeOf(Li,null);function Nc(e){return e&&(Li[e]||Li[e.toLowerCase()])||void 0}eh.exports={wsIsSecure:Rc,SCHEMES:Li,isValidSchemeName:OS,getSchemeHandler:Nc}});var ah=v((lM,Vi)=>{"use strict";var{normalizeIPv6:VS,removeDotSegments:vo,recomposeAuthority:US,normalizePercentEncoding:HS,normalizePathEncoding:BS,escapePreservingEscapes:KS,reescapeHostDelimiters:JS,isIPv4:WS,nonSimpleDomain:GS}=Cc(),{SCHEMES:YS,getSchemeHandler:nh}=th();function QS(e,t){return typeof e=="string"?e=nz(e,t):typeof e=="object"&&(e=sn($r(e,t),t)),e}function XS(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=oh(sn(e,n),sn(t,n),n,!0);return n.skipEscape=!0,$r(o,n)}function oh(e,t,r,n){let o={};return n||(e=sn($r(e,r),r),t=sn($r(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=vo(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=vo(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=vo(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=vo(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function ez(e,t,r){let n=rh(e,r),o=rh(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function $r(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=nh(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=HS(r.path):(r.path=KS(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=US(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=vo(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var tz=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function rz(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."}function ih(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let s=e.match(tz);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=rz(n,s);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(WS(n.host)===!1){let l=VS(n.host);n.host=l.host.toLowerCase(),i=l.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=nh(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&GS(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=JS(unescape(n.host),i))),n.path&&(n.path=BS(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function sn(e,t){return ih(e,t).parsed}function nz(e,t){return sh(e,t).normalized}function sh(e,t){let{parsed:r,malformedAuthorityOrPort:n}=ih(e,t);return{normalized:n?e:$r(r,t),malformedAuthorityOrPort:n}}function rh(e,t){if(typeof e=="string"){let{normalized:r,malformedAuthorityOrPort:n}=sh(e,t);return n?void 0:r}if(typeof e=="object")return $r(e,t)}var jc={SCHEMES:YS,normalize:QS,resolve:XS,resolveComponent:oh,equal:ez,serialize:$r,parse:sn};Vi.exports=jc;Vi.exports.default=jc;Vi.exports.fastUri=jc});var uh=v(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var ch=ah();ch.code='require("ajv/dist/runtime/uri").default';Dc.default=ch});var _h=v(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.CodeGen=ke.Name=ke.nil=ke.stringify=ke.str=ke._=ke.KeywordCxt=void 0;var oz=_o();Object.defineProperty(ke,"KeywordCxt",{enumerable:!0,get:function(){return oz.KeywordCxt}});var an=F();Object.defineProperty(ke,"_",{enumerable:!0,get:function(){return an._}});Object.defineProperty(ke,"str",{enumerable:!0,get:function(){return an.str}});Object.defineProperty(ke,"stringify",{enumerable:!0,get:function(){return an.stringify}});Object.defineProperty(ke,"nil",{enumerable:!0,get:function(){return an.nil}});Object.defineProperty(ke,"Name",{enumerable:!0,get:function(){return an.Name}});Object.defineProperty(ke,"CodeGen",{enumerable:!0,get:function(){return an.CodeGen}});var iz=Mi(),mh=yo(),sz=dc(),xo=qi(),az=F(),bo=mo(),Ui=po(),Zc=J(),lh=Um(),cz=uh(),hh=(e,t)=>new RegExp(e,t);hh.code="new RegExp";var uz=["removeAdditional","useDefaults","coerceTypes"],lz=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),dz={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."},fz={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dh=200;function pz(e){var t,r,n,o,i,s,a,c,u,l,d,f,p,m,h,g,x,w,$,I,A,de,ye,Rr,Ts;let En=e.strict,Ps=(t=e.code)===null||t===void 0?void 0:t.optimize,ll=Ps===!0||Ps===void 0?1:Ps||0,dl=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hh,Cv=(o=e.uriResolver)!==null&&o!==void 0?o:cz.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:En)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:En)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:En)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:En)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:En)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:ll,regExp:dl}:{optimize:ll,regExp:dl},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:dh,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:dh,meta:(x=e.meta)!==null&&x!==void 0?x:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:($=e.inlineRefs)!==null&&$!==void 0?$:!0,schemaId:(I=e.schemaId)!==null&&I!==void 0?I:"$id",addUsedSchema:(A=e.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(de=e.validateSchema)!==null&&de!==void 0?de:!0,validateFormats:(ye=e.validateFormats)!==null&&ye!==void 0?ye:!0,unicodeRegExp:(Rr=e.unicodeRegExp)!==null&&Rr!==void 0?Rr:!0,int32range:(Ts=e.int32range)!==null&&Ts!==void 0?Ts:!0,uriResolver:Cv}}var wo=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...pz(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new az.ValueScope({scope:{},prefixes:lz,es5:r,lines:n}),this.logger=vz(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,sz.getRules)(),fh.call(this,dz,t,"NOT SUPPORTED"),fh.call(this,fz,t,"DEPRECATED","warn"),this._metaOpts=_z.call(this),t.formats&&hz.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&gz.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),mz.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=lh;n==="id"&&(o={...lh},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(l,d){await i.call(this,l.$schema);let f=this._addSchema(l,d);return f.validate||s.call(this,f)}async function i(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof mh.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await i.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,bo.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=ph.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new xo.SchemaEnv({schema:{},schemaId:n});if(r=xo.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=ph.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,bo.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(bz.call(this,n,r),!r)return(0,Zc.eachItem)(n,i=>Mc.call(this,i)),this;$z.call(this,r);let o={...r,type:(0,Ui.getJSONTypes)(r.type),schemaType:(0,Ui.getJSONTypes)(r.schemaType)};return(0,Zc.eachItem)(n,o.type.length===0?i=>Mc.call(this,i,o):i=>o.type.forEach(s=>Mc.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=s[a];u&&l&&(s[a]=gh(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,bo.normalizeId)(s||n);let u=bo.getSchemaRefs.call(this,t,n);return c=new xo.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):xo.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{xo.compileSchema.call(this,t)}finally{this.opts=r}}};wo.ValidationError=iz.default;wo.MissingRefError=mh.default;ke.default=wo;function fh(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function ph(e){return e=(0,bo.normalizeId)(e),this.schemas[e]||this.refs[e]}function mz(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function hz(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function gz(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];r.keyword||(r.keyword=t),this.addKeyword(r)}}function _z(){let e={...this.opts};for(let t of uz)delete e[t];return e}var yz={log(){},warn(){},error(){}};function vz(e){if(e===!1)return yz;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var xz=/^[a-z_$][a-z0-9_$:-]*$/i;function bz(e,t){let{RULES:r}=this;if((0,Zc.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!xz.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Mc(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ui.getJSONTypes)(t.type),schemaType:(0,Ui.getJSONTypes)(t.schemaType)}};t.before?wz.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function wz(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function $z(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=gh(t)),e.validateSchema=this.compile(t,!0))}var kz={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function gh(e){return{anyOf:[e,kz]}}});var yh=v(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var Sz={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};qc.default=Sz});var wh=v(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.callRef=kr.getValidate=void 0;var zz=yo(),vh=Xe(),Ve=F(),cn=Pt(),xh=qi(),Hi=J(),Ez={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=xh.resolveRef.call(c,u,o,r);if(l===void 0)throw new zz.default(n.opts.uriResolver,o,r);if(l instanceof xh.SchemaEnv)return f(l);return p(l);function d(){if(i===u)return Bi(e,s,i,i.$async);let m=t.scopeValue("root",{ref:u});return Bi(e,(0,Ve._)`${m}.validate`,u,u.$async)}function f(m){let h=bh(e,m);Bi(e,h,m,m.$async)}function p(m){let h=t.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Ve.stringify)(m)}:{ref:m}),g=t.name("valid"),x=e.subschema({schema:m,dataTypes:[],schemaPath:Ve.nil,topSchemaRef:h,errSchemaPath:r},g);e.mergeEvaluated(x),e.ok(g)}}};function bh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ve._)`${r.scopeValue("wrapper",{ref:t})}.validate`}kr.getValidate=bh;function Bi(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?cn.default.this:Ve.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,Ve._)`await ${(0,vh.callValidateCode)(e,t,u)}`),p(t),s||o.assign(m,!0)},h=>{o.if((0,Ve._)`!(${h} instanceof ${i.ValidationError})`,()=>o.throw(h)),f(h),s||o.assign(m,!1)}),e.ok(m)}function d(){e.result((0,vh.callValidateCode)(e,t,u),()=>p(t),()=>f(t))}function f(m){let h=(0,Ve._)`${m}.errors`;o.assign(cn.default.vErrors,(0,Ve._)`${cn.default.vErrors} === null ? ${h} : ${cn.default.vErrors}.concat(${h})`),o.assign(cn.default.errors,(0,Ve._)`${cn.default.vErrors}.length`)}function p(m){var h;if(!i.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=Hi.mergeEvaluated.props(o,g.props,i.props));else{let x=o.var("props",(0,Ve._)`${m}.evaluated.props`);i.props=Hi.mergeEvaluated.props(o,x,i.props,Ve.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=Hi.mergeEvaluated.items(o,g.items,i.items));else{let x=o.var("items",(0,Ve._)`${m}.evaluated.items`);i.items=Hi.mergeEvaluated.items(o,x,i.items,Ve.Name)}}}kr.callRef=Bi;kr.default=Ez});var $h=v(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var Tz=yh(),Pz=wh(),Iz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Tz.default,Pz.default];Fc.default=Iz});var kh=v(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var Ki=F(),Kt=Ki.operators,Ji={maximum:{okStr:"<=",ok:Kt.LTE,fail:Kt.GT},minimum:{okStr:">=",ok:Kt.GTE,fail:Kt.LT},exclusiveMaximum:{okStr:"<",ok:Kt.LT,fail:Kt.GTE},exclusiveMinimum:{okStr:">",ok:Kt.GT,fail:Kt.LTE}},Az={message:({keyword:e,schemaCode:t})=>(0,Ki.str)`must be ${Ji[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ki._)`{comparison: ${Ji[e].okStr}, limit: ${t}}`},Oz={keyword:Object.keys(Ji),type:"number",schemaType:"number",$data:!0,error:Az,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ki._)`${r} ${Ji[t].fail} ${n} || isNaN(${r})`)}};Lc.default=Oz});var Sh=v(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var $o=F(),Cz={message:({schemaCode:e})=>(0,$o.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,$o._)`{multipleOf: ${e}}`},Rz={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Cz,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,$o._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,$o._)`${s} !== parseInt(${s})`;e.fail$data((0,$o._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};Vc.default=Rz});var Eh=v(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});function zh(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Uc.default=zh;zh.code='require("ajv/dist/runtime/ucs2length").default'});var Th=v(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var Sr=F(),Nz=J(),jz=Eh(),Dz={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Sr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Sr._)`{limit: ${e}}`},Mz={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Dz,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Sr.operators.GT:Sr.operators.LT,s=o.opts.unicode===!1?(0,Sr._)`${r}.length`:(0,Sr._)`${(0,Nz.useFunc)(e.gen,jz.default)}(${r})`;e.fail$data((0,Sr._)`${s} ${i} ${n}`)}};Hc.default=Mz});var Ph=v(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var Zz=Xe(),qz=J(),un=F(),Fz={message:({schemaCode:e})=>(0,un.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,un._)`{pattern: ${e}}`},Lz={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Fz,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,u=c.code==="new RegExp"?(0,un._)`new RegExp`:(0,qz.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,un._)`${u}(${i}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,un._)`!${l}`)}else{let c=(0,Zz.usePattern)(e,o);e.fail$data((0,un._)`!${c}.test(${r})`)}}};Bc.default=Lz});var Ih=v(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var ko=F(),Vz={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,ko.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,ko._)`{limit: ${e}}`},Uz={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Vz,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?ko.operators.GT:ko.operators.LT;e.fail$data((0,ko._)`Object.keys(${r}).length ${o} ${n}`)}};Kc.default=Uz});var Ah=v(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var So=Xe(),zo=F(),Hz=J(),Bz={message:({params:{missingProperty:e}})=>(0,zo.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,zo._)`{missingProperty: ${e}}`},Kz={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Bz,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():l(),a.strictRequired){let p=e.parentSchema.properties,{definedProperties:m}=e.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,x=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,Hz.checkStrictMode)(s,x,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(zo.nil,d);else for(let p of r)(0,So.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(c||i){let m=t.let("valid",!0);e.block$data(m,()=>f(p,m)),e.ok(m)}else t.if((0,So.checkMissingProp)(e,r,p)),(0,So.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",n,p=>{e.setParams({missingProperty:p}),t.if((0,So.noPropertyInData)(t,o,p,a.ownProperties),()=>e.error())})}function f(p,m){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(m,(0,So.propertyInData)(t,o,p,a.ownProperties)),t.if((0,zo.not)(m),()=>{e.error(),t.break()})},zo.nil)}}};Jc.default=Kz});var Oh=v(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var Eo=F(),Jz={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Eo.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Eo._)`{limit: ${e}}`},Wz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Jz,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Eo.operators.GT:Eo.operators.LT;e.fail$data((0,Eo._)`${r}.length ${o} ${n}`)}};Wc.default=Wz});var Wi=v(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});var Ch=vc();Ch.code='require("ajv/dist/runtime/equal").default';Gc.default=Ch});var Rh=v(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var Yc=po(),Se=F(),Gz=J(),Yz=Wi(),Qz={message:({params:{i:e,j:t}})=>(0,Se.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Se._)`{i: ${e}, j: ${t}}`},Xz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Qz,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,Yc.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,Se._)`${s} === false`),e.ok(c);function l(){let m=t.let("i",(0,Se._)`${r}.length`),h=t.let("j");e.setParams({i:m,j:h}),t.assign(c,!0),t.if((0,Se._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,h){let g=t.name("item"),x=(0,Yc.checkDataTypes)(u,g,a.opts.strictNumbers,Yc.DataType.Wrong),w=t.const("indices",(0,Se._)`{}`);t.for((0,Se._)`;${m}--;`,()=>{t.let(g,(0,Se._)`${r}[${m}]`),t.if(x,(0,Se._)`continue`),u.length>1&&t.if((0,Se._)`typeof ${g} == "string"`,(0,Se._)`${g} += "_"`),t.if((0,Se._)`typeof ${w}[${g}] == "number"`,()=>{t.assign(h,(0,Se._)`${w}[${g}]`),e.error(),t.assign(c,!1).break()}).code((0,Se._)`${w}[${g}] = ${m}`)})}function p(m,h){let g=(0,Gz.useFunc)(t,Yz.default),x=t.name("outer");t.label(x).for((0,Se._)`;${m}--;`,()=>t.for((0,Se._)`${h} = ${m}; ${h}--;`,()=>t.if((0,Se._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(x)})))}}};Qc.default=Xz});var Nh=v(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});var Xc=F(),eE=J(),tE=Wi(),rE={message:"must be equal to constant",params:({schemaCode:e})=>(0,Xc._)`{allowedValue: ${e}}`},nE={keyword:"const",$data:!0,error:rE,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,Xc._)`!${(0,eE.useFunc)(t,tE.default)}(${r}, ${o})`):e.fail((0,Xc._)`${i} !== ${r}`)}};eu.default=nE});var jh=v(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});var To=F(),oE=J(),iE=Wi(),sE={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,To._)`{allowedValues: ${e}}`},aE={keyword:"enum",schemaType:"array",$data:!0,error:sE,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,oE.useFunc)(t,iE.default)),l;if(a||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=t.const("vSchema",i);l=(0,To.or)(...o.map((m,h)=>f(p,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",i,p=>t.if((0,To._)`${u()}(${r}, ${p})`,()=>t.assign(l,!0).break()))}function f(p,m){let h=o[m];return typeof h=="object"&&h!==null?(0,To._)`${u()}(${r}, ${p}[${m}])`:(0,To._)`${r} === ${h}`}}};tu.default=aE});var Dh=v(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});var cE=kh(),uE=Sh(),lE=Th(),dE=Ph(),fE=Ih(),pE=Ah(),mE=Oh(),hE=Rh(),gE=Nh(),_E=jh(),yE=[cE.default,uE.default,lE.default,dE.default,fE.default,pE.default,mE.default,hE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gE.default,_E.default];ru.default=yE});var ou=v(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.validateAdditionalItems=void 0;var zr=F(),nu=J(),vE={message:({params:{len:e}})=>(0,zr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,zr._)`{limit: ${e}}`},xE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vE,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,nu.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Mh(e,n)}};function Mh(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,zr._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,zr._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,nu.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,zr._)`${a} <= ${t.length}`);r.if((0,zr.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:nu.Type.Num},u),s.allErrors||r.if((0,zr.not)(u),()=>r.break())})}}Po.validateAdditionalItems=Mh;Po.default=xE});var iu=v(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.validateTuple=void 0;var Zh=F(),Gi=J(),bE=Xe(),wE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return qh(e,"additionalItems",t);r.items=!0,!(0,Gi.alwaysValidSchema)(r,t)&&e.ok((0,bE.validateArray)(e))}};function qh(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Gi.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,Zh._)`${i}.length`);r.forEach((d,f)=>{(0,Gi.alwaysValidSchema)(a,d)||(n.if((0,Zh._)`${u} > ${f}`,()=>e.subschema({keyword:s,schemaProp:f,dataProp:f},c)),e.ok(c))});function l(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[t]===!1);if(f.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Gi.checkStrictMode)(a,g,f.strictTuples)}}}Io.validateTuple=qh;Io.default=wE});var Fh=v(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});var $E=iu(),kE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,$E.validateTuple)(e,"items")};su.default=kE});var Vh=v(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});var Lh=F(),SE=J(),zE=Xe(),EE=ou(),TE={message:({params:{len:e}})=>(0,Lh.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Lh._)`{limit: ${e}}`},PE={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:TE,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,SE.alwaysValidSchema)(n,t)&&(o?(0,EE.validateAdditionalItems)(e,o):e.ok((0,zE.validateArray)(e)))}};au.default=PE});var Uh=v(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});var tt=F(),Yi=J(),IE={message:({params:{min:e,max:t}})=>t===void 0?(0,tt.str)`must contain at least ${e} valid item(s)`:(0,tt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,tt._)`{minContains: ${e}}`:(0,tt._)`{minContains: ${e}, maxContains: ${t}}`},AE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:IE,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let l=t.const("len",(0,tt._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Yi.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Yi.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Yi.alwaysValidSchema)(i,r)){let h=(0,tt._)`${l} >= ${s}`;a!==void 0&&(h=(0,tt._)`${h} && ${l} <= ${a}`),e.pass(h);return}i.items=!0;let d=t.name("valid");a===void 0&&s===1?p(d,()=>t.if(d,()=>t.break())):s===0?(t.let(d,!0),a!==void 0&&t.if((0,tt._)`${o}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let h=t.name("_valid"),g=t.let("count",0);p(h,()=>t.if(h,()=>m(g)))}function p(h,g){t.forRange("i",0,l,x=>{e.subschema({keyword:"contains",dataProp:x,dataPropType:Yi.Type.Num,compositeRule:!0},h),g()})}function m(h){t.code((0,tt._)`${h}++`),a===void 0?t.if((0,tt._)`${h} >= ${s}`,()=>t.assign(d,!0).break()):(t.if((0,tt._)`${h} > ${a}`,()=>t.assign(d,!1).break()),s===1?t.assign(d,!0):t.if((0,tt._)`${h} >= ${s}`,()=>t.assign(d,!0)))}}};cu.default=AE});var Kh=v(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.validateSchemaDeps=_t.validatePropertyDeps=_t.error=void 0;var uu=F(),OE=J(),Ao=Xe();_t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,uu.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,uu._)`{property: ${e},
8
+ missingProperty: ${n},
9
+ depsCount: ${t},
10
+ deps: ${r}}`};var CE={keyword:"dependencies",type:"object",schemaType:"object",error:_t.error,code(e){let[t,r]=RE(e);Hh(e,t),Bh(e,r)}};function RE({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function Hh(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,Ao.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,Ao.checkReportMissingProp)(e,u)}):(r.if((0,uu._)`${c} && (${(0,Ao.checkMissingProp)(e,a,i)})`),(0,Ao.reportMissingProp)(e,i),r.else())}}_t.validatePropertyDeps=Hh;function Bh(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,OE.alwaysValidSchema)(i,t[a])||(r.if((0,Ao.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}_t.validateSchemaDeps=Bh;_t.default=CE});var Wh=v(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});var Jh=F(),NE=J(),jE={message:"property name must be valid",params:({params:e})=>(0,Jh._)`{propertyName: ${e.propertyName}}`},DE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:jE,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,NE.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Jh.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};lu.default=DE});var fu=v(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});var Qi=Xe(),at=F(),ME=Pt(),Xi=J(),ZE={message:"must NOT have additional properties",params:({params:e})=>(0,at._)`{additionalProperty: ${e.additionalProperty}}`},qE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ZE,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Xi.alwaysValidSchema)(s,r))return;let u=(0,Qi.allSchemaProperties)(n.properties),l=(0,Qi.allSchemaProperties)(n.patternProperties);d(),e.ok((0,at._)`${i} === ${ME.default.errors}`);function d(){t.forIn("key",o,g=>{!u.length&&!l.length?m(g):t.if(f(g),()=>m(g))})}function f(g){let x;if(u.length>8){let w=(0,Xi.schemaRefOrVal)(s,n.properties,"properties");x=(0,Qi.isOwnProperty)(t,w,g)}else u.length?x=(0,at.or)(...u.map(w=>(0,at._)`${g} === ${w}`)):x=at.nil;return l.length&&(x=(0,at.or)(x,...l.map(w=>(0,at._)`${(0,Qi.usePattern)(e,w)}.test(${g})`))),(0,at.not)(x)}function p(g){t.code((0,at._)`delete ${o}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Xi.alwaysValidSchema)(s,r)){let x=t.name("valid");c.removeAdditional==="failing"?(h(g,x,!1),t.if((0,at.not)(x),()=>{e.reset(),p(g)})):(h(g,x),a||t.if((0,at.not)(x),()=>t.break()))}}function h(g,x,w){let $={keyword:"additionalProperties",dataProp:g,dataPropType:Xi.Type.Str};w===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema($,x)}}};du.default=qE});var Qh=v(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});var FE=_o(),Gh=Xe(),pu=J(),Yh=fu(),LE={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Yh.default.code(new FE.KeywordCxt(i,Yh.default,"additionalProperties"));let s=(0,Gh.allSchemaProperties)(r);for(let d of s)i.definedProperties.add(d);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=pu.mergeEvaluated.props(t,(0,pu.toHash)(s),i.props));let a=s.filter(d=>!(0,pu.alwaysValidSchema)(i,r[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a)u(d)?l(d):(t.if((0,Gh.propertyInData)(t,o,d,i.opts.ownProperties)),l(d),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};mu.default=LE});var rg=v(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var Xh=Xe(),es=F(),eg=J(),tg=J(),VE={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Xh.allSchemaProperties)(r),c=a.filter(h=>(0,eg.alwaysValidSchema)(i,r[h]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,l=t.name("valid");i.props!==!0&&!(i.props instanceof es.Name)&&(i.props=(0,tg.evaluatedPropsToName)(t,i.props));let{props:d}=i;f();function f(){for(let h of a)u&&p(h),i.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,eg.checkStrictMode)(i,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",n,g=>{t.if((0,es._)`${(0,Xh.usePattern)(e,h)}.test(${g})`,()=>{let x=c.includes(h);x||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:tg.Type.Str},l),i.opts.unevaluated&&d!==!0?t.assign((0,es._)`${d}[${g}]`,!0):!x&&!i.allErrors&&t.if((0,es.not)(l),()=>t.break())})})}}};hu.default=VE});var ng=v(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});var UE=J(),HE={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,UE.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};gu.default=HE});var og=v(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});var BE=Xe(),KE={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:BE.validateUnion,error:{message:"must match a schema in anyOf"}};_u.default=KE});var ig=v(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});var ts=F(),JE=J(),WE={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ts._)`{passingSchemas: ${e.passing}}`},GE={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:WE,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((l,d)=>{let f;(0,JE.alwaysValidSchema)(o,l)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,ts._)`${c} && ${s}`).assign(s,!1).assign(a,(0,ts._)`[${a}, ${d}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,d),f&&e.mergeEvaluated(f,ts.Name)})})}}};yu.default=GE});var sg=v(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});var YE=J(),QE={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,YE.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};vu.default=QE});var ug=v(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});var rs=F(),cg=J(),XE={message:({params:e})=>(0,rs.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,rs._)`{failingKeyword: ${e.ifClause}}`},eT={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:XE,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,cg.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=ag(n,"then"),i=ag(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,u("then",l),u("else",l))}else o?t.if(a,u("then")):t.if((0,rs.not)(a),u("else"));e.pass(s,()=>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);t.assign(s,a),e.mergeValidEvaluated(f,s),d?t.assign(d,(0,rs._)`${l}`):e.setParams({ifClause:l})}}}};function ag(e,t){let r=e.schema[t];return r!==void 0&&!(0,cg.alwaysValidSchema)(e,r)}xu.default=eT});var lg=v(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});var tT=J(),rT={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,tT.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};bu.default=rT});var dg=v(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});var nT=ou(),oT=Fh(),iT=iu(),sT=Vh(),aT=Uh(),cT=Kh(),uT=Wh(),lT=fu(),dT=Qh(),fT=rg(),pT=ng(),mT=og(),hT=ig(),gT=sg(),_T=ug(),yT=lg();function vT(e=!1){let t=[pT.default,mT.default,hT.default,gT.default,_T.default,yT.default,uT.default,lT.default,cT.default,dT.default,fT.default];return e?t.push(oT.default,sT.default):t.push(nT.default,iT.default),t.push(aT.default),t}wu.default=vT});var fg=v($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});var me=F(),xT={message:({schemaCode:e})=>(0,me.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,me._)`{format: ${e}}`},bT={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xT,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,me._)`${m}[${s}]`),g=r.let("fType"),x=r.let("format");r.if((0,me._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,me._)`${h}.type || "string"`).assign(x,(0,me._)`${h}.validate`),()=>r.assign(g,(0,me._)`"string"`).assign(x,h)),e.fail$data((0,me.or)(w(),$()));function w(){return c.strictSchema===!1?me.nil:(0,me._)`${s} && !${x}`}function $(){let I=l.$async?(0,me._)`(${h}.async ? await ${x}(${n}) : ${x}(${n}))`:(0,me._)`${x}(${n})`,A=(0,me._)`(typeof ${x} == "function" ? ${I} : ${x}.test(${n}))`;return(0,me._)`${x} && ${x} !== true && ${g} === ${t} && !${A}`}}function p(){let m=d.formats[i];if(!m){w();return}if(m===!0)return;let[h,g,x]=$(m);h===t&&e.pass(I());function w(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function $(A){let de=A instanceof RegExp?(0,me.regexpCode)(A):c.code.formats?(0,me._)`${c.code.formats}${(0,me.getProperty)(i)}`:void 0,ye=r.scopeValue("formats",{key:i,ref:A,code:de});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,me._)`${ye}.validate`]:["string",A,ye]}function I(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,me._)`await ${x}(${n})`}return typeof g=="function"?(0,me._)`${x}(${n})`:(0,me._)`${x}.test(${n})`}}}};$u.default=bT});var pg=v(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});var wT=fg(),$T=[wT.default];ku.default=$T});var mg=v(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.contentVocabulary=ln.metadataVocabulary=void 0;ln.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ln.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var gg=v(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});var kT=$h(),ST=Dh(),zT=dg(),ET=pg(),hg=mg(),TT=[kT.default,ST.default,(0,zT.default)(),ET.default,hg.metadataVocabulary,hg.contentVocabulary];Su.default=TT});var yg=v(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.DiscrError=void 0;var _g;(function(e){e.Tag="tag",e.Mapping="mapping"})(_g||(ns.DiscrError=_g={}))});var xg=v(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});var dn=F(),zu=yg(),vg=qi(),PT=yo(),IT=J(),AT={message:({params:{discrError:e,tagName:t}})=>e===zu.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,dn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},OT={keyword:"discriminator",type:"object",schemaType:"object",error:AT,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,dn._)`${r}${(0,dn.getProperty)(a)}`);t.if((0,dn._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:zu.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let p=f();t.if(!1);for(let m in p)t.elseIf((0,dn._)`${u} === ${m}`),t.assign(c,d(p[m]));t.else(),e.error(!1,{discrError:zu.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function d(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,dn.Name),m}function f(){var p;let m={},h=x(o),g=!0;for(let I=0;I<s.length;I++){let A=s[I];if(A?.$ref&&!(0,IT.schemaHasRulesButRef)(A,i.self.RULES)){let ye=A.$ref;if(A=vg.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,ye),A instanceof vg.SchemaEnv&&(A=A.schema),A===void 0)throw new PT.default(i.opts.uriResolver,i.baseId,ye)}let de=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof de!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||x(A)),w(de,I)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return m;function x({required:I}){return Array.isArray(I)&&I.includes(a)}function w(I,A){if(I.const)$(I.const,A);else if(I.enum)for(let de of I.enum)$(de,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function $(I,A){if(typeof I!="string"||I in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[I]=A}}}};Eu.default=OT});var bg=v((QM,CT)=>{CT.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 Pu=v((ae,Tu)=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.MissingRefError=ae.ValidationError=ae.CodeGen=ae.Name=ae.nil=ae.stringify=ae.str=ae._=ae.KeywordCxt=ae.Ajv=void 0;var RT=_h(),NT=gg(),jT=xg(),wg=bg(),DT=["/properties"],os="http://json-schema.org/draft-07/schema",fn=class extends RT.default{_addVocabularies(){super._addVocabularies(),NT.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(jT.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(wg,DT):wg;this.addMetaSchema(t,os,!1),this.refs["http://json-schema.org/schema"]=os}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(os)?os:void 0)}};ae.Ajv=fn;Tu.exports=ae=fn;Tu.exports.Ajv=fn;Object.defineProperty(ae,"__esModule",{value:!0});ae.default=fn;var MT=_o();Object.defineProperty(ae,"KeywordCxt",{enumerable:!0,get:function(){return MT.KeywordCxt}});var pn=F();Object.defineProperty(ae,"_",{enumerable:!0,get:function(){return pn._}});Object.defineProperty(ae,"str",{enumerable:!0,get:function(){return pn.str}});Object.defineProperty(ae,"stringify",{enumerable:!0,get:function(){return pn.stringify}});Object.defineProperty(ae,"nil",{enumerable:!0,get:function(){return pn.nil}});Object.defineProperty(ae,"Name",{enumerable:!0,get:function(){return pn.Name}});Object.defineProperty(ae,"CodeGen",{enumerable:!0,get:function(){return pn.CodeGen}});var ZT=Mi();Object.defineProperty(ae,"ValidationError",{enumerable:!0,get:function(){return ZT.default}});var qT=yo();Object.defineProperty(ae,"MissingRefError",{enumerable:!0,get:function(){return qT.default}})});var Ig=v(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.formatNames=vt.fastFormats=vt.fullFormats=void 0;function yt(e,t){return{validate:e,compare:t}}vt.fullFormats={date:yt(zg,Cu),time:yt(Au(!0),Ru),"date-time":yt($g(!0),Tg),"iso-time":yt(Au(),Eg),"iso-date-time":yt($g(),Pg),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:BT,"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:XT,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:KT,int32:{type:"number",validate:GT},int64:{type:"number",validate:YT},float:{type:"number",validate:Sg},double:{type:"number",validate:Sg},password:!0,binary:!0};vt.fastFormats={...vt.fullFormats,date:yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Cu),time:yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ru),"date-time":yt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Tg),"iso-time":yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Eg),"iso-date-time":yt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Pg),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};vt.formatNames=Object.keys(vt.fullFormats);function FT(e){return e%4===0&&(e%100!==0||e%400===0)}var LT=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,VT=[0,31,28,31,30,31,30,31,31,30,31,30,31];function zg(e){let t=LT.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&FT(r)?29:VT[n])}function Cu(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Iu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Au(e){return function(r){let n=Iu.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let d=i-l*c,f=o-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function Ru(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function Eg(e,t){if(!(e&&t))return;let r=Iu.exec(e),n=Iu.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var Ou=/t|\s/i;function $g(e){let t=Au(e);return function(n){let o=n.split(Ou);return o.length===2&&zg(o[0])&&t(o[1])}}function Tg(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function Pg(e,t){if(!(e&&t))return;let[r,n]=e.split(Ou),[o,i]=t.split(Ou),s=Cu(r,o);if(s!==void 0)return s||Ru(n,i)}var UT=/\/|:/,HT=/^(?:[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 BT(e){return UT.test(e)&&HT.test(e)}var kg=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function KT(e){return kg.lastIndex=0,kg.test(e)}var JT=-(2**31),WT=2**31-1;function GT(e){return Number.isInteger(e)&&e<=WT&&e>=JT}function YT(e){return Number.isInteger(e)}function Sg(){return!0}var QT=/[^\\]\\Z/;function XT(e){if(QT.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Ag=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.formatLimitDefinition=void 0;var e1=Pu(),ct=F(),Jt=ct.operators,is={formatMaximum:{okStr:"<=",ok:Jt.LTE,fail:Jt.GT},formatMinimum:{okStr:">=",ok:Jt.GTE,fail:Jt.LT},formatExclusiveMaximum:{okStr:"<",ok:Jt.LT,fail:Jt.GTE},formatExclusiveMinimum:{okStr:">",ok:Jt.GT,fail:Jt.LTE}},t1={message:({keyword:e,schemaCode:t})=>(0,ct.str)`should be ${is[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,ct._)`{comparison: ${is[e].okStr}, limit: ${t}}`};mn.formatLimitDefinition={keyword:Object.keys(is),type:"string",schemaType:"string",$data:!0,error:t1,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new e1.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=t.const("fmt",(0,ct._)`${f}[${c.schemaCode}]`);e.fail$data((0,ct.or)((0,ct._)`typeof ${p} != "object"`,(0,ct._)`${p} instanceof RegExp`,(0,ct._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,ct._)`${s.code.formats}${(0,ct.getProperty)(f)}`:void 0});e.fail$data(d(m))}function d(f){return(0,ct._)`${f}.compare(${r}, ${n}) ${is[o].fail} 0`}},dependencies:["format"]};var r1=e=>(e.addKeyword(mn.formatLimitDefinition),e);mn.default=r1});var Ng=v((Oo,Rg)=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var hn=Ig(),n1=Ag(),Nu=F(),Og=new Nu.Name("fullFormats"),o1=new Nu.Name("fastFormats"),ju=(e,t={keywords:!0})=>{if(Array.isArray(t))return Cg(e,t,hn.fullFormats,Og),e;let[r,n]=t.mode==="fast"?[hn.fastFormats,o1]:[hn.fullFormats,Og],o=t.formats||hn.formatNames;return Cg(e,o,r,n),t.keywords&&(0,n1.default)(e),e};ju.get=(e,t="full")=>{let n=(t==="fast"?hn.fastFormats:hn.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function Cg(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,Nu._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}Rg.exports=Oo=ju;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.default=ju});var Co=v((_Z,Vg)=>{var a1=Object.prototype.toString;Vg.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return f1(t)?"generatorfunction":"function";if(c1(t))return"array";if(h1(t))return"buffer";if(m1(t))return"arguments";if(l1(t))return"date";if(u1(t))return"error";if(d1(t))return"regexp";switch(Lg(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(p1(t))return"generator";switch(r=a1.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Lg(e){return typeof e.constructor=="function"?e.constructor.name:null}function c1(e){return Array.isArray?Array.isArray(e):e instanceof Array}function u1(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function l1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function d1(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function f1(e,t){return Lg(e)==="GeneratorFunction"}function p1(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function m1(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function h1(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Hg=v((yZ,Ug)=>{"use strict";Ug.exports=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")}});var Jg=v((vZ,Kg)=>{"use strict";var Bg=Hg();Kg.exports=function(t){Bg(t)||(t={});for(var r=arguments.length,n=1;n<r;n++){var o=arguments[n];Bg(o)&&g1(t,o)}return t};function g1(e,t){for(var r in t)_1(t,r)&&(e[r]=t[r])}function _1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Yg=v((xZ,Gg)=>{"use strict";var y1=Co(),v1=Jg();Gg.exports=function(e,t){typeof t=="function"&&(t={parse:t});var r=b1(e),n={section_delimiter:"---",parse:$1},o=v1({},n,t),i=o.section_delimiter,s=r.content.split(/\r?\n/),a=null,c=Wg(),u=[],l=[];function d(x){r.content=x,a=[],u=[]}function f(x){l.length&&(c.key=w1(l[0],i),c.content=x,o.parse(c,a),a.push(c),c=Wg(),u=[],l=[])}for(var p=0;p<s.length;p++){var m=s[p],h=l.length,g=m.trim();if(x1(g,i)){if(g.length===3&&p!==0){if(h===0||h===2){u.push(m);continue}l.push(g),c.data=u.join(`
11
+ `),u=[];continue}a===null&&d(u.join(`
12
+ `)),h===2&&f(u.join(`
13
+ `)),l.push(g);continue}u.push(m)}return a===null?d(u.join(`
14
+ `)):f(u.join(`
15
+ `)),r.sections=a,r};function x1(e,t){return!(e.slice(0,t.length)!==t||e.charAt(t.length+1)===t.slice(-1))}function b1(e){if(y1(e)!=="object"&&(e={content:e}),typeof e.content!="string"&&!k1(e.content))throw new TypeError("expected a buffer or string");return e.content=e.content.toString(),e.sections=[],e}function w1(e,t){return e?e.slice(t.length).trim():""}function Wg(){return{key:"",data:"",content:""}}function $1(e){return e}function k1(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var Tr=v((bZ,Er)=>{"use strict";function Qg(e){return typeof e>"u"||e===null}function S1(e){return typeof e=="object"&&e!==null}function z1(e){return Array.isArray(e)?e:Qg(e)?[]:[e]}function E1(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function T1(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function P1(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Er.exports.isNothing=Qg;Er.exports.isObject=S1;Er.exports.toArray=z1;Er.exports.repeat=T1;Er.exports.isNegativeZero=P1;Er.exports.extend=E1});var gn=v((wZ,Xg)=>{"use strict";function Ro(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ro.prototype=Object.create(Error.prototype);Ro.prototype.constructor=Ro;Ro.prototype.toString=function(t){var r=this.name+": ";return r+=this.reason||"(unknown reason)",!t&&this.mark&&(r+=" "+this.mark.toString()),r};Xg.exports=Ro});var r_=v(($Z,t_)=>{"use strict";var e_=Tr();function Du(e,t,r,n,o){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=o}Du.prototype.getSnippet=function(t,r){var n,o,i,s,a;if(!this.buffer)return null;for(t=t||4,r=r||75,n="",o=this.position;o>0&&`\0\r
16
+ \x85\u2028\u2029`.indexOf(this.buffer.charAt(o-1))===-1;)if(o-=1,this.position-o>r/2-1){n=" ... ",o+=5;break}for(i="",s=this.position;s<this.buffer.length&&`\0\r
17
+ \x85\u2028\u2029`.indexOf(this.buffer.charAt(s))===-1;)if(s+=1,s-this.position>r/2-1){i=" ... ",s-=5;break}return a=this.buffer.slice(o,s),e_.repeat(" ",t)+n+a+i+`
18
+ `+e_.repeat(" ",t+this.position-o+n.length)+"^"};Du.prototype.toString=function(t){var r,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(r=this.getSnippet(),r&&(n+=`:
19
+ `+r)),n};t_.exports=Du});var _e=v((kZ,o_)=>{"use strict";var n_=gn(),I1=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],A1=["scalar","sequence","mapping"];function O1(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function C1(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(I1.indexOf(r)===-1)throw new n_('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=O1(t.styleAliases||null),A1.indexOf(this.kind)===-1)throw new n_('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}o_.exports=C1});var Pr=v((SZ,s_)=>{"use strict";var i_=Tr(),ds=gn(),R1=_e();function Mu(e,t,r){var n=[];return e.include.forEach(function(o){r=Mu(o,t,r)}),e[t].forEach(function(o){r.forEach(function(i,s){i.tag===o.tag&&i.kind===o.kind&&n.push(s)}),r.push(o)}),r.filter(function(o,i){return n.indexOf(i)===-1})}function N1(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function n(o){e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function _n(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new ds("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Mu(this,"implicit",[]),this.compiledExplicit=Mu(this,"explicit",[]),this.compiledTypeMap=N1(this.compiledImplicit,this.compiledExplicit)}_n.DEFAULT=null;_n.create=function(){var t,r;switch(arguments.length){case 1:t=_n.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new ds("Wrong number of arguments for Schema.create function")}if(t=i_.toArray(t),r=i_.toArray(r),!t.every(function(n){return n instanceof _n}))throw new ds("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(n){return n instanceof R1}))throw new ds("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new _n({include:t,explicit:r})};s_.exports=_n});var c_=v((zZ,a_)=>{"use strict";var j1=_e();a_.exports=new j1("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var l_=v((EZ,u_)=>{"use strict";var D1=_e();u_.exports=new D1("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var f_=v((TZ,d_)=>{"use strict";var M1=_e();d_.exports=new M1("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var fs=v((PZ,p_)=>{"use strict";var Z1=Pr();p_.exports=new Z1({explicit:[c_(),l_(),f_()]})});var h_=v((IZ,m_)=>{"use strict";var q1=_e();function F1(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function L1(){return null}function V1(e){return e===null}m_.exports=new q1("tag:yaml.org,2002:null",{kind:"scalar",resolve:F1,construct:L1,predicate:V1,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var __=v((AZ,g_)=>{"use strict";var U1=_e();function H1(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function B1(e){return e==="true"||e==="True"||e==="TRUE"}function K1(e){return Object.prototype.toString.call(e)==="[object Boolean]"}g_.exports=new U1("tag:yaml.org,2002:bool",{kind:"scalar",resolve:H1,construct:B1,predicate:K1,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var v_=v((OZ,y_)=>{"use strict";var J1=Tr(),W1=_e();function G1(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Y1(e){return 48<=e&&e<=55}function Q1(e){return 48<=e&&e<=57}function X1(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!G1(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}for(;r<t;r++)if(o=e[r],o!=="_"){if(!Y1(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(o===":")break;if(!Q1(e.charCodeAt(r)))return!1;n=!0}return!n||o==="_"?!1:o!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(r))}function eP(e){var t=e,r=1,n,o,i=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0"?0:n==="0"?t[1]==="b"?r*parseInt(t.slice(2),2):t[1]==="x"?r*parseInt(t,16):r*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(s){i.unshift(parseInt(s,10))}),t=0,o=1,i.forEach(function(s){t+=s*o,o*=60}),r*t):r*parseInt(t,10)}function tP(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!J1.isNegativeZero(e)}y_.exports=new W1("tag:yaml.org,2002:int",{kind:"scalar",resolve:X1,construct:eP,predicate:tP,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var w_=v((CZ,b_)=>{"use strict";var x_=Tr(),rP=_e(),nP=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function oP(e){return!(e===null||!nP.test(e)||e[e.length-1]==="_")}function iP(e){var t,r,n,o;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(i){o.unshift(parseFloat(i,10))}),t=0,n=1,o.forEach(function(i){t+=i*n,n*=60}),r*t):r*parseFloat(t,10)}var sP=/^[-+]?[0-9]+e/;function aP(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(x_.isNegativeZero(e))return"-0.0";return r=e.toString(10),sP.test(r)?r.replace("e",".e"):r}function cP(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||x_.isNegativeZero(e))}b_.exports=new rP("tag:yaml.org,2002:float",{kind:"scalar",resolve:oP,construct:iP,predicate:cP,represent:aP,defaultStyle:"lowercase"})});var Zu=v((RZ,$_)=>{"use strict";var uP=Pr();$_.exports=new uP({include:[fs()],implicit:[h_(),__(),v_(),w_()]})});var qu=v((NZ,k_)=>{"use strict";var lP=Pr();k_.exports=new lP({include:[Zu()]})});var T_=v((jZ,E_)=>{"use strict";var dP=_e(),S_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),z_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function fP(e){return e===null?!1:S_.exec(e)!==null||z_.exec(e)!==null}function pP(e){var t,r,n,o,i,s,a,c=0,u=null,l,d,f;if(t=S_.exec(e),t===null&&(t=z_.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(l=+t[10],d=+(t[11]||0),u=(l*60+d)*6e4,t[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,o,i,s,a,c)),u&&f.setTime(f.getTime()-u),f}function mP(e){return e.toISOString()}E_.exports=new dP("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:fP,construct:pP,instanceOf:Date,represent:mP})});var I_=v((DZ,P_)=>{"use strict";var hP=_e();function gP(e){return e==="<<"||e===null}P_.exports=new hP("tag:yaml.org,2002:merge",{kind:"scalar",resolve:gP})});var C_=v((MZ,O_)=>{"use strict";var Ir;try{A_=Tn,Ir=A_("buffer").Buffer}catch{}var A_,_P=_e(),Fu=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
20
+ \r`;function yP(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Fu;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function vP(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Fu,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),Ir?Ir.from?Ir.from(a):new Ir(a):a}function xP(e){var t="",r=0,n,o,i=e.length,s=Fu;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function bP(e){return Ir&&Ir.isBuffer(e)}O_.exports=new _P("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yP,construct:vP,predicate:bP,represent:xP})});var N_=v((qZ,R_)=>{"use strict";var wP=_e(),$P=Object.prototype.hasOwnProperty,kP=Object.prototype.toString;function SP(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,kP.call(o)!=="[object Object]")return!1;for(i in o)if($P.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function zP(e){return e!==null?e:[]}R_.exports=new wP("tag:yaml.org,2002:omap",{kind:"sequence",resolve:SP,construct:zP})});var D_=v((FZ,j_)=>{"use strict";var EP=_e(),TP=Object.prototype.toString;function PP(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],TP.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function IP(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}j_.exports=new EP("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:PP,construct:IP})});var Z_=v((LZ,M_)=>{"use strict";var AP=_e(),OP=Object.prototype.hasOwnProperty;function CP(e){if(e===null)return!0;var t,r=e;for(t in r)if(OP.call(r,t)&&r[t]!==null)return!1;return!0}function RP(e){return e!==null?e:{}}M_.exports=new AP("tag:yaml.org,2002:set",{kind:"mapping",resolve:CP,construct:RP})});var yn=v((VZ,q_)=>{"use strict";var NP=Pr();q_.exports=new NP({include:[qu()],implicit:[T_(),I_()],explicit:[C_(),N_(),D_(),Z_()]})});var L_=v((UZ,F_)=>{"use strict";var jP=_e();function DP(){return!0}function MP(){}function ZP(){return""}function qP(e){return typeof e>"u"}F_.exports=new jP("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:DP,construct:MP,predicate:qP,represent:ZP})});var U_=v((HZ,V_)=>{"use strict";var FP=_e();function LP(e){if(e===null||e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),n="";return!(t[0]==="/"&&(r&&(n=r[1]),n.length>3||t[t.length-n.length-1]!=="/"))}function VP(e){var t=e,r=/\/([gim]*)$/.exec(e),n="";return t[0]==="/"&&(r&&(n=r[1]),t=t.slice(1,t.length-n.length-1)),new RegExp(t,n)}function UP(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function HP(e){return Object.prototype.toString.call(e)==="[object RegExp]"}V_.exports=new FP("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:LP,construct:VP,predicate:HP,represent:UP})});var K_=v((BZ,B_)=>{"use strict";var ps;try{H_=Tn,ps=H_("esprima")}catch{typeof window<"u"&&(ps=window.esprima)}var H_,BP=_e();function KP(e){if(e===null)return!1;try{var t="("+e+")",r=ps.parse(t,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function JP(e){var t="("+e+")",r=ps.parse(t,{range:!0}),n=[],o;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(i){n.push(i.name)}),o=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(n,t.slice(o[0]+1,o[1]-1)):new Function(n,"return "+t.slice(o[0],o[1]))}function WP(e){return e.toString()}function GP(e){return Object.prototype.toString.call(e)==="[object Function]"}B_.exports=new BP("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:KP,construct:JP,predicate:GP,represent:WP})});var No=v((JZ,W_)=>{"use strict";var J_=Pr();W_.exports=J_.DEFAULT=new J_({include:[yn()],explicit:[L_(),U_(),K_()]})});var hy=v((WZ,jo)=>{"use strict";var At=Tr(),ry=gn(),YP=r_(),ny=yn(),QP=No(),Gt=Object.prototype.hasOwnProperty,ms=1,oy=2,iy=3,hs=4,Lu=1,XP=2,G_=3,eI=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tI=/[\x85\u2028\u2029]/,rI=/[,\[\]\{\}]/,sy=/^(?:!|!!|![a-z\-]+!)$/i,ay=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Y_(e){return Object.prototype.toString.call(e)}function xt(e){return e===10||e===13}function Or(e){return e===9||e===32}function Ue(e){return e===9||e===32||e===10||e===13}function vn(e){return e===44||e===91||e===93||e===123||e===125}function nI(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function oI(e){return e===120?2:e===117?4:e===85?8:0}function iI(e){return 48<=e&&e<=57?e-48:-1}function Q_(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
21
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function sI(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function cy(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var uy=new Array(256),ly=new Array(256);for(Ar=0;Ar<256;Ar++)uy[Ar]=Q_(Ar)?1:0,ly[Ar]=Q_(Ar);var Ar;function aI(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||QP,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function dy(e,t){return new ry(t,new YP(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function R(e,t){throw dy(e,t)}function gs(e,t){e.onWarning&&e.onWarning.call(null,dy(e,t))}var X_={YAML:function(t,r,n){var o,i,s;t.version!==null&&R(t,"duplication of %YAML directive"),n.length!==1&&R(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&R(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&R(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&gs(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&R(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],sy.test(o)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),Gt.call(t.tagMap,o)&&R(t,'there is a previously declared suffix for "'+o+'" tag handle'),ay.test(i)||R(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[o]=i}};function Wt(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||R(e,"expected valid JSON character");else eI.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function ey(e,t,r,n){var o,i,s,a;for(At.isObject(r)||R(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],Gt.call(t,i)||(cy(t,i,r[i]),n[i]=!0)}function xn(e,t,r,n,o,i,s,a){var c,u;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,u=o.length;c<u;c+=1)Array.isArray(o[c])&&R(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Y_(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Y_(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(c=0,u=i.length;c<u;c+=1)ey(e,t,i[c],r);else ey(e,t,i,r);else!e.json&&!Gt.call(r,o)&&Gt.call(t,o)&&(e.line=s||e.line,e.position=a||e.position,R(e,"duplicated mapping key")),cy(t,o,i),delete r[o];return t}function Vu(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function he(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Or(o);)o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(xt(o))for(Vu(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&gs(e,"deficient indentation"),n}function _s(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Ue(r)))}function Uu(e,t){t===1?e.result+=" ":t>1&&(e.result+=At.repeat(`
22
+ `,t-1))}function cI(e,t,r){var n,o,i,s,a,c,u,l,d=e.kind,f=e.result,p;if(p=e.input.charCodeAt(e.position),Ue(p)||vn(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(o=e.input.charCodeAt(e.position+1),Ue(o)||r&&vn(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;p!==0;){if(p===58){if(o=e.input.charCodeAt(e.position+1),Ue(o)||r&&vn(o))break}else if(p===35){if(n=e.input.charCodeAt(e.position-1),Ue(n))break}else{if(e.position===e.lineStart&&_s(e)||r&&vn(p))break;if(xt(p))if(c=e.line,u=e.lineStart,l=e.lineIndent,he(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=u,e.lineIndent=l;break}}a&&(Wt(e,i,s,!1),Uu(e,e.line-c),i=s=e.position,a=!1),Or(p)||(s=e.position+1),p=e.input.charCodeAt(++e.position)}return Wt(e,i,s,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function uI(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Wt(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else xt(r)?(Wt(e,n,o,!0),Uu(e,he(e,!1,t)),n=o=e.position):e.position===e.lineStart&&_s(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function lI(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Wt(e,r,e.position,!0),e.position++,!0;if(a===92){if(Wt(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),xt(a))he(e,!1,t);else if(a<256&&uy[a])e.result+=ly[a],e.position++;else if((s=oI(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=nI(a))>=0?i=(i<<4)+s:R(e,"expected hexadecimal character");e.result+=sI(i),e.position++}else R(e,"unknown escape sequence");r=n=e.position}else xt(a)?(Wt(e,r,n,!0),Uu(e,he(e,!1,t)),r=n=e.position):e.position===e.lineStart&&_s(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function dI(e,t){var r=!0,n,o=e.tag,i,s=e.anchor,a,c,u,l,d,f={},p,m,h,g;if(g=e.input.charCodeAt(e.position),g===91)c=93,d=!1,i=[];else if(g===123)c=125,d=!0,i={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),g=e.input.charCodeAt(++e.position);g!==0;){if(he(e,!0,t),g=e.input.charCodeAt(e.position),g===c)return e.position++,e.tag=o,e.anchor=s,e.kind=d?"mapping":"sequence",e.result=i,!0;r||R(e,"missed comma between flow collection entries"),m=p=h=null,u=l=!1,g===63&&(a=e.input.charCodeAt(e.position+1),Ue(a)&&(u=l=!0,e.position++,he(e,!0,t))),n=e.line,bn(e,t,ms,!1,!0),m=e.tag,p=e.result,he(e,!0,t),g=e.input.charCodeAt(e.position),(l||e.line===n)&&g===58&&(u=!0,g=e.input.charCodeAt(++e.position),he(e,!0,t),bn(e,t,ms,!1,!0),h=e.result),d?xn(e,i,f,m,p,h):u?i.push(xn(e,null,f,m,p,h)):i.push(p),he(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(r=!0,g=e.input.charCodeAt(++e.position)):r=!1}R(e,"unexpected end of the stream within a flow collection")}function fI(e,t){var r,n,o=Lu,i=!1,s=!1,a=t,c=0,u=!1,l,d;if(d=e.input.charCodeAt(e.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Lu===o?o=d===43?G_:XP:R(e,"repeat of a chomping mode identifier");else if((l=iI(d))>=0)l===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?R(e,"repeat of an indentation width identifier"):(a=t+l-1,s=!0);else break;if(Or(d)){do d=e.input.charCodeAt(++e.position);while(Or(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!xt(d)&&d!==0)}for(;d!==0;){for(Vu(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),xt(d)){c++;continue}if(e.lineIndent<a){o===G_?e.result+=At.repeat(`
23
+ `,i?1+c:c):o===Lu&&i&&(e.result+=`
24
+ `);break}for(n?Or(d)?(u=!0,e.result+=At.repeat(`
25
+ `,i?1+c:c)):u?(u=!1,e.result+=At.repeat(`
26
+ `,c+1)):c===0?i&&(e.result+=" "):e.result+=At.repeat(`
27
+ `,c):e.result+=At.repeat(`
28
+ `,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!xt(d)&&d!==0;)d=e.input.charCodeAt(++e.position);Wt(e,r,e.position,!1)}return!0}function ty(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&!(c!==45||(s=e.input.charCodeAt(e.position+1),!Ue(s)));){if(a=!0,e.position++,he(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,bn(e,t,iy,!1,!0),i.push(e.result),he(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function pI(e,t,r){var n,o,i,s,a=e.tag,c=e.anchor,u={},l={},d=null,f=null,p=null,m=!1,h=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),g=e.input.charCodeAt(e.position);g!==0;){if(n=e.input.charCodeAt(e.position+1),i=e.line,s=e.position,(g===63||g===58)&&Ue(n))g===63?(m&&(xn(e,u,l,d,f,null),d=f=p=null),h=!0,m=!0,o=!0):m?(m=!1,o=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=n;else if(bn(e,r,oy,!1,!0))if(e.line===i){for(g=e.input.charCodeAt(e.position);Or(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),Ue(g)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(xn(e,u,l,d,f,null),d=f=p=null),h=!0,m=!1,o=!1,d=e.tag,f=e.result;else if(h)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=a,e.anchor=c,!0}else if(h)R(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=a,e.anchor=c,!0;else break;if((e.line===i||e.lineIndent>t)&&(bn(e,t,hs,!0,o)&&(m?f=e.result:p=e.result),m||(xn(e,u,l,d,f,p,i,s),d=f=p=null),he(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&xn(e,u,l,d,f,null),h&&(e.tag=a,e.anchor=c,e.kind="mapping",e.result=u),h}function mI(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&R(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Ue(s);)s===33&&(n?R(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),sy.test(o)||R(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),rI.test(i)&&R(e,"tag suffix cannot contain flow indicator characters")}return i&&!ay.test(i)&&R(e,"tag name cannot contain such characters: "+i),r?e.tag=i:Gt.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:R(e,'undeclared tag handle "'+o+'"'),!0}function hI(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ue(r)&&!vn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function gI(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ue(n)&&!vn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Gt.call(e.anchorMap,r)||R(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],he(e,!0,-1),!0}function bn(e,t,r,n,o){var i,s,a,c=1,u=!1,l=!1,d,f,p,m,h;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=hs===r||iy===r,n&&he(e,!0,-1)&&(u=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;mI(e)||hI(e);)he(e,!0,-1)?(u=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=u||o),(c===1||hs===r)&&(ms===r||oy===r?m=t:m=t+1,h=e.position-e.lineStart,c===1?a&&(ty(e,h)||pI(e,h,m))||dI(e,m)?l=!0:(s&&fI(e,m)||uI(e,m)||lI(e,m)?l=!0:gI(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):cI(e,m,ms===r)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(l=a&&ty(e,h))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(p=e.implicitTypes[d],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Gt.call(e.typeMap[e.kind||"fallback"],e.tag)?(p=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&p.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):R(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function _I(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(s=e.input.charCodeAt(e.position))!==0&&(he(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!Ue(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&R(e,"directive name must not be less than one character in length");s!==0;){for(;Or(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!xt(s));break}if(xt(s))break;for(r=e.position;s!==0&&!Ue(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&Vu(e),Gt.call(X_,n)?X_[n](e,n,o):gs(e,'unknown document directive "'+n+'"')}if(he(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,he(e,!0,-1)):i&&R(e,"directives end mark is expected"),bn(e,e.lineIndent-1,hs,!1,!0),he(e,!0,-1),e.checkLineBreaks&&tI.test(e.input.slice(t,e.position))&&gs(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&_s(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,he(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function fy(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
29
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new aI(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,R(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)_I(r);return r.documents}function py(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=fy(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function my(e,t){var r=fy(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ry("expected a single document in the stream, but found more")}}function yI(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),py(e,t,At.extend({schema:ny},r))}function vI(e,t){return my(e,At.extend({schema:ny},t))}jo.exports.loadAll=py;jo.exports.load=my;jo.exports.safeLoadAll=yI;jo.exports.safeLoad=vI});var My=v((GZ,Ju)=>{"use strict";var Mo=Tr(),Zo=gn(),xI=No(),bI=yn(),$y=Object.prototype.toString,ky=Object.prototype.hasOwnProperty,wI=9,Do=10,$I=13,kI=32,SI=33,zI=34,Sy=35,EI=37,TI=38,PI=39,II=42,zy=44,AI=45,Ey=58,OI=61,CI=62,RI=63,NI=64,Ty=91,Py=93,jI=96,Iy=123,DI=124,Ay=125,Ae={};Ae[0]="\\0";Ae[7]="\\a";Ae[8]="\\b";Ae[9]="\\t";Ae[10]="\\n";Ae[11]="\\v";Ae[12]="\\f";Ae[13]="\\r";Ae[27]="\\e";Ae[34]='\\"';Ae[92]="\\\\";Ae[133]="\\N";Ae[160]="\\_";Ae[8232]="\\L";Ae[8233]="\\P";var MI=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function ZI(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&ky.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function gy(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Zo("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Mo.repeat("0",n-t.length)+t}function qI(e){this.schema=e.schema||xI,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Mo.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ZI(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function _y(e,t){for(var r=Mo.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
30
+ `,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
31
+ `&&(i+=r),i+=s;return i}function Hu(e,t){return`
32
+ `+Mo.repeat(" ",e.indent*t)}function FI(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function Ku(e){return e===kI||e===wI}function wn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function LI(e){return wn(e)&&!Ku(e)&&e!==65279&&e!==$I&&e!==Do}function yy(e,t){return wn(e)&&e!==65279&&e!==zy&&e!==Ty&&e!==Py&&e!==Iy&&e!==Ay&&e!==Ey&&(e!==Sy||t&&LI(t))}function VI(e){return wn(e)&&e!==65279&&!Ku(e)&&e!==AI&&e!==RI&&e!==Ey&&e!==zy&&e!==Ty&&e!==Py&&e!==Iy&&e!==Ay&&e!==Sy&&e!==TI&&e!==II&&e!==SI&&e!==DI&&e!==OI&&e!==CI&&e!==PI&&e!==zI&&e!==EI&&e!==NI&&e!==jI}function Oy(e){var t=/^\n* /;return t.test(e)}var Cy=1,Ry=2,Ny=3,jy=4,ys=5;function UI(e,t,r,n,o){var i,s,a,c=!1,u=!1,l=n!==-1,d=-1,f=VI(e.charCodeAt(0))&&!Ku(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(s=e.charCodeAt(i),!wn(s))return ys;a=i>0?e.charCodeAt(i-1):null,f=f&&yy(s,a)}else{for(i=0;i<e.length;i++){if(s=e.charCodeAt(i),s===Do)c=!0,l&&(u=u||i-d-1>n&&e[d+1]!==" ",d=i);else if(!wn(s))return ys;a=i>0?e.charCodeAt(i-1):null,f=f&&yy(s,a)}u=u||l&&i-d-1>n&&e[d+1]!==" "}return!c&&!u?f&&!o(e)?Cy:Ry:r>9&&Oy(e)?ys:u?jy:Ny}function HI(e,t,r,n){e.dump=(function(){if(t.length===0)return"''";if(!e.noCompatMode&&MI.indexOf(t)!==-1)return"'"+t+"'";var o=e.indent*Math.max(1,r),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=n||e.flowLevel>-1&&r>=e.flowLevel;function a(c){return FI(e,c)}switch(UI(t,s,e.indent,i,a)){case Cy:return t;case Ry:return"'"+t.replace(/'/g,"''")+"'";case Ny:return"|"+vy(t,e.indent)+xy(_y(t,o));case jy:return">"+vy(t,e.indent)+xy(_y(BI(t,i),o));case ys:return'"'+KI(t,i)+'"';default:throw new Zo("impossible error: invalid scalar style")}})()}function vy(e,t){var r=Oy(e)?String(t):"",n=e[e.length-1]===`
33
+ `,o=n&&(e[e.length-2]===`
34
+ `||e===`
35
+ `),i=o?"+":n?"":"-";return r+i+`
36
+ `}function xy(e){return e[e.length-1]===`
37
+ `?e.slice(0,-1):e}function BI(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=e.indexOf(`
38
+ `);return u=u!==-1?u:e.length,r.lastIndex=u,by(e.slice(0,u),t)})(),o=e[0]===`
39
+ `||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
40
+ `:"")+by(c,t),o=i}return n}function by(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
41
+ `+e.slice(o,i),o=i+1),s=a;return c+=`
42
+ `,e.length-o>t&&s>o?c+=e.slice(o,s)+`
43
+ `+e.slice(s+1):c+=e.slice(o),c.slice(1)}function KI(e){for(var t="",r,n,o,i=0;i<e.length;i++){if(r=e.charCodeAt(i),r>=55296&&r<=56319&&(n=e.charCodeAt(i+1),n>=56320&&n<=57343)){t+=gy((r-55296)*1024+n-56320+65536),i++;continue}o=Ae[r],t+=!o&&wn(r)?e[i]:o||gy(r)}return t}function JI(e,t,r){var n="",o=e.tag,i,s;for(i=0,s=r.length;i<s;i+=1)Cr(e,t,r[i],!1,!1)&&(i!==0&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function WI(e,t,r,n){var o="",i=e.tag,s,a;for(s=0,a=r.length;s<a;s+=1)Cr(e,t+1,r[s],!0,!0)&&((!n||s!==0)&&(o+=Hu(e,t)),e.dump&&Do===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function GI(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,u,l;for(s=0,a=i.length;s<a;s+=1)l="",s!==0&&(l+=", "),e.condenseFlow&&(l+='"'),c=i[s],u=r[c],Cr(e,t,c,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Cr(e,t,u,!1,!1)&&(l+=e.dump,n+=l));e.tag=o,e.dump="{"+n+"}"}function YI(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,u,l,d,f;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Zo("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)f="",(!n||a!==0)&&(f+=Hu(e,t)),u=s[a],l=r[u],Cr(e,t+1,u,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Do===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Hu(e,t)),Cr(e,t+1,l,!0,d)&&(e.dump&&Do===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=i,e.dump=o||"{}"}function wy(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(e.tag=r?a.tag:"?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,$y.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(ky.call(a.represent,c))n=a.represent[c](t,c);else throw new Zo("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Cr(e,t,r,n,o,i){e.tag=null,e.dump=r,wy(e,r,!1)||wy(e,r,!0);var s=$y.call(e.dump);n&&(n=e.flowLevel<0||e.flowLevel>t);var a=s==="[object Object]"||s==="[object Array]",c,u;if(a&&(c=e.duplicates.indexOf(r),u=c!==-1),(e.tag!==null&&e.tag!=="?"||u||e.indent!==2&&t>0)&&(o=!1),u&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(a&&u&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),s==="[object Object]")n&&Object.keys(e.dump).length!==0?(YI(e,t,e.dump,o),u&&(e.dump="&ref_"+c+e.dump)):(GI(e,t,e.dump),u&&(e.dump="&ref_"+c+" "+e.dump));else if(s==="[object Array]"){var l=e.noArrayIndent&&t>0?t-1:t;n&&e.dump.length!==0?(WI(e,l,e.dump,o),u&&(e.dump="&ref_"+c+e.dump)):(JI(e,l,e.dump),u&&(e.dump="&ref_"+c+" "+e.dump))}else if(s==="[object String]")e.tag!=="?"&&HI(e,e.dump,t,i);else{if(e.skipInvalid)return!1;throw new Zo("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function QI(e,t){var r=[],n=[],o,i;for(Bu(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function Bu(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)Bu(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)Bu(e[n[o]],t,r)}function Dy(e,t){t=t||{};var r=new qI(t);return r.noRefs||QI(e,r),Cr(r,0,e,!0,!0)?r.dump+`
44
+ `:""}function XI(e,t){return Dy(e,Mo.extend({schema:bI},t))}Ju.exports.dump=Dy;Ju.exports.safeDump=XI});var qy=v((YZ,pe)=>{"use strict";var vs=hy(),Zy=My();function xs(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}pe.exports.Type=_e();pe.exports.Schema=Pr();pe.exports.FAILSAFE_SCHEMA=fs();pe.exports.JSON_SCHEMA=Zu();pe.exports.CORE_SCHEMA=qu();pe.exports.DEFAULT_SAFE_SCHEMA=yn();pe.exports.DEFAULT_FULL_SCHEMA=No();pe.exports.load=vs.load;pe.exports.loadAll=vs.loadAll;pe.exports.safeLoad=vs.safeLoad;pe.exports.safeLoadAll=vs.safeLoadAll;pe.exports.dump=Zy.dump;pe.exports.safeDump=Zy.safeDump;pe.exports.YAMLException=gn();pe.exports.MINIMAL_SCHEMA=fs();pe.exports.SAFE_SCHEMA=yn();pe.exports.DEFAULT_SCHEMA=No();pe.exports.scan=xs("scan");pe.exports.parse=xs("parse");pe.exports.compose=xs("compose");pe.exports.addConstructor=xs("addConstructor")});var Ly=v((QZ,Fy)=>{"use strict";var eA=qy();Fy.exports=eA});var Wu=v((exports,module)=>{"use strict";var yaml=Ly(),engines=exports=module.exports;engines.yaml={parse:yaml.safeLoad.bind(yaml),stringify:yaml.safeDump.bind(yaml)};engines.json={parse:JSON.parse.bind(JSON),stringify:function(e,t){let r=Object.assign({replacer:null,space:2},t);return JSON.stringify(e,r.replacer,r.space)}};engines.javascript={parse:function parse(str,options,wrap){try{return wrap!==!1&&(str=`(function() {
45
+ return `+str.trim()+`;
46
+ }());`),eval(str)||{}}catch(e){if(wrap!==!1&&/(unexpected|identifier)/i.test(e.message))return parse(str,options,!1);throw new SyntaxError(e)}},stringify:function(){throw new Error("stringifying JavaScript is not supported")}}});var Uy=v((XZ,Vy)=>{"use strict";Vy.exports=function(e){return typeof e=="string"&&e.charAt(0)==="\uFEFF"?e.slice(1):e}});var bs=v(Ot=>{"use strict";var Hy=Uy(),By=Co();Ot.define=function(e,t,r){Reflect.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:r})};Ot.isBuffer=function(e){return By(e)==="buffer"};Ot.isObject=function(e){return By(e)==="object"};Ot.toBuffer=function(e){return typeof e=="string"?Buffer.from(e):e};Ot.toString=function(e){if(Ot.isBuffer(e))return Hy(String(e));if(typeof e!="string")throw new TypeError("expected input to be a string or buffer");return Hy(e)};Ot.arrayify=function(e){return e?Array.isArray(e)?e:[e]:[]};Ot.startsWith=function(e,t,r){return typeof r!="number"&&(r=t.length),e.slice(0,r)===t}});var qo=v((tq,Ky)=>{"use strict";var tA=Wu(),rA=bs();Ky.exports=function(e){let t=Object.assign({},e);return t.delimiters=rA.arrayify(t.delims||t.delimiters||"---"),t.delimiters.length===1&&t.delimiters.push(t.delimiters[0]),t.language=(t.language||t.lang||"yaml").toLowerCase(),t.engines=Object.assign({},tA,t.parsers,t.engines),t}});var Gu=v((rq,Jy)=>{"use strict";Jy.exports=function(e,t){let r=t.engines[e]||t.engines[nA(e)];if(typeof r>"u")throw new Error('gray-matter engine "'+e+'" is not registered');return typeof r=="function"&&(r={parse:r}),r};function nA(e){switch(e.toLowerCase()){case"js":case"javascript":return"javascript";case"coffee":case"coffeescript":case"cson":return"coffee";case"yaml":case"yml":return"yaml";default:return e}}});var Yu=v((nq,Wy)=>{"use strict";var oA=Co(),iA=Gu(),sA=qo();Wy.exports=function(e,t,r){if(t==null&&r==null)switch(oA(e)){case"object":t=e.data,r={};break;case"string":return e;default:throw new TypeError("expected file to be a string or object")}let n=e.content,o=sA(r);if(t==null){if(!o.data)return e;t=o.data}let i=e.language||o.language,s=iA(i,o);if(typeof s.stringify!="function")throw new TypeError('expected "'+i+'.stringify" to be a function');t=Object.assign({},e.data,t);let a=o.delimiters[0],c=o.delimiters[1],u=s.stringify(t,r).trim(),l="";return u!=="{}"&&(l=$n(a)+$n(u)+$n(c)),typeof e.excerpt=="string"&&e.excerpt!==""&&n.indexOf(e.excerpt.trim())===-1&&(l+=$n(e.excerpt)+$n(c)),l+$n(n)};function $n(e){return e.slice(-1)!==`
47
+ `?e+`
48
+ `:e}});var Yy=v((oq,Gy)=>{"use strict";var aA=qo();Gy.exports=function(e,t){let r=aA(t);if(e.data==null&&(e.data={}),typeof r.excerpt=="function")return r.excerpt(e,r);let n=e.data.excerpt_separator||r.excerpt_separator;if(n==null&&(r.excerpt===!1||r.excerpt==null))return e;let o=typeof r.excerpt=="string"?r.excerpt:n||r.delimiters[0],i=e.content.indexOf(o);return i!==-1&&(e.excerpt=e.content.slice(0,i)),e}});var ev=v((iq,Xy)=>{"use strict";var Qy=Co(),cA=Yu(),kn=bs();Xy.exports=function(e){return Qy(e)!=="object"&&(e={content:e}),Qy(e.data)!=="object"&&(e.data={}),e.contents&&e.content==null&&(e.content=e.contents),kn.define(e,"orig",kn.toBuffer(e.content)),kn.define(e,"language",e.language||""),kn.define(e,"matter",e.matter||""),kn.define(e,"stringify",function(t,r){return r&&r.language&&(e.language=r.language),cA(e,t,r)}),e.content=kn.toString(e.content),e.isEmpty=!1,e.excerpt="",e}});var rv=v((sq,tv)=>{"use strict";var uA=Gu(),lA=qo();tv.exports=function(e,t,r){let n=lA(r),o=uA(e,n);if(typeof o.parse!="function")throw new TypeError('expected "'+e+'.parse" to be a function');return o.parse(t,n)}});var sv=v((aq,iv)=>{"use strict";var dA=Tn("fs"),fA=Yg(),Qu=qo(),pA=Yu(),nv=Yy(),mA=Wu(),hA=ev(),gA=rv(),ov=bs();function je(e,t){if(e==="")return{data:{},content:e,excerpt:"",orig:e};let r=hA(e),n=je.cache[r.content];if(!t){if(n)return r=Object.assign({},n),r.orig=n.orig,r;je.cache[r.content]=r}return _A(r,t)}function _A(e,t){let r=Qu(t),n=r.delimiters[0],o=`
49
+ `+r.delimiters[1],i=e.content;r.language&&(e.language=r.language);let s=n.length;if(!ov.startsWith(i,n,s))return nv(e,r),e;if(i.charAt(s)===n.slice(-1))return e;i=i.slice(s);let a=i.length,c=je.language(i,r);c.name&&(e.language=c.name,i=i.slice(c.raw.length));let u=i.indexOf(o);return u===-1&&(u=a),e.matter=i.slice(0,u),e.matter.replace(/^\s*#[^\n]+/gm,"").trim()===""?(e.isEmpty=!0,e.empty=e.content,e.data={}):e.data=gA(e.language,e.matter,r),u===a?e.content="":(e.content=i.slice(u+o.length),e.content[0]==="\r"&&(e.content=e.content.slice(1)),e.content[0]===`
50
+ `&&(e.content=e.content.slice(1))),nv(e,r),(r.sections===!0||typeof r.section=="function")&&fA(e,r.section),e}je.engines=mA;je.stringify=function(e,t,r){return typeof e=="string"&&(e=je(e,r)),pA(e,t,r)};je.read=function(e,t){let r=dA.readFileSync(e,"utf8"),n=je(r,t);return n.path=e,n};je.test=function(e,t){return ov.startsWith(e,Qu(t).delimiters[0])};je.language=function(e,t){let n=Qu(t).delimiters[0];je.test(e)&&(e=e.slice(n.length));let o=e.slice(0,e.search(/\r?\n/));return{raw:o,name:o?o.trim():""}};je.cache={};je.clearCache=function(){je.cache={}};iv.exports=je});function Oe(e){console.error(`VisuallyJs MCP: ${e}`)}import{readFileSync as Ev}from"fs";var ft={};As(ft,{BRAND:()=>d0,DIRTY:()=>Yt,EMPTY_PATH:()=>Vv,INVALID:()=>O,NEVER:()=>W0,OK:()=>ze,ParseStatus:()=>xe,Schema:()=>q,ZodAny:()=>Nt,ZodArray:()=>kt,ZodBigInt:()=>Xt,ZodBoolean:()=>er,ZodBranded:()=>In,ZodCatch:()=>dr,ZodDate:()=>tr,ZodDefault:()=>lr,ZodDiscriminatedUnion:()=>Ho,ZodEffects:()=>Je,ZodEnum:()=>cr,ZodError:()=>De,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Ko,ZodIntersection:()=>ir,ZodIssueCode:()=>b,ZodLazy:()=>sr,ZodLiteral:()=>ar,ZodMap:()=>qr,ZodNaN:()=>Lr,ZodNativeEnum:()=>ur,ZodNever:()=>rt,ZodNull:()=>nr,ZodNullable:()=>dt,ZodNumber:()=>Qt,ZodObject:()=>Me,ZodOptional:()=>Be,ZodParsedType:()=>S,ZodPipeline:()=>An,ZodPromise:()=>jt,ZodReadonly:()=>fr,ZodRecord:()=>Bo,ZodSchema:()=>q,ZodSet:()=>Fr,ZodString:()=>Rt,ZodSymbol:()=>Mr,ZodTransformer:()=>Je,ZodTuple:()=>lt,ZodType:()=>q,ZodUndefined:()=>rr,ZodUnion:()=>or,ZodUnknown:()=>$t,ZodVoid:()=>Zr,addIssueToContext:()=>k,any:()=>x0,array:()=>k0,bigint:()=>h0,boolean:()=>wl,coerce:()=>J0,custom:()=>vl,date:()=>g0,datetimeRegex:()=>_l,defaultErrorMap:()=>bt,discriminatedUnion:()=>T0,effect:()=>q0,enum:()=>D0,function:()=>R0,getErrorMap:()=>Nr,getParsedType:()=>ut,instanceof:()=>p0,intersection:()=>P0,isAborted:()=>Vo,isAsync:()=>jr,isDirty:()=>Uo,isValid:()=>Ct,late:()=>f0,lazy:()=>N0,literal:()=>j0,makeIssue:()=>Pn,map:()=>O0,nan:()=>m0,nativeEnum:()=>M0,never:()=>w0,null:()=>v0,nullable:()=>L0,number:()=>bl,object:()=>S0,objectUtil:()=>Cs,oboolean:()=>K0,onumber:()=>B0,optional:()=>F0,ostring:()=>H0,pipeline:()=>U0,preprocess:()=>V0,promise:()=>Z0,quotelessJson:()=>qv,record:()=>A0,set:()=>C0,setErrorMap:()=>Lv,strictObject:()=>z0,string:()=>xl,symbol:()=>_0,transformer:()=>q0,tuple:()=>I0,undefined:()=>y0,union:()=>E0,unknown:()=>b0,util:()=>U,void:()=>$0});var U;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(U||(U={}));var Cs;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Cs||(Cs={}));var S=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ut=e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(e)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}};var b=U.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qv=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),De=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};De.create=e=>new De(e);var Fv=(e,t)=>{let r;switch(e.code){case b.invalid_type:e.received===S.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case b.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,U.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:r=`Unrecognized key(s) in object: ${U.joinValues(e.keys,", ")}`;break;case b.invalid_union:r="Invalid input";break;case b.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${U.joinValues(e.options)}`;break;case b.invalid_enum_value:r=`Invalid enum value. Expected ${U.joinValues(e.options)}, received '${e.received}'`;break;case b.invalid_arguments:r="Invalid function arguments";break;case b.invalid_return_type:r="Invalid function return type";break;case b.invalid_date:r="Invalid date";break;case b.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:U.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case b.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case b.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case b.custom:r="Invalid input";break;case b.invalid_intersection_types:r="Intersection results could not be merged";break;case b.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case b.not_finite:r="Number must be finite";break;default:r=t.defaultError,U.assertNever(e)}return{message:r}},bt=Fv;var fl=bt;function Lv(e){fl=e}function Nr(){return fl}var Pn=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},Vv=[];function k(e,t){let r=Nr(),n=Pn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===bt?void 0:bt].filter(o=>!!o)});e.common.issues.push(n)}var xe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return O;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return O;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},O=Object.freeze({status:"aborted"}),Yt=e=>({status:"dirty",value:e}),ze=e=>({status:"valid",value:e}),Vo=e=>e.status==="aborted",Uo=e=>e.status==="dirty",Ct=e=>e.status==="valid",jr=e=>typeof Promise<"u"&&e instanceof Promise;var E;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(E||(E={}));var Ke=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},pl=(e,t)=>{if(Ct(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new De(e.common.issues);return this._error=r,this._error}}};function D(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}var q=class{get description(){return this._def.description}_getType(t){return ut(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ut(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new xe,ctx:{common:t.parent.common,data:t.data,parsedType:ut(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(jr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ut(t)},o=this._parseSync({data:t,path:n.path,parent:n});return pl(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ut(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ct(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Ct(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ut(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(jr(o)?o:Promise.resolve(o));return pl(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:b.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Je({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Be.create(this,this._def)}nullable(){return dt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this)}promise(){return jt.create(this,this._def)}or(t){return or.create([this,t],this._def)}and(t){return ir.create(this,t,this._def)}transform(t){return new Je({...D(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new lr({...D(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new In({typeName:N.ZodBranded,type:this,...D(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new dr({...D(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return An.create(this,t)}readonly(){return fr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Uv=/^c[^\s-]{8,}$/i,Hv=/^[0-9a-z]+$/,Bv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Kv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jv=/^[a-z0-9_-]{21}$/i,Wv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Yv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rs,Xv=/^(?:(?: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])$/,e0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,t0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,n0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,o0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hl="((\\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])))",i0=new RegExp(`^${hl}$`);function gl(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function s0(e){return new RegExp(`^${gl(e)}$`)}function _l(e){let t=`${hl}T${gl(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function a0(e,t){return!!((t==="v4"||!t)&&Xv.test(e)||(t==="v6"||!t)&&t0.test(e))}function c0(e,t){if(!Wv.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function u0(e,t){return!!((t==="v4"||!t)&&e0.test(e)||(t==="v6"||!t)&&r0.test(e))}var Rt=class e extends q{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let i=this._getOrReturnCtx(t);return k(i,{code:b.invalid_type,expected:S.string,received:i.parsedType}),O}let n=new xe,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),k(o,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),k(o,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?k(o,{code:b.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&k(o,{code:b.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Yv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"email",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Rs||(Rs=new RegExp(Qv,"u")),Rs.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"emoji",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Kv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"uuid",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Jv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"nanoid",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Uv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"cuid",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Hv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"cuid2",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Bv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"ulid",code:b.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),k(o,{validation:"url",code:b.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"regex",code:b.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?_l(i).test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?i0.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?s0(i).test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{code:b.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Gv.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"duration",code:b.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?a0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"ip",code:b.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?c0(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"jwt",code:b.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?u0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"cidr",code:b.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?n0.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"base64",code:b.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?o0.test(t.data)||(o=this._getOrReturnCtx(t,o),k(o,{validation:"base64url",code:b.invalid_string,message:i.message}),n.dirty()):U.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:b.invalid_string,...E.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...E.errToObj(t)})}url(t){return this._addCheck({kind:"url",...E.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...E.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...E.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...E.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...E.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...E.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...E.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...E.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...E.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...E.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...E.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...E.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...E.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...E.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...E.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...E.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...E.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...E.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...E.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...E.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...E.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...E.errToObj(r)})}nonempty(t){return this.min(1,E.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Rt.create=e=>new Rt({checks:[],typeName:N.ZodString,coerce:e?.coerce??!1,...D(e)});function l0(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}var Qt=class e extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==S.number){let i=this._getOrReturnCtx(t);return k(i,{code:b.invalid_type,expected:S.number,received:i.parsedType}),O}let n,o=new xe;for(let i of this._def.checks)i.kind==="int"?U.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),k(n,{code:b.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?l0(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),k(n,{code:b.not_finite,message:i.message}),o.dirty()):U.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,E.toString(r))}gt(t,r){return this.setLimit("min",t,!1,E.toString(r))}lte(t,r){return this.setLimit("max",t,!0,E.toString(r))}lt(t,r){return this.setLimit("max",t,!1,E.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:E.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:E.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:E.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:E.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&U.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Qt.create=e=>new Qt({checks:[],typeName:N.ZodNumber,coerce:e?.coerce||!1,...D(e)});var Xt=class e extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,o=new xe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),k(n,{code:b.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):U.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return k(r,{code:b.invalid_type,expected:S.bigint,received:r.parsedType}),O}gte(t,r){return this.setLimit("min",t,!0,E.toString(r))}gt(t,r){return this.setLimit("min",t,!1,E.toString(r))}lte(t,r){return this.setLimit("max",t,!0,E.toString(r))}lt(t,r){return this.setLimit("max",t,!1,E.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:E.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:E.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Xt.create=e=>new Xt({checks:[],typeName:N.ZodBigInt,coerce:e?.coerce??!1,...D(e)});var er=class extends q{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.boolean,received:n.parsedType}),O}return ze(t.data)}};er.create=e=>new er({typeName:N.ZodBoolean,coerce:e?.coerce||!1,...D(e)});var tr=class e extends q{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let i=this._getOrReturnCtx(t);return k(i,{code:b.invalid_type,expected:S.date,received:i.parsedType}),O}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return k(i,{code:b.invalid_date}),O}let n=new xe,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),k(o,{code:b.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),k(o,{code:b.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):U.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:E.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:E.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};tr.create=e=>new tr({checks:[],coerce:e?.coerce||!1,typeName:N.ZodDate,...D(e)});var Mr=class extends q{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.symbol,received:n.parsedType}),O}return ze(t.data)}};Mr.create=e=>new Mr({typeName:N.ZodSymbol,...D(e)});var rr=class extends q{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.undefined,received:n.parsedType}),O}return ze(t.data)}};rr.create=e=>new rr({typeName:N.ZodUndefined,...D(e)});var nr=class extends q{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.null,received:n.parsedType}),O}return ze(t.data)}};nr.create=e=>new nr({typeName:N.ZodNull,...D(e)});var Nt=class extends q{constructor(){super(...arguments),this._any=!0}_parse(t){return ze(t.data)}};Nt.create=e=>new Nt({typeName:N.ZodAny,...D(e)});var $t=class extends q{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ze(t.data)}};$t.create=e=>new $t({typeName:N.ZodUnknown,...D(e)});var rt=class extends q{_parse(t){let r=this._getOrReturnCtx(t);return k(r,{code:b.invalid_type,expected:S.never,received:r.parsedType}),O}};rt.create=e=>new rt({typeName:N.ZodNever,...D(e)});var Zr=class extends q{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.void,received:n.parsedType}),O}return ze(t.data)}};Zr.create=e=>new Zr({typeName:N.ZodVoid,...D(e)});var kt=class e extends q{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==S.array)return k(r,{code:b.invalid_type,expected:S.array,received:r.parsedType}),O;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(k(r,{code:s?b.too_big:b.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(k(r,{code:b.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(k(r,{code:b.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new Ke(r,s,r.path,a)))).then(s=>xe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Ke(r,s,r.path,a)));return xe.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:E.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:E.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:E.toString(r)}})}nonempty(t){return this.min(1,t)}};kt.create=(e,t)=>new kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...D(t)});function Dr(e){if(e instanceof Me){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Be.create(Dr(n))}return new Me({...e._def,shape:()=>t})}else return e instanceof kt?new kt({...e._def,type:Dr(e.element)}):e instanceof Be?Be.create(Dr(e.unwrap())):e instanceof dt?dt.create(Dr(e.unwrap())):e instanceof lt?lt.create(e.items.map(t=>Dr(t))):e}var Me=class e extends q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=U.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==S.object){let u=this._getOrReturnCtx(t);return k(u,{code:b.invalid_type,expected:S.object,received:u.parsedType}),O}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof rt&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=i[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ke(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof rt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(k(o,{code:b.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ke(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>xe.mergeObjectSync(n,u)):xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return E.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:E.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:N.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of U.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of U.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Dr(this)}partial(t){let r={};for(let n of U.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of U.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Be;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return yl(U.objectKeys(this.shape))}};Me.create=(e,t)=>new Me({shape:()=>e,unknownKeys:"strip",catchall:rt.create(),typeName:N.ZodObject,...D(t)});Me.strictCreate=(e,t)=>new Me({shape:()=>e,unknownKeys:"strict",catchall:rt.create(),typeName:N.ZodObject,...D(t)});Me.lazycreate=(e,t)=>new Me({shape:e,unknownKeys:"strip",catchall:rt.create(),typeName:N.ZodObject,...D(t)});var or=class extends q{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new De(a.ctx.common.issues));return k(r,{code:b.invalid_union,unionErrors:s}),O}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(c=>new De(c));return k(r,{code:b.invalid_union,unionErrors:a}),O}}get options(){return this._def.options}};or.create=(e,t)=>new or({options:e,typeName:N.ZodUnion,...D(t)});var wt=e=>e instanceof sr?wt(e.schema):e instanceof Je?wt(e.innerType()):e instanceof ar?[e.value]:e instanceof cr?e.options:e instanceof ur?U.objectValues(e.enum):e instanceof lr?wt(e._def.innerType):e instanceof rr?[void 0]:e instanceof nr?[null]:e instanceof Be?[void 0,...wt(e.unwrap())]:e instanceof dt?[null,...wt(e.unwrap())]:e instanceof In||e instanceof fr?wt(e.unwrap()):e instanceof dr?wt(e._def.innerType):[],Ho=class e extends q{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return k(r,{code:b.invalid_type,expected:S.object,received:r.parsedType}),O;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(k(r,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),O)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=wt(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:N.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...D(n)})}};function Ns(e,t){let r=ut(e),n=ut(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let o=U.objectKeys(t),i=U.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Ns(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=Ns(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ir=class extends q{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Vo(i)||Vo(s))return O;let a=Ns(i.value,s.value);return a.valid?((Uo(i)||Uo(s))&&r.dirty(),{status:r.value,value:a.data}):(k(n,{code:b.invalid_intersection_types}),O)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ir.create=(e,t,r)=>new ir({left:e,right:t,typeName:N.ZodIntersection,...D(r)});var lt=class e extends q{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return k(n,{code:b.invalid_type,expected:S.array,received:n.parsedType}),O;if(n.data.length<this._def.items.length)return k(n,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Ke(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>xe.mergeArray(r,s)):xe.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};lt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lt({items:e,typeName:N.ZodTuple,rest:null,...D(t)})};var Bo=class e extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.object)return k(n,{code:b.invalid_type,expected:S.object,received:n.parsedType}),O;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Ke(n,a,n.path,a)),value:s._parse(new Ke(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?xe.mergeObjectAsync(r,o):xe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof q?new e({keyType:t,valueType:r,typeName:N.ZodRecord,...D(n)}):new e({keyType:Rt.create(),valueType:t,typeName:N.ZodRecord,...D(r)})}},qr=class extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.map)return k(n,{code:b.invalid_type,expected:S.map,received:n.parsedType}),O;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new Ke(n,a,n.path,[u,"key"])),value:i._parse(new Ke(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return O;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return O;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};qr.create=(e,t,r)=>new qr({valueType:t,keyType:e,typeName:N.ZodMap,...D(r)});var Fr=class e extends q{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return k(n,{code:b.invalid_type,expected:S.set,received:n.parsedType}),O;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(k(n,{code:b.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(k(n,{code:b.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return O;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new Ke(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:E.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:E.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fr.create=(e,t)=>new Fr({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,...D(t)});var Ko=class e extends q{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return k(r,{code:b.invalid_type,expected:S.function,received:r.parsedType}),O;function n(a,c){return Pn({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nr(),bt].filter(u=>!!u),issueData:{code:b.invalid_arguments,argumentsError:c}})}function o(a,c){return Pn({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nr(),bt].filter(u=>!!u),issueData:{code:b.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof jt){let a=this;return ze(async function(...c){let u=new De([]),l=await a._def.args.parseAsync(c,i).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(p=>{throw u.addIssue(o(d,p)),u})})}else{let a=this;return ze(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new De([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new De([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:lt.create(t).rest($t.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||lt.create([]).rest($t.create()),returns:r||$t.create(),typeName:N.ZodFunction,...D(n)})}},sr=class extends q{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};sr.create=(e,t)=>new sr({getter:e,typeName:N.ZodLazy,...D(t)});var ar=class extends q{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return k(r,{received:r.data,code:b.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:t.data}}get value(){return this._def.value}};ar.create=(e,t)=>new ar({value:e,typeName:N.ZodLiteral,...D(t)});function yl(e,t){return new cr({values:e,typeName:N.ZodEnum,...D(t)})}var cr=class e extends q{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return k(r,{expected:U.joinValues(n),received:r.parsedType,code:b.invalid_type}),O}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return k(r,{received:r.data,code:b.invalid_enum_value,options:n}),O}return ze(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};cr.create=yl;var ur=class extends q{_parse(t){let r=U.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let o=U.objectValues(r);return k(n,{expected:U.joinValues(o),received:n.parsedType,code:b.invalid_type}),O}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=U.objectValues(r);return k(n,{received:n.data,code:b.invalid_enum_value,options:o}),O}return ze(t.data)}get enum(){return this._def.values}};ur.create=(e,t)=>new ur({values:e,typeName:N.ZodNativeEnum,...D(t)});var jt=class extends q{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return k(r,{code:b.invalid_type,expected:S.promise,received:r.parsedType}),O;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return ze(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jt.create=(e,t)=>new jt({type:e,typeName:N.ZodPromise,...D(t)});var Je=class extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{k(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return O;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?O:c.status==="dirty"?Yt(c.value):r.value==="dirty"?Yt(c.value):c});{if(r.value==="aborted")return O;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?O:a.status==="dirty"?Yt(a.value):r.value==="dirty"?Yt(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?O:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?O:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ct(s))return O;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ct(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):O);U.assertNever(o)}};Je.create=(e,t,r)=>new Je({schema:e,typeName:N.ZodEffects,effect:t,...D(r)});Je.createWithPreprocess=(e,t,r)=>new Je({schema:t,effect:{type:"preprocess",transform:e},typeName:N.ZodEffects,...D(r)});var Be=class extends q{_parse(t){return this._getType(t)===S.undefined?ze(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Be.create=(e,t)=>new Be({innerType:e,typeName:N.ZodOptional,...D(t)});var dt=class extends q{_parse(t){return this._getType(t)===S.null?ze(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};dt.create=(e,t)=>new dt({innerType:e,typeName:N.ZodNullable,...D(t)});var lr=class extends q{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:N.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...D(t)});var dr=class extends q{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return jr(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new De(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new De(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};dr.create=(e,t)=>new dr({innerType:e,typeName:N.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...D(t)});var Lr=class extends q{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return k(n,{code:b.invalid_type,expected:S.nan,received:n.parsedType}),O}return{status:"valid",value:t.data}}};Lr.create=e=>new Lr({typeName:N.ZodNaN,...D(e)});var d0=Symbol("zod_brand"),In=class extends q{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},An=class e extends q{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?O:i.status==="dirty"?(r.dirty(),Yt(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?O:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:N.ZodPipeline})}},fr=class extends q{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Ct(o)&&(o.value=Object.freeze(o.value)),o);return jr(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};fr.create=(e,t)=>new fr({innerType:e,typeName:N.ZodReadonly,...D(t)});function ml(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function vl(e,t={},r){return e?Nt.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=ml(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=ml(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Nt.create()}var f0={object:Me.lazycreate},N;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(N||(N={}));var p0=(e,t={message:`Input not instance of ${e.name}`})=>vl(r=>r instanceof e,t),xl=Rt.create,bl=Qt.create,m0=Lr.create,h0=Xt.create,wl=er.create,g0=tr.create,_0=Mr.create,y0=rr.create,v0=nr.create,x0=Nt.create,b0=$t.create,w0=rt.create,$0=Zr.create,k0=kt.create,S0=Me.create,z0=Me.strictCreate,E0=or.create,T0=Ho.create,P0=ir.create,I0=lt.create,A0=Bo.create,O0=qr.create,C0=Fr.create,R0=Ko.create,N0=sr.create,j0=ar.create,D0=cr.create,M0=ur.create,Z0=jt.create,q0=Je.create,F0=Be.create,L0=dt.create,V0=Je.createWithPreprocess,U0=An.create,H0=()=>xl().optional(),B0=()=>bl().optional(),K0=()=>wl().optional(),J0={string:(e=>Rt.create({...e,coerce:!0})),number:(e=>Qt.create({...e,coerce:!0})),boolean:(e=>er.create({...e,coerce:!0})),bigint:(e=>Xt.create({...e,coerce:!0})),date:(e=>tr.create({...e,coerce:!0}))};var W0=O;var fO=Object.freeze({status:"aborted"});function y(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let l in s.prototype)l in a||Object.defineProperty(a,l,{value:s.prototype[l].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var St=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Jo={};function We(e){return e&&Object.assign(Jo,e),Jo}var Y={};As(Y,{BIGINT_FORMAT_RANGES:()=>kl,Class:()=>Ds,NUMBER_FORMAT_RANGES:()=>Hs,aborted:()=>mr,allowsEval:()=>Ls,assert:()=>ex,assertEqual:()=>G0,assertIs:()=>Q0,assertNever:()=>X0,assertNotEqual:()=>Y0,assignProp:()=>Fs,cached:()=>Cn,captureStackTrace:()=>Go,cleanEnum:()=>px,cleanRegex:()=>Nn,clone:()=>pt,createTransparentProxy:()=>sx,defineLazy:()=>te,esc:()=>pr,escapeRegex:()=>Dt,extend:()=>ux,finalizeIssue:()=>nt,floatSafeRemainder:()=>qs,getElementAtPath:()=>tx,getEnumValues:()=>Ms,getLengthableOrigin:()=>jn,getParsedType:()=>ix,getSizableOrigin:()=>Sl,isObject:()=>Vr,isPlainObject:()=>Ur,issue:()=>Bs,joinValues:()=>Wo,jsonStringifyReplacer:()=>Zs,merge:()=>lx,normalizeParams:()=>C,nullish:()=>Rn,numKeys:()=>ox,omit:()=>cx,optionalKeys:()=>Us,partial:()=>dx,pick:()=>ax,prefixIssues:()=>mt,primitiveTypes:()=>$l,promiseAllObject:()=>rx,propertyKeyTypes:()=>Vs,randomString:()=>nx,required:()=>fx,stringifyPrimitive:()=>Yo,unwrapMessage:()=>On});function G0(e){return e}function Y0(e){return e}function Q0(e){}function X0(e){throw new Error}function ex(e){}function Ms(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Wo(e,t="|"){return e.map(r=>Yo(r)).join(t)}function Zs(e,t){return typeof t=="bigint"?t.toString():t}function Cn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Rn(e){return e==null}function Nn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qs(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function te(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fs(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tx(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function rx(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function nx(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function pr(e){return JSON.stringify(e)}var Go=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Vr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ls=Cn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ur(e){if(Vr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(Vr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ox(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var ix=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Vs=new Set(["string","number","symbol"]),$l=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function C(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 new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function sx(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Yo(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Us(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Hs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ax(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return pt(e,{...e._zod.def,shape:r,checks:[]})}function cx(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return pt(e,{...e._zod.def,shape:r,checks:[]})}function ux(e,t){if(!Ur(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Fs(this,"shape",n),n},checks:[]};return pt(e,r)}function lx(e,t){return pt(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Fs(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function dx(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return pt(t,{...t._zod.def,shape:o,checks:[]})}function fx(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return pt(t,{...t._zod.def,shape:o,checks:[]})}function mr(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function On(e){return typeof e=="string"?e:e?.message}function nt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=On(e.inst?._zod.def?.error?.(e))??On(t?.error?.(e))??On(r.customError?.(e))??On(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Sl(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Bs(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function px(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Ds=class{constructor(...t){}};var zl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Zs,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Qo=y("$ZodError",zl),Ks=y("$ZodError",zl,{Parent:Error});function El(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Tl(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));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)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(e),n}var Pl=e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new St;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>nt(c,i,We())));throw Go(a,o?.callee),a}return s.value};var Il=e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>nt(c,i,We())));throw Go(a,o?.callee),a}return s.value};var Js=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new St;return i.issues.length?{success:!1,error:new(e??Qo)(i.issues.map(s=>nt(s,o,We())))}:{success:!0,data:i.value}},Dn=Js(Ks),Ws=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>nt(s,o,We())))}:{success:!0,data:i.value}},Xo=Ws(Ks);var Al=/^[cC][^\s-]{8,}$/,Ol=/^[0-9a-z]+$/,Cl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rl=/^[0-9a-vA-V]{20}$/,Nl=/^[A-Za-z0-9]{27}$/,jl=/^[a-zA-Z0-9_-]{21}$/,Dl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Ml=/^([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})$/,Gs=e=>e?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})$`):/^([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)$/;var Zl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var hx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ql(){return new RegExp(hx,"u")}var Fl=/^(?:(?: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])$/,Ll=/^(([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})$/,Vl=/^((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])$/,Ul=/^(([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])$/,Hl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ys=/^[A-Za-z0-9_-]*$/,Bl=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var Kl=/^\+(?:[0-9]){6,14}[0-9]$/,Jl="(?:(?:\\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])))",Wl=new RegExp(`^${Jl}$`);function Gl(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yl(e){return new RegExp(`^${Gl(e)}$`)}function Ql(e){let t=Gl({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Jl}T(?:${n})$`)}var Xl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var ed=/^\d+$/,td=/^-?\d+(?:\.\d+)?/i,rd=/true|false/i,nd=/null/i;var od=/^[^A-Z]*$/,id=/^[^a-z]*$/;var Ee=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sd={number:"number",bigint:"bigint",object:"date"},Xs=y("$ZodCheckLessThan",(e,t)=>{Ee.init(e,t);let r=sd[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ea=y("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=sd[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ad=y("$ZodCheckMultipleOf",(e,t)=>{Ee.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):qs(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cd=y("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Hs[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,r&&(a.pattern=ed)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}});var ud=y("$ZodCheckMaxLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Rn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let s=jn(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ld=y("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Rn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=jn(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),dd=y("$ZodCheckLengthEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Rn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,i=o.length;if(i===t.length)return;let s=jn(o),a=i>t.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mn=y("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),fd=y("$ZodCheckRegex",(e,t)=>{Mn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pd=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=od),Mn.init(e,t)}),md=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=id),Mn.init(e,t)}),hd=y("$ZodCheckIncludes",(e,t)=>{Ee.init(e,t);let r=Dt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gd=y("$ZodCheckStartsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`^${Dt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),_d=y("$ZodCheckEndsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`.*${Dt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var yd=y("$ZodCheckOverwrite",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ei=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
51
+ `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
52
+ `))}};var xd={major:4,minor:0,patch:0};var re=y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xd;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,s,a)=>{let c=mr(i),u;for(let l of s){if(l._zod.def.when){if(!l._zod.def.when(i))continue}else if(c)continue;let d=i.issues.length,f=l._zod.check(i);if(f instanceof Promise&&a?.async===!1)throw new St;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,i.issues.length!==d&&(c||(c=mr(i,d)))});else{if(i.issues.length===d)continue;c||(c=mr(i,d))}}return u?u.then(()=>i):i};e._zod.run=(i,s)=>{let a=e._zod.parse(i,s);if(a instanceof Promise){if(s.async===!1)throw new St;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=Dn(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Xo(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),ri=y("$ZodString",(e,t)=>{re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Xl(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),oe=y("$ZodStringFormat",(e,t)=>{Mn.init(e,t),ri.init(e,t)}),Id=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ml),oe.init(e,t)}),Ad=y("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gs(n))}else t.pattern??(t.pattern=Gs());oe.init(e,t)}),Od=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Zl),oe.init(e,t)}),Cd=y("$ZodURL",(e,t)=>{oe.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Bl.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Rd=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ql()),oe.init(e,t)}),Nd=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jl),oe.init(e,t)}),jd=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Al),oe.init(e,t)}),Dd=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ol),oe.init(e,t)}),Md=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Cl),oe.init(e,t)}),Zd=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rl),oe.init(e,t)}),qd=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Nl),oe.init(e,t)}),Fd=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ql(t)),oe.init(e,t)}),Ld=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Wl),oe.init(e,t)}),Vd=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yl(t)),oe.init(e,t)}),Ud=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dl),oe.init(e,t)}),Hd=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fl),oe.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Bd=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ll),oe.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.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})}}}),Kd=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Vl),oe.init(e,t)}),Jd=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ul),oe.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Wd(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Gd=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hl),oe.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Wd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function gx(e){if(!Ys.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wd(r)}var Yd=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ys),oe.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{gx(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Qd=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kl),oe.init(e,t)});function _x(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var Xd=y("$ZodJWT",(e,t)=>{oe.init(e,t),e._zod.check=r=>{_x(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var ra=y("$ZodNumber",(e,t)=>{re.init(e,t),e._zod.pattern=e._zod.bag.pattern??td,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),ef=y("$ZodNumber",(e,t)=>{cd.init(e,t),ra.init(e,t)}),tf=y("$ZodBoolean",(e,t)=>{re.init(e,t),e._zod.pattern=rd,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var rf=y("$ZodNull",(e,t)=>{re.init(e,t),e._zod.pattern=nd,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var nf=y("$ZodUnknown",(e,t)=>{re.init(e,t),e._zod.parse=r=>r}),of=y("$ZodNever",(e,t)=>{re.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function bd(e,t,r){e.issues.length&&t.issues.push(...mt(r,e.issues)),t.value[r]=e.value}var sf=y("$ZodArray",(e,t)=>{re.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let a=o[s],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?i.push(c.then(u=>bd(u,r,s))):bd(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function ti(e,t,r){e.issues.length&&t.issues.push(...mt(r,e.issues)),t.value[r]=e.value}function wd(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...mt(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}var af=y("$ZodObject",(e,t)=>{re.init(e,t);let r=Cn(()=>{let d=Object.keys(t.shape);for(let p of d)if(!(t.shape[p]instanceof re))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);let f=Us(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(f)}});te(e._zod,"propValues",()=>{let d=t.shape,f={};for(let p in d){let m=d[p]._zod;if(m.values){f[p]??(f[p]=new Set);for(let h of m.values)f[p].add(h)}}return f});let n=d=>{let f=new ei(["shape","payload","ctx"]),p=r.value,m=w=>{let $=pr(w);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};f.write("const input = payload.value;");let h=Object.create(null),g=0;for(let w of p.keys)h[w]=`key_${g++}`;f.write("const newResult = {}");for(let w of p.keys)if(p.optionalKeys.has(w)){let $=h[w];f.write(`const ${$} = ${m(w)};`);let I=pr(w);f.write(`
53
+ if (${$}.issues.length) {
54
+ if (input[${I}] === undefined) {
55
+ if (${I} in input) {
56
+ newResult[${I}] = undefined;
57
+ }
58
+ } else {
59
+ payload.issues = payload.issues.concat(
60
+ ${$}.issues.map((iss) => ({
61
+ ...iss,
62
+ path: iss.path ? [${I}, ...iss.path] : [${I}],
63
+ }))
64
+ );
65
+ }
66
+ } else if (${$}.value === undefined) {
67
+ if (${I} in input) newResult[${I}] = undefined;
68
+ } else {
69
+ newResult[${I}] = ${$}.value;
70
+ }
71
+ `)}else{let $=h[w];f.write(`const ${$} = ${m(w)};`),f.write(`
72
+ if (${$}.issues.length) payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
73
+ ...iss,
74
+ path: iss.path ? [${pr(w)}, ...iss.path] : [${pr(w)}]
75
+ })));`),f.write(`newResult[${pr(w)}] = ${$}.value`)}f.write("payload.value = newResult;"),f.write("return payload;");let x=f.compile();return(w,$)=>x(d,w,$)},o,i=Vr,s=!Jo.jitless,c=s&&Ls.value,u=t.catchall,l;e._zod.parse=(d,f)=>{l??(l=r.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;let m=[];if(s&&c&&f?.async===!1&&f.jitless!==!0)o||(o=n(t.shape)),d=o(d,f);else{d.value={};let $=l.shape;for(let I of l.keys){let A=$[I],de=A._zod.run({value:p[I],issues:[]},f),ye=A._zod.optin==="optional"&&A._zod.optout==="optional";de instanceof Promise?m.push(de.then(Rr=>ye?wd(Rr,d,I,p):ti(Rr,d,I))):ye?wd(de,d,I,p):ti(de,d,I)}}if(!u)return m.length?Promise.all(m).then(()=>d):d;let h=[],g=l.keySet,x=u._zod,w=x.def.type;for(let $ of Object.keys(p)){if(g.has($))continue;if(w==="never"){h.push($);continue}let I=x.run({value:p[$],issues:[]},f);I instanceof Promise?m.push(I.then(A=>ti(A,d,$))):ti(I,d,$)}return h.length&&d.issues.push({code:"unrecognized_keys",keys:h,input:p,inst:e}),m.length?Promise.all(m).then(()=>d):d}});function $d(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>nt(i,n,We())))}),t}var na=y("$ZodUnion",(e,t)=>{re.init(e,t),te(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),te(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),te(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),te(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Nn(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>$d(s,r,e,n)):$d(i,r,e,n)}}),cf=y("$ZodDiscriminatedUnion",(e,t)=>{na.init(e,t);let r=e._zod.parse;te(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=Cn(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Vr(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o)}}),uf=y("$ZodIntersection",(e,t)=>{re.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>kd(r,c,u)):kd(r,i,s)}});function ta(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(Ur(e)&&Ur(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=ta(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=ta(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function kd(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),mr(e))return e;let n=ta(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}var lf=y("$ZodRecord",(e,t)=>{re.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ur(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(l=>{l.issues.length&&r.issues.push(...mt(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...mt(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>nt(u,n,We())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);c instanceof Promise?i.push(c.then(u=>{u.issues.length&&r.issues.push(...mt(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...mt(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}});var df=y("$ZodEnum",(e,t)=>{re.init(e,t);let r=Ms(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Vs.has(typeof n)).map(n=>typeof n=="string"?Dt(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),ff=y("$ZodLiteral",(e,t)=>{re.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Dt(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}});var pf=y("$ZodTransform",(e,t)=>{re.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new St;return r.value=o,r}}),mf=y("$ZodOptional",(e,t)=>{re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),hf=y("$ZodNullable",(e,t)=>{re.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nn(r.source)}|null)$`):void 0}),te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),gf=y("$ZodDefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Sd(i,t)):Sd(o,t)}});function Sd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var _f=y("$ZodPrefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),yf=y("$ZodNonOptional",(e,t)=>{re.init(e,t),te(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>zd(i,e)):zd(o,e)}});function zd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var vf=y("$ZodCatch",(e,t)=>{re.init(e,t),e._zod.optin="optional",te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>nt(s,n,We()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>nt(i,n,We()))},input:r.value}),r.issues=[]),r)}});var xf=y("$ZodPipe",(e,t)=>{re.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Ed(i,t,n)):Ed(o,t,n)}});function Ed(e,t,r){return mr(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}var bf=y("$ZodReadonly",(e,t)=>{re.init(e,t),te(e._zod,"propValues",()=>t.innerType._zod.propValues),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Td):Td(o)}});function Td(e){return e.value=Object.freeze(e.value),e}var wf=y("$ZodCustom",(e,t)=>{Ee.init(e,t),re.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Pd(i,r,n,e));Pd(o,r,n,e)}});function Pd(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Bs(o))}}var yx=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},vx=()=>{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"}};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",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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${yx(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Yo(n.values[0])}`:`Invalid option: expected one of ${Wo(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.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":""}: ${Wo(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 $f(){return{localeError:vx()}}var oa=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function xx(){return new oa}var Zn=xx();function kf(e,t){return new e({type:"string",...C(t)})}function Sf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function ia(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function zf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function Ef(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function Tf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function Pf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function If(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function Af(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function Of(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function Cf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function Rf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function Nf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function jf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function Df(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function Mf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function Zf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function qf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function Ff(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function Lf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function Vf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function Uf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function Hf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}function Bf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function Kf(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function Jf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function Wf(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function Gf(e,t){return new e({type:"number",checks:[],...C(t)})}function Yf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function Qf(e,t){return new e({type:"boolean",...C(t)})}function Xf(e,t){return new e({type:"null",...C(t)})}function ep(e){return new e({type:"unknown"})}function tp(e,t){return new e({type:"never",...C(t)})}function ni(e,t){return new Xs({check:"less_than",...C(t),value:e,inclusive:!1})}function qn(e,t){return new Xs({check:"less_than",...C(t),value:e,inclusive:!0})}function oi(e,t){return new ea({check:"greater_than",...C(t),value:e,inclusive:!1})}function Fn(e,t){return new ea({check:"greater_than",...C(t),value:e,inclusive:!0})}function ii(e,t){return new ad({check:"multiple_of",...C(t),value:e})}function si(e,t){return new ud({check:"max_length",...C(t),maximum:e})}function Hr(e,t){return new ld({check:"min_length",...C(t),minimum:e})}function ai(e,t){return new dd({check:"length_equals",...C(t),length:e})}function sa(e,t){return new fd({check:"string_format",format:"regex",...C(t),pattern:e})}function aa(e){return new pd({check:"string_format",format:"lowercase",...C(e)})}function ca(e){return new md({check:"string_format",format:"uppercase",...C(e)})}function ua(e,t){return new hd({check:"string_format",format:"includes",...C(t),includes:e})}function la(e,t){return new gd({check:"string_format",format:"starts_with",...C(t),prefix:e})}function da(e,t){return new _d({check:"string_format",format:"ends_with",...C(t),suffix:e})}function hr(e){return new yd({check:"overwrite",tx:e})}function fa(e){return hr(t=>t.normalize(e))}function pa(){return hr(e=>e.trim())}function ma(){return hr(e=>e.toLowerCase())}function ha(){return hr(e=>e.toUpperCase())}function rp(e,t,r){return new e({type:"array",element:t,...C(r)})}function np(e,t,r){let n=C(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function op(e,t,r){return new e({type:"custom",check:"custom",fn:t,...C(r)})}function Br(e){return!!e._zod}function Mt(e,t){return Br(e)?Dn(e,t):e.safeParse(t)}function ci(e){if(!e)return;let t;if(Br(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function ip(e){if(Br(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var Vn={};As(Vn,{ZodISODate:()=>ap,ZodISODateTime:()=>sp,ZodISODuration:()=>up,ZodISOTime:()=>cp,date:()=>_a,datetime:()=>ga,duration:()=>va,time:()=>ya});var sp=y("ZodISODateTime",(e,t)=>{Fd.init(e,t),ce.init(e,t)});function ga(e){return Bf(sp,e)}var ap=y("ZodISODate",(e,t)=>{Ld.init(e,t),ce.init(e,t)});function _a(e){return Kf(ap,e)}var cp=y("ZodISOTime",(e,t)=>{Vd.init(e,t),ce.init(e,t)});function ya(e){return Jf(cp,e)}var up=y("ZodISODuration",(e,t)=>{Ud.init(e,t),ce.init(e,t)});function va(e){return Wf(up,e)}var lp=(e,t)=>{Qo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Tl(e,r)},flatten:{value:r=>El(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},iC=y("ZodError",lp),Un=y("ZodError",lp,{Parent:Error});var dp=Pl(Un),fp=Il(Un),pp=Js(Un),mp=Ws(Un);var fe=y("ZodType",(e,t)=>(re.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>pt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>dp(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>pp(e,r,n),e.parseAsync=async(r,n)=>fp(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>mp(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(_b(r,n)),e.superRefine=r=>e.check(yb(r)),e.overwrite=r=>e.check(hr(r)),e.optional=()=>le(e),e.nullable=()=>_p(e),e.nullish=()=>le(_p(e)),e.nonoptional=r=>lb(e,r),e.array=()=>B(e),e.or=r=>ie([e,r]),e.and=r=>li(e,r),e.transform=r=>ba(e,$p(r)),e.default=r=>ab(e,r),e.prefault=r=>ub(e,r),e.catch=r=>fb(e,r),e.pipe=r=>ba(e,r),e.readonly=()=>hb(e),e.describe=r=>{let n=e.clone();return Zn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Zn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Zn.get(e);let n=e.clone();return Zn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),yp=y("_ZodString",(e,t)=>{ri.init(e,t),fe.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(sa(...n)),e.includes=(...n)=>e.check(ua(...n)),e.startsWith=(...n)=>e.check(la(...n)),e.endsWith=(...n)=>e.check(da(...n)),e.min=(...n)=>e.check(Hr(...n)),e.max=(...n)=>e.check(si(...n)),e.length=(...n)=>e.check(ai(...n)),e.nonempty=(...n)=>e.check(Hr(1,...n)),e.lowercase=n=>e.check(aa(n)),e.uppercase=n=>e.check(ca(n)),e.trim=()=>e.check(pa()),e.normalize=(...n)=>e.check(fa(...n)),e.toLowerCase=()=>e.check(ma()),e.toUpperCase=()=>e.check(ha())}),Px=y("ZodString",(e,t)=>{ri.init(e,t),yp.init(e,t),e.email=r=>e.check(Sf(Ix,r)),e.url=r=>e.check(If(Ax,r)),e.jwt=r=>e.check(Hf(Bx,r)),e.emoji=r=>e.check(Af(Ox,r)),e.guid=r=>e.check(ia(hp,r)),e.uuid=r=>e.check(zf(ui,r)),e.uuidv4=r=>e.check(Ef(ui,r)),e.uuidv6=r=>e.check(Tf(ui,r)),e.uuidv7=r=>e.check(Pf(ui,r)),e.nanoid=r=>e.check(Of(Cx,r)),e.guid=r=>e.check(ia(hp,r)),e.cuid=r=>e.check(Cf(Rx,r)),e.cuid2=r=>e.check(Rf(Nx,r)),e.ulid=r=>e.check(Nf(jx,r)),e.base64=r=>e.check(Lf(Vx,r)),e.base64url=r=>e.check(Vf(Ux,r)),e.xid=r=>e.check(jf(Dx,r)),e.ksuid=r=>e.check(Df(Mx,r)),e.ipv4=r=>e.check(Mf(Zx,r)),e.ipv6=r=>e.check(Zf(qx,r)),e.cidrv4=r=>e.check(qf(Fx,r)),e.cidrv6=r=>e.check(Ff(Lx,r)),e.e164=r=>e.check(Uf(Hx,r)),e.datetime=r=>e.check(ga(r)),e.date=r=>e.check(_a(r)),e.time=r=>e.check(ya(r)),e.duration=r=>e.check(va(r))});function _(e){return kf(Px,e)}var ce=y("ZodStringFormat",(e,t)=>{oe.init(e,t),yp.init(e,t)}),Ix=y("ZodEmail",(e,t)=>{Od.init(e,t),ce.init(e,t)});var hp=y("ZodGUID",(e,t)=>{Id.init(e,t),ce.init(e,t)});var ui=y("ZodUUID",(e,t)=>{Ad.init(e,t),ce.init(e,t)});var Ax=y("ZodURL",(e,t)=>{Cd.init(e,t),ce.init(e,t)});var Ox=y("ZodEmoji",(e,t)=>{Rd.init(e,t),ce.init(e,t)});var Cx=y("ZodNanoID",(e,t)=>{Nd.init(e,t),ce.init(e,t)});var Rx=y("ZodCUID",(e,t)=>{jd.init(e,t),ce.init(e,t)});var Nx=y("ZodCUID2",(e,t)=>{Dd.init(e,t),ce.init(e,t)});var jx=y("ZodULID",(e,t)=>{Md.init(e,t),ce.init(e,t)});var Dx=y("ZodXID",(e,t)=>{Zd.init(e,t),ce.init(e,t)});var Mx=y("ZodKSUID",(e,t)=>{qd.init(e,t),ce.init(e,t)});var Zx=y("ZodIPv4",(e,t)=>{Hd.init(e,t),ce.init(e,t)});var qx=y("ZodIPv6",(e,t)=>{Bd.init(e,t),ce.init(e,t)});var Fx=y("ZodCIDRv4",(e,t)=>{Kd.init(e,t),ce.init(e,t)});var Lx=y("ZodCIDRv6",(e,t)=>{Jd.init(e,t),ce.init(e,t)});var Vx=y("ZodBase64",(e,t)=>{Gd.init(e,t),ce.init(e,t)});var Ux=y("ZodBase64URL",(e,t)=>{Yd.init(e,t),ce.init(e,t)});var Hx=y("ZodE164",(e,t)=>{Qd.init(e,t),ce.init(e,t)});var Bx=y("ZodJWT",(e,t)=>{Xd.init(e,t),ce.init(e,t)});var vp=y("ZodNumber",(e,t)=>{ra.init(e,t),fe.init(e,t),e.gt=(n,o)=>e.check(oi(n,o)),e.gte=(n,o)=>e.check(Fn(n,o)),e.min=(n,o)=>e.check(Fn(n,o)),e.lt=(n,o)=>e.check(ni(n,o)),e.lte=(n,o)=>e.check(qn(n,o)),e.max=(n,o)=>e.check(qn(n,o)),e.int=n=>e.check(gp(n)),e.safe=n=>e.check(gp(n)),e.positive=n=>e.check(oi(0,n)),e.nonnegative=n=>e.check(Fn(0,n)),e.negative=n=>e.check(ni(0,n)),e.nonpositive=n=>e.check(qn(0,n)),e.multipleOf=(n,o)=>e.check(ii(n,o)),e.step=(n,o)=>e.check(ii(n,o)),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??.5),e.isFinite=!0,e.format=r.format??null});function Q(e){return Gf(vp,e)}var Kx=y("ZodNumberFormat",(e,t)=>{ef.init(e,t),vp.init(e,t)});function gp(e){return Yf(Kx,e)}var Jx=y("ZodBoolean",(e,t)=>{tf.init(e,t),fe.init(e,t)});function ve(e){return Qf(Jx,e)}var Wx=y("ZodNull",(e,t)=>{rf.init(e,t),fe.init(e,t)});function xp(e){return Xf(Wx,e)}var Gx=y("ZodUnknown",(e,t)=>{nf.init(e,t),fe.init(e,t)});function ue(){return ep(Gx)}var Yx=y("ZodNever",(e,t)=>{of.init(e,t),fe.init(e,t)});function Qx(e){return tp(Yx,e)}var Xx=y("ZodArray",(e,t)=>{sf.init(e,t),fe.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Hr(r,n)),e.nonempty=r=>e.check(Hr(1,r)),e.max=(r,n)=>e.check(si(r,n)),e.length=(r,n)=>e.check(ai(r,n)),e.unwrap=()=>e.element});function B(e,t){return rp(Xx,e,t)}var bp=y("ZodObject",(e,t)=>{af.init(e,t),fe.init(e,t),Y.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Ze(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ue()}),e.loose=()=>e.clone({...e._zod.def,catchall:ue()}),e.strict=()=>e.clone({...e._zod.def,catchall:Qx()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Y.extend(e,r),e.merge=r=>Y.merge(e,r),e.pick=r=>Y.pick(e,r),e.omit=r=>Y.omit(e,r),e.partial=(...r)=>Y.partial(kp,e,r[0]),e.required=(...r)=>Y.required(Sp,e,r[0])});function z(e,t){let r={type:"object",get shape(){return Y.assignProp(this,"shape",{...e}),this.shape},...Y.normalizeParams(t)};return new bp(r)}function Ce(e,t){return new bp({type:"object",get shape(){return Y.assignProp(this,"shape",{...e}),this.shape},catchall:ue(),...Y.normalizeParams(t)})}var wp=y("ZodUnion",(e,t)=>{na.init(e,t),fe.init(e,t),e.options=t.options});function ie(e,t){return new wp({type:"union",options:e,...Y.normalizeParams(t)})}var eb=y("ZodDiscriminatedUnion",(e,t)=>{wp.init(e,t),cf.init(e,t)});function wa(e,t,r){return new eb({type:"union",options:t,discriminator:e,...Y.normalizeParams(r)})}var tb=y("ZodIntersection",(e,t)=>{uf.init(e,t),fe.init(e,t)});function li(e,t){return new tb({type:"intersection",left:e,right:t})}var rb=y("ZodRecord",(e,t)=>{lf.init(e,t),fe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function ne(e,t,r){return new rb({type:"record",keyType:e,valueType:t,...Y.normalizeParams(r)})}var xa=y("ZodEnum",(e,t)=>{df.init(e,t),fe.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xa({...t,checks:[],...Y.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new xa({...t,checks:[],...Y.normalizeParams(o),entries:i})}});function Ze(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xa({type:"enum",entries:r,...Y.normalizeParams(t)})}var nb=y("ZodLiteral",(e,t)=>{ff.init(e,t),fe.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function T(e,t){return new nb({type:"literal",values:Array.isArray(e)?e:[e],...Y.normalizeParams(t)})}var ob=y("ZodTransform",(e,t)=>{pf.init(e,t),fe.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(Y.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(Y.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function $p(e){return new ob({type:"transform",transform:e})}var kp=y("ZodOptional",(e,t)=>{mf.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function le(e){return new kp({type:"optional",innerType:e})}var ib=y("ZodNullable",(e,t)=>{hf.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _p(e){return new ib({type:"nullable",innerType:e})}var sb=y("ZodDefault",(e,t)=>{gf.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ab(e,t){return new sb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var cb=y("ZodPrefault",(e,t)=>{_f.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ub(e,t){return new cb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var Sp=y("ZodNonOptional",(e,t)=>{yf.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lb(e,t){return new Sp({type:"nonoptional",innerType:e,...Y.normalizeParams(t)})}var db=y("ZodCatch",(e,t)=>{vf.init(e,t),fe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fb(e,t){return new db({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var pb=y("ZodPipe",(e,t)=>{xf.init(e,t),fe.init(e,t),e.in=t.in,e.out=t.out});function ba(e,t){return new pb({type:"pipe",in:e,out:t})}var mb=y("ZodReadonly",(e,t)=>{bf.init(e,t),fe.init(e,t)});function hb(e){return new mb({type:"readonly",innerType:e})}var zp=y("ZodCustom",(e,t)=>{wf.init(e,t),fe.init(e,t)});function gb(e){let t=new Ee({check:"custom"});return t._zod.check=e,t}function Ep(e,t){return np(zp,e??(()=>!0),t)}function _b(e,t={}){return op(zp,e,t)}function yb(e){let t=gb(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Y.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Y.issue(o))}},e(r.value,r)));return t}function $a(e,t){return ba($p(e),t)}We($f());var Sa="2025-11-25";var Tp=[Sa,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Zt="io.modelcontextprotocol/related-task",fi="2.0",ge=Ep(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Pp=ie([_(),Q().int()]),Ip=_(),QC=Ce({ttl:Q().optional(),pollInterval:Q().optional()}),vb=z({ttl:Q().optional()}),xb=z({taskId:_()}),za=Ce({progressToken:Pp.optional(),[Zt]:xb.optional()}),He=z({_meta:za.optional()}),Hn=He.extend({task:vb.optional()}),Ap=e=>Hn.safeParse(e).success,be=z({method:_(),params:He.loose().optional()}),Ge=z({_meta:za.optional()}),Ye=z({method:_(),params:Ge.loose().optional()}),we=Ce({_meta:za.optional()}),pi=ie([_(),Q().int()]),Op=z({jsonrpc:T(fi),id:pi,...be.shape}).strict(),Ea=e=>Op.safeParse(e).success,Cp=z({jsonrpc:T(fi),...Ye.shape}).strict(),Rp=e=>Cp.safeParse(e).success,Ta=z({jsonrpc:T(fi),id:pi,result:we}).strict(),Bn=e=>Ta.safeParse(e).success;var H;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",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.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(H||(H={}));var Pa=z({jsonrpc:T(fi),id:pi.optional(),error:z({code:Q().int(),message:_(),data:ue().optional()})}).strict();var Np=e=>Pa.safeParse(e).success;var jp=ie([Op,Cp,Ta,Pa]),XC=ie([Ta,Pa]),mi=we.strict(),bb=Ge.extend({requestId:pi.optional(),reason:_().optional()}),hi=Ye.extend({method:T("notifications/cancelled"),params:bb}),wb=z({src:_(),mimeType:_().optional(),sizes:B(_()).optional(),theme:Ze(["light","dark"]).optional()}),Kn=z({icons:B(wb).optional()}),Kr=z({name:_(),title:_().optional()}),Dp=Kr.extend({...Kr.shape,...Kn.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),$b=li(z({applyDefaults:ve().optional()}),ne(_(),ue())),kb=$a(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,li(z({form:$b.optional(),url:ge.optional()}),ne(_(),ue()).optional())),Sb=Ce({list:ge.optional(),cancel:ge.optional(),requests:Ce({sampling:Ce({createMessage:ge.optional()}).optional(),elicitation:Ce({create:ge.optional()}).optional()}).optional()}),zb=Ce({list:ge.optional(),cancel:ge.optional(),requests:Ce({tools:Ce({call:ge.optional()}).optional()}).optional()}),Eb=z({experimental:ne(_(),ge).optional(),sampling:z({context:ge.optional(),tools:ge.optional()}).optional(),elicitation:kb.optional(),roots:z({listChanged:ve().optional()}).optional(),tasks:Sb.optional(),extensions:ne(_(),ge).optional()}),Tb=He.extend({protocolVersion:_(),capabilities:Eb,clientInfo:Dp}),Ia=be.extend({method:T("initialize"),params:Tb});var Pb=z({experimental:ne(_(),ge).optional(),logging:ge.optional(),completions:ge.optional(),prompts:z({listChanged:ve().optional()}).optional(),resources:z({subscribe:ve().optional(),listChanged:ve().optional()}).optional(),tools:z({listChanged:ve().optional()}).optional(),tasks:zb.optional(),extensions:ne(_(),ge).optional()}),Ib=we.extend({protocolVersion:_(),capabilities:Pb,serverInfo:Dp,instructions:_().optional()}),Aa=Ye.extend({method:T("notifications/initialized"),params:Ge.optional()});var gi=be.extend({method:T("ping"),params:He.optional()}),Ab=z({progress:Q(),total:le(Q()),message:le(_())}),Ob=z({...Ge.shape,...Ab.shape,progressToken:Pp}),_i=Ye.extend({method:T("notifications/progress"),params:Ob}),Cb=He.extend({cursor:Ip.optional()}),Jn=be.extend({params:Cb.optional()}),Wn=we.extend({nextCursor:Ip.optional()}),Rb=Ze(["working","input_required","completed","failed","cancelled"]),Gn=z({taskId:_(),status:Rb,ttl:ie([Q(),xp()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:le(Q()),statusMessage:le(_())}),Jr=we.extend({task:Gn}),Nb=Ge.merge(Gn),Yn=Ye.extend({method:T("notifications/tasks/status"),params:Nb}),yi=be.extend({method:T("tasks/get"),params:He.extend({taskId:_()})}),vi=we.merge(Gn),xi=be.extend({method:T("tasks/result"),params:He.extend({taskId:_()})}),eR=we.loose(),bi=Jn.extend({method:T("tasks/list")}),wi=Wn.extend({tasks:B(Gn)}),$i=be.extend({method:T("tasks/cancel"),params:He.extend({taskId:_()})}),Mp=we.merge(Gn),Zp=z({uri:_(),mimeType:le(_()),_meta:ne(_(),ue()).optional()}),qp=Zp.extend({text:_()}),Oa=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Fp=Zp.extend({blob:Oa}),Qn=Ze(["user","assistant"]),Wr=z({audience:B(Qn).optional(),priority:Q().min(0).max(1).optional(),lastModified:Vn.datetime({offset:!0}).optional()}),Lp=z({...Kr.shape,...Kn.shape,uri:_(),description:le(_()),mimeType:le(_()),size:le(Q()),annotations:Wr.optional(),_meta:le(Ce({}))}),jb=z({...Kr.shape,...Kn.shape,uriTemplate:_(),description:le(_()),mimeType:le(_()),annotations:Wr.optional(),_meta:le(Ce({}))}),Db=Jn.extend({method:T("resources/list")}),Mb=Wn.extend({resources:B(Lp)}),Zb=Jn.extend({method:T("resources/templates/list")}),qb=Wn.extend({resourceTemplates:B(jb)}),Ca=He.extend({uri:_()}),Fb=Ca,Lb=be.extend({method:T("resources/read"),params:Fb}),Vb=we.extend({contents:B(ie([qp,Fp]))}),Ub=Ye.extend({method:T("notifications/resources/list_changed"),params:Ge.optional()}),Hb=Ca,Bb=be.extend({method:T("resources/subscribe"),params:Hb}),Kb=Ca,Jb=be.extend({method:T("resources/unsubscribe"),params:Kb}),Wb=Ge.extend({uri:_()}),Gb=Ye.extend({method:T("notifications/resources/updated"),params:Wb}),Yb=z({name:_(),description:le(_()),required:le(ve())}),Qb=z({...Kr.shape,...Kn.shape,description:le(_()),arguments:le(B(Yb)),_meta:le(Ce({}))}),Xb=Jn.extend({method:T("prompts/list")}),ew=Wn.extend({prompts:B(Qb)}),tw=He.extend({name:_(),arguments:ne(_(),_()).optional()}),rw=be.extend({method:T("prompts/get"),params:tw}),Ra=z({type:T("text"),text:_(),annotations:Wr.optional(),_meta:ne(_(),ue()).optional()}),Na=z({type:T("image"),data:Oa,mimeType:_(),annotations:Wr.optional(),_meta:ne(_(),ue()).optional()}),ja=z({type:T("audio"),data:Oa,mimeType:_(),annotations:Wr.optional(),_meta:ne(_(),ue()).optional()}),nw=z({type:T("tool_use"),name:_(),id:_(),input:ne(_(),ue()),_meta:ne(_(),ue()).optional()}),ow=z({type:T("resource"),resource:ie([qp,Fp]),annotations:Wr.optional(),_meta:ne(_(),ue()).optional()}),iw=Lp.extend({type:T("resource_link")}),Da=ie([Ra,Na,ja,iw,ow]),sw=z({role:Qn,content:Da}),aw=we.extend({description:_().optional(),messages:B(sw)}),cw=Ye.extend({method:T("notifications/prompts/list_changed"),params:Ge.optional()}),uw=z({title:_().optional(),readOnlyHint:ve().optional(),destructiveHint:ve().optional(),idempotentHint:ve().optional(),openWorldHint:ve().optional()}),lw=z({taskSupport:Ze(["required","optional","forbidden"]).optional()}),Vp=z({...Kr.shape,...Kn.shape,description:_().optional(),inputSchema:z({type:T("object"),properties:ne(_(),ge).optional(),required:B(_()).optional()}).catchall(ue()),outputSchema:z({type:T("object"),properties:ne(_(),ge).optional(),required:B(_()).optional()}).catchall(ue()).optional(),annotations:uw.optional(),execution:lw.optional(),_meta:ne(_(),ue()).optional()}),Ma=Jn.extend({method:T("tools/list")}),dw=Wn.extend({tools:B(Vp)}),ki=we.extend({content:B(Da).default([]),structuredContent:ne(_(),ue()).optional(),isError:ve().optional()}),tR=ki.or(we.extend({toolResult:ue()})),fw=Hn.extend({name:_(),arguments:ne(_(),ue()).optional()}),Xn=be.extend({method:T("tools/call"),params:fw}),pw=Ye.extend({method:T("notifications/tools/list_changed"),params:Ge.optional()}),rR=z({autoRefresh:ve().default(!0),debounceMs:Q().int().nonnegative().default(300)}),eo=Ze(["debug","info","notice","warning","error","critical","alert","emergency"]),mw=He.extend({level:eo}),Za=be.extend({method:T("logging/setLevel"),params:mw}),hw=Ge.extend({level:eo,logger:_().optional(),data:ue()}),gw=Ye.extend({method:T("notifications/message"),params:hw}),_w=z({name:_().optional()}),yw=z({hints:B(_w).optional(),costPriority:Q().min(0).max(1).optional(),speedPriority:Q().min(0).max(1).optional(),intelligencePriority:Q().min(0).max(1).optional()}),vw=z({mode:Ze(["auto","required","none"]).optional()}),xw=z({type:T("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:B(Da).default([]),structuredContent:z({}).loose().optional(),isError:ve().optional(),_meta:ne(_(),ue()).optional()}),bw=wa("type",[Ra,Na,ja]),di=wa("type",[Ra,Na,ja,nw,xw]),ww=z({role:Qn,content:ie([di,B(di)]),_meta:ne(_(),ue()).optional()}),$w=Hn.extend({messages:B(ww),modelPreferences:yw.optional(),systemPrompt:_().optional(),includeContext:Ze(["none","thisServer","allServers"]).optional(),temperature:Q().optional(),maxTokens:Q().int(),stopSequences:B(_()).optional(),metadata:ge.optional(),tools:B(Vp).optional(),toolChoice:vw.optional()}),kw=be.extend({method:T("sampling/createMessage"),params:$w}),to=we.extend({model:_(),stopReason:le(Ze(["endTurn","stopSequence","maxTokens"]).or(_())),role:Qn,content:bw}),qa=we.extend({model:_(),stopReason:le(Ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Qn,content:ie([di,B(di)])}),Sw=z({type:T("boolean"),title:_().optional(),description:_().optional(),default:ve().optional()}),zw=z({type:T("string"),title:_().optional(),description:_().optional(),minLength:Q().optional(),maxLength:Q().optional(),format:Ze(["email","uri","date","date-time"]).optional(),default:_().optional()}),Ew=z({type:Ze(["number","integer"]),title:_().optional(),description:_().optional(),minimum:Q().optional(),maximum:Q().optional(),default:Q().optional()}),Tw=z({type:T("string"),title:_().optional(),description:_().optional(),enum:B(_()),default:_().optional()}),Pw=z({type:T("string"),title:_().optional(),description:_().optional(),oneOf:B(z({const:_(),title:_()})),default:_().optional()}),Iw=z({type:T("string"),title:_().optional(),description:_().optional(),enum:B(_()),enumNames:B(_()).optional(),default:_().optional()}),Aw=ie([Tw,Pw]),Ow=z({type:T("array"),title:_().optional(),description:_().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:z({type:T("string"),enum:B(_())}),default:B(_()).optional()}),Cw=z({type:T("array"),title:_().optional(),description:_().optional(),minItems:Q().optional(),maxItems:Q().optional(),items:z({anyOf:B(z({const:_(),title:_()}))}),default:B(_()).optional()}),Rw=ie([Ow,Cw]),Nw=ie([Iw,Aw,Rw]),jw=ie([Nw,Sw,zw,Ew]),Dw=Hn.extend({mode:T("form").optional(),message:_(),requestedSchema:z({type:T("object"),properties:ne(_(),jw),required:B(_()).optional()})}),Mw=Hn.extend({mode:T("url"),message:_(),elicitationId:_(),url:_().url()}),Zw=ie([Dw,Mw]),qw=be.extend({method:T("elicitation/create"),params:Zw}),Fw=Ge.extend({elicitationId:_()}),Lw=Ye.extend({method:T("notifications/elicitation/complete"),params:Fw}),Gr=we.extend({action:Ze(["accept","decline","cancel"]),content:$a(e=>e===null?void 0:e,ne(_(),ie([_(),Q(),ve(),B(_())])).optional())}),Vw=z({type:T("ref/resource"),uri:_()});var Uw=z({type:T("ref/prompt"),name:_()}),Hw=He.extend({ref:ie([Uw,Vw]),argument:z({name:_(),value:_()}),context:z({arguments:ne(_(),_()).optional()}).optional()}),Bw=be.extend({method:T("completion/complete"),params:Hw});var Kw=we.extend({completion:Ce({values:B(_()).max(100),total:le(Q().int()),hasMore:le(ve())})}),Jw=z({uri:_().startsWith("file://"),name:_().optional(),_meta:ne(_(),ue()).optional()}),Ww=be.extend({method:T("roots/list"),params:He.optional()}),Fa=we.extend({roots:B(Jw)}),Gw=Ye.extend({method:T("notifications/roots/list_changed"),params:Ge.optional()}),nR=ie([gi,Ia,Bw,Za,rw,Xb,Db,Zb,Lb,Bb,Jb,Xn,Ma,yi,xi,bi,$i]),oR=ie([hi,_i,Aa,Gw,Yn]),iR=ie([mi,to,qa,Gr,Fa,vi,wi,Jr]),sR=ie([gi,kw,qw,Ww,yi,xi,bi,$i]),aR=ie([hi,_i,gw,Gb,Ub,pw,cw,Yn,Lw]),cR=ie([mi,Ib,Kw,aw,ew,Mb,qb,Vb,ki,dw,vi,wi,Jr]),M=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===H.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new ka(o.elicitations,r)}return new e(t,r,n)}},ka=class extends M{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function qt(e){return e==="completed"||e==="failed"||e==="cancelled"}var FR=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function La(e){let r=ci(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=ip(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Va(e,t){let r=Mt(e,t);if(!r.success)throw r.error;return r.data}var r$=6e4,Si=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(hi,r=>{this._oncancel(r)}),this.setNotificationHandler(_i,r=>{this._onprogress(r)}),this.setRequestHandler(gi,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(yi,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new M(H.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(xi,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,f=new M(d.error.code,d.error.message,d.error.data);l(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new M(H.InvalidParams,`Task not found: ${i}`);if(!qt(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(qt(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Zt]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(bi,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new M(H.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler($i,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new M(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(qt(o.status))throw new M(H.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new M(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof M?o:new M(H.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),M.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),Bn(i)||Np(i)?this._onresponse(i):Ea(i)?this._onrequest(i,s):Rp(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=M.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[Zt]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:H.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=Ap(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,u={signal:s.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let d={relatedRequestId:t.id};i&&(d.relatedTask={taskId:i}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(s.signal.aborted)throw new M(H.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:t.id};i&&!p.relatedTask&&(p.relatedTask={taskId:i});let m=p.relatedTask?.taskId??i;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async l=>{if(s.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(l.code)?l.code:H.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===s&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Bn(t))n(t);else{let s=new M(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Bn(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Bn(t))o(t);else{let s=M.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof M?s:new M(H.InternalError,String(s))}}return}let i;try{let s=await this.request(t,Jr,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new M(H.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},qt(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new M(H.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new M(H.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof M?s:new M(H.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=w=>{l(w)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(w){d(w);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Zt]:c}});let m=w=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`)));let $=w instanceof M?w:new M(H.RequestTimeout,String(w));l($)};this._responseHandlers.set(f,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return l(w);try{let $=Mt(r,w.result);$.success?u($.data):l($.error)}catch($){l($)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??r$,g=()=>m(M.fromError(H.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let x=c?.taskId;if(x){let w=$=>{let I=this._responseHandlers.get(f);I?I($):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,w),this._enqueueTaskMessage(x,{type:"request",message:p,timestamp:Date.now()}).catch($=>{this._cleanupTimeout(f),l($)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(w=>{this._cleanupTimeout(f),l(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},vi,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},wi,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Mp,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Zt]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Zt]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Zt]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=La(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=Va(t,o);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=La(t);this._notificationHandlers.set(n,o=>{let i=Va(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&Ea(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new M(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new M(H.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new M(H.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new M(H.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=Yn.parse({method:"notifications/tasks/status",params:a});await this.notification(c),qt(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new M(H.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(qt(a.status))throw new M(H.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=Yn.parse({method:"notifications/tasks/status",params:c});await this.notification(u),qt(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function Up(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Hp(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];Up(s)&&Up(i)?r[o]={...s,...i}:r[o]=i}return r}var jg=Os(Pu(),1),Dg=Os(Ng(),1);function i1(){let e=new jg.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Dg.default)(e),e}var ss=class{constructor(t){this._ajv=t??i1()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var as=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}createMessageStream(t,r){let n=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let o=t.messages[t.messages.length-1],i=Array.isArray(o.content)?o.content:[o.content],s=i.some(l=>l.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(s){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(i.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(l.size!==d.size||![...l].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},to,r)}elicitInputStream(t,r){let n=this._server.getClientCapabilities(),o=t.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let i=o==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:i},Gr,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function Mg(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function Zg(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var cs=class extends Si{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(eo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new ss,this.setRequestHandler(Ia,n=>this._oninitialize(n)),this.setNotificationHandler(Aa,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Za,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=eo.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new as(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Hp(this._capabilities,t)}setRequestHandler(t,r){let o=ci(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Br(o)){let a=o;i=a._zod?.def?.value??a.value}else{let a=o;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let a=async(c,u)=>{let l=Mt(Xn,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new M(H.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,f=await Promise.resolve(r(c,u));if(d.task){let m=Mt(Jr,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new M(H.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Mt(ki,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new M(H.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){Zg(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&Mg(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Tp.includes(r)?r:Sa,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},mi)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],i=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(i){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},qa,r):this.request({method:"sampling/createMessage",params:t},to,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=t;return this.request({method:"elicitation/create",params:o},Gr,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=t.mode==="form"?t:{...t,mode:"form"},i=await this.request({method:"elicitation/create",params:o},Gr,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new M(H.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof M?s:new M(H.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return i}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Fa,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}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"})}};import Fg from"node:process";var us=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
76
+ `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),s1(r)}clear(){this._buffer=void 0}};function s1(e){return jp.parse(JSON.parse(e))}function qg(e){return JSON.stringify(e)+`
77
+ `}var ls=class{constructor(t=Fg.stdin,r=Fg.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new us,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new 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)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=qg(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var cv=Os(sv(),1);import{readdir as yA,readFile as vA}from"fs/promises";import{basename as xA,extname as av,join as bA,relative as wA}from"path";function $A(e){return e.indexOf("/apps/")!==-1?"apps":e.indexOf("/diagrams/")!==-1?"diagrams":e.indexOf("/charts/")!==-1?"charts":e.indexOf("/dashboards/")!==-1?"dashboards":""}var ws=class e{options;pages=new Map;constructor(t){this.options=t}getPage(t){let r=t.replace(/\\/g,"/");return this.pages.get(r)}toJSON(){return JSON.stringify(Object.fromEntries(this.pages))}static fromPages(t){let r=Object.create(e.prototype);return r.pages=new Map(Object.entries(t)),r.options={docs:[],extensions:[]},r}async buildIndex(){try{this.pages=new Map;let t=[];for(let r=0;r<this.options.docs.length;r++){let n=this.options.docs[r].docsPath,o=await this.scanDirectory(n);for(let i of o)try{let s=await this.processFile(i,n,this.options.docs[r].baseUrl,this.options.docs[r].lib);t.push(...s)}catch(s){console.warn(`Failed to process file ${i}:`,s instanceof Error?s.message:s)}}return t}catch(t){return console.error("Failed to build index:",t instanceof Error?t.message:t),[]}}async scanDirectory(t){let r=[];try{let n=await yA(t,{withFileTypes:!0});for(let o of n){if(o.isSymbolicLink())continue;let i=bA(t,o.name);if(o.isDirectory()){let s=await this.scanDirectory(i);r.push(...s)}else if(o.isFile()){if(o.name.startsWith("_"))continue;let s=av(o.name);this.options.extensions.includes(s)&&r.push(i)}}}catch(n){console.warn(`Failed to scan directory ${t}:`,n instanceof Error?n.message:n)}return r}async processFile(t,r,n,o){try{let i=await vA(t,"utf-8"),s=wA(r,t),a=this._generateUrl(s,n),c=$A(s),u,l,d;try{let m=(0,cv.default)(i);u=m.data.title,l=m.data.description,d=m.content}catch{d=i}let f=u||this._getFilenameAsTitle(t),p=s.replace(/\\/g,"/");return this.pages.set(p,{title:f,body:d.trim(),url:a,lib:o,topic:c}),this._split(d,f,l,p.replaceAll(".md",""),n,o,c)}catch(i){return console.warn(`Failed to read file ${t}:`,i instanceof Error?i.message:i),[]}}_split(t,r,n,o,i,s,a){let c=/^## (.+)$/gm,u=[],l;for(;(l=c.exec(t))!==null;)u.push({title:l[1],index:l.index});if(u.length===0)return[{pageTitle:r,sectionTitle:r,content:t.trim(),path:o,url:i,description:n,lib:s,topic:a}];let d=[],f=t.substring(0,u[0].index).trim();f&&d.push({pageTitle:r,sectionTitle:"Introduction",content:f,path:o,url:i,description:n,lib:s,topic:a});for(let p=0;p<u.length;p++){let m=u[p],h=p+1<u.length?u[p+1].index:t.length,g=t.substring(m.index,h).trim(),x=this._generateAnchor(m.title);d.push({pageTitle:r,sectionTitle:m.title,content:g,path:`${o}${x}`,url:i,...d.length===0?{description:n}:{},lib:s,topic:a})}return d}_generateAnchor(t){try{return t.match(/(#[^)]+)/)[0]||t}catch{return t}}_generateUrl(t,r){let n=t.replace(/\.(md|mdx)$/,"");n=n.replace(/\\/g,"/"),(n.endsWith("/index")||n==="index")&&(n=n.replace(/\/index$/,"").replace(/^index$/,"")),n=n.toLowerCase();let o=n?`/${n}`:"/";return`${r}${o}`}_getFilenameAsTitle(t){return xA(t,av(t)).replace(/[-_]/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}};function uv(e,t){return{name:e,description:t||"Retrieves a page from the VisuallyJs documentation",inputSchema:{type:"object",properties:{path:{type:"string",description:"The relative path to this page from the documentation root."}},required:["path"]}}}var lv=ft.object({path:ft.string({required_error:"Path parameter is required"}).min(1,"Path parameter is required").max(500,"Path parameter is too long (max 500 characters)").refine(e=>e.trim().length>0,"Path parameter cannot be empty").transform(e=>e.trim()).refine(e=>!e.includes("\0"),"Path contains invalid characters").refine(e=>{let t=e.replace(/\\/g,"/");return!t.includes("..")&&!t.startsWith("/")},"Path must be a relative path within the docs directory")});function dv(e){return async t=>{try{let r=lv.parse(t),n=r.path,o=n.endsWith(".md")?n:n+".md",i=e.getPage(o);if(!i)throw new Error(`Document not found: ${r.path}`);return{title:i.title,body:i.body,url:i.url,lib:i.lib}}catch(r){throw r instanceof Error?new Error(`Get doc failed: ${r.message}`):new Error("Get doc failed: Unknown error occurred")}}}function fv(e,t,r){function n(){let o={q:{type:"string",description:"Search query."},limit:{type:"number",description:"Maximum number of results to return (default: 10)",default:10}};return r!==!0&&(o.lib={type:"string",description:"Optional name of the library to narrow searches to - should be one of `react`, `angular`, `vue`, `svelte` or `vanilla`."}),o}return{name:e,description:t||"Search the VisuallyJs documentation",inputSchema:{type:"object",properties:n(),required:["q"]}}}var pv=ft.object({q:ft.string({required_error:"Query parameter q is required"}).min(1,"Query parameter q is required").max(1e3,"Query parameter is too long (max 1000 characters)").refine(e=>e.trim().length>0,"Query parameter cannot be empty").transform(e=>e.trim()),limit:ft.number({invalid_type_error:"Limit parameter must be a non-negative number"}).finite("Limit parameter must be a non-negative number").int("Limit parameter must be a non-negative number").min(0,"Limit parameter must be a non-negative number").max(100,"Limit parameter must not exceed 100").optional(),lib:ft.enum(["react","angular","svelte","vanilla","vue"]).optional()});function mv(e){return async t=>{try{let r=pv.parse(t),n={q:r.q,limit:r.limit??30,lib:r.lib};return{results:e.search(n)}}catch(r){throw r instanceof Error?new Error(`Search failed: ${r.message}`):new Error("Search failed: Unknown error occurred")}}}var kA="ENTRIES",vv="KEYS",xv="VALUES";var Fo=class{constructor(t,r){let n=t._tree,o=Array.from(n.keys());this.set=t,this._type=r,this._path=o.length>0?[{node:n,keys:o}]:[]}next(){let t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:t,keys:r}=Sn(this._path);if(Sn(r)==="")return{done:!1,value:this.result()};let n=t.get(Sn(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let t=Sn(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Sn(t)).filter(t=>t!=="").join("")}value(){return Sn(this._path).node.get("")}result(){switch(this._type){case xv:return this.value();case vv:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},Sn=e=>e[e.length-1],SA=(e,t,r)=>{let n=new Map;if(t===void 0)return n;let o=t.length+1,i=o+r,s=new Uint8Array(i*o).fill(r+1);for(let a=0;a<o;++a)s[a]=a;for(let a=1;a<i;++a)s[a*o]=a;return bv(e,t,r,n,s,1,o,""),n},bv=(e,t,r,n,o,i,s,a)=>{let c=i*s;e:for(let u of e.keys())if(u===""){let l=o[c-1];l<=r&&n.set(a,[e.get(u),l])}else{let l=i;for(let d=0;d<u.length;++d,++l){let f=u[d],p=s*l,m=p-s,h=o[p],g=Math.max(0,l-r-1),x=Math.min(s-1,l+r);for(let w=g;w<x;++w){let $=f!==t[w],I=o[m+w]+ +$,A=o[m+w+1]+1,de=o[p+w]+1,ye=o[p+w+1]=Math.min(I,A,de);ye<h&&(h=ye)}if(h>r)continue e}bv(e.get(u),t,r,n,o,l,s,a+u)}},Lo=class e{constructor(t=new Map,r=""){this._size=void 0,this._tree=t,this._prefix=r}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");let[r,n]=Ss(this._tree,t.slice(this._prefix.length));if(r===void 0){let[o,i]=sl(n);for(let s of o.keys())if(s!==""&&s.startsWith(i)){let a=new Map;return a.set(s.slice(i.length),o.get(s)),new e(a,t)}}return new e(r,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,zA(this._tree,t)}entries(){return new Fo(this,kA)}forEach(t){for(let[r,n]of this)t(r,n,this)}fuzzyGet(t,r){return SA(this._tree,t,r)}get(t){let r=nl(this._tree,t);return r!==void 0?r.get(""):void 0}has(t){let r=nl(this._tree,t);return r!==void 0&&r.has("")}keys(){return new Fo(this,vv)}set(t,r){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Xu(this._tree,t).set("",r),this}get size(){if(this._size)return this._size;this._size=0;let t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,r){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;let n=Xu(this._tree,t);return n.set("",r(n.get(""))),this}fetch(t,r){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;let n=Xu(this._tree,t),o=n.get("");return o===void 0&&n.set("",o=r()),o}values(){return new Fo(this,xv)}[Symbol.iterator](){return this.entries()}static from(t){let r=new e;for(let[n,o]of t)r.set(n,o);return r}static fromObject(t){return e.from(Object.entries(t))}},Ss=(e,t,r=[])=>{if(t.length===0||e==null)return[e,r];for(let n of e.keys())if(n!==""&&t.startsWith(n))return r.push([e,n]),Ss(e.get(n),t.slice(n.length),r);return r.push([e,t]),Ss(void 0,"",r)},nl=(e,t)=>{if(t.length===0||e==null)return e;for(let r of e.keys())if(r!==""&&t.startsWith(r))return nl(e.get(r),t.slice(r.length))},Xu=(e,t)=>{let r=t.length;e:for(let n=0;e&&n<r;){for(let i of e.keys())if(i!==""&&t[n]===i[0]){let s=Math.min(r-n,i.length),a=1;for(;a<s&&t[n+a]===i[a];)++a;let c=e.get(i);if(a===i.length)e=c;else{let u=new Map;u.set(i.slice(a),c),e.set(t.slice(n,n+a),u),e.delete(i),e=u}n+=a;continue e}let o=new Map;return e.set(t.slice(n),o),o}return e},zA=(e,t)=>{let[r,n]=Ss(e,t);if(r!==void 0){if(r.delete(""),r.size===0)wv(n);else if(r.size===1){let[o,i]=r.entries().next().value;$v(n,o,i)}}},wv=e=>{if(e.length===0)return;let[t,r]=sl(e);if(t.delete(r),t.size===0)wv(e.slice(0,-1));else if(t.size===1){let[n,o]=t.entries().next().value;n!==""&&$v(e.slice(0,-1),n,o)}},$v=(e,t,r)=>{if(e.length===0)return;let[n,o]=sl(e);n.set(o+t,r),n.delete(o)},sl=e=>e[e.length-1],al="or",kv="and",EA="and_not",zn=class e{constructor(t){if(t?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let r=t.autoVacuum==null||t.autoVacuum===!0?rl:t.autoVacuum;this._options={...tl,...t,autoVacuum:r,searchOptions:{...hv,...t.searchOptions||{}},autoSuggestOptions:{...OA,...t.autoSuggestOptions||{}}},this._index=new Lo,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=il,this.addFields(this._options.fields)}add(t){let{extractField:r,stringifyField:n,tokenize:o,processTerm:i,fields:s,idField:a}=this._options,c=r(t,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,t);for(let l of s){let d=r(t,l);if(d==null)continue;let f=o(n(d,l),l),p=this._fieldIds[l],m=new Set(f).size;this.addFieldLength(u,p,this._documentCount-1,m);for(let h of f){let g=i(h,l);if(Array.isArray(g))for(let x of g)this.addTerm(p,u,x);else g&&this.addTerm(p,u,g)}}}addAll(t){for(let r of t)this.add(r)}addAllAsync(t,r={}){let{chunkSize:n=10}=r,o={chunk:[],promise:Promise.resolve()},{chunk:i,promise:s}=t.reduce(({chunk:a,promise:c},u,l)=>(a.push(u),(l+1)%n===0?{chunk:[],promise:c.then(()=>new Promise(d=>setTimeout(d,0))).then(()=>this.addAll(a))}:{chunk:a,promise:c}),o);return s.then(()=>this.addAll(i))}remove(t){let{tokenize:r,processTerm:n,extractField:o,stringifyField:i,fields:s,idField:a}=this._options,c=o(t,a);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${a}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of s){let d=o(t,l);if(d==null)continue;let f=r(i(d,l),l),p=this._fieldIds[l],m=new Set(f).size;this.removeFieldLength(u,p,this._documentCount,m);for(let h of f){let g=n(h,l);if(Array.isArray(g))for(let x of g)this.removeTerm(p,u,x);else g&&this.removeTerm(p,u,g)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(c),this._fieldLength.delete(u),this._documentCount-=1}removeAll(t){if(t)for(let r of t)this.remove(r);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Lo,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){let r=this._idToShortId.get(t);if(r==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach((n,o)=>{this.removeFieldLength(r,o,this._documentCount,n)}),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:t,minDirtCount:r,batchSize:n,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:o},{minDirtCount:r,minDirtFactor:t})}discardAll(t){let r=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let n of t)this.discard(n)}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()}replace(t){let{idField:r,extractField:n}=this._options,o=n(t,r);this.discard(o),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,r){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&r,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let n=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=il,this.performVacuuming(t,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(r)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,r){let n=this._dirtCount;if(this.vacuumConditionsMet(r)){let o=t.batchSize||ol.batchSize,i=t.batchWait||ol.batchWait,s=1;for(let[a,c]of this._index){for(let[u,l]of c)for(let[d]of l)this._documentIds.has(d)||(l.size<=1?c.delete(u):l.delete(d));this._index.get(a).size===0&&this._index.delete(a),s%o===0&&await new Promise(u=>setTimeout(u,i)),s+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:r,minDirtFactor:n}=t;return r=r||rl.minDirtCount,n=n||rl.minDirtFactor,this.dirtCount>=r&&this.dirtFactor>=n}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){let r=this._idToShortId.get(t);if(r!=null)return this._storedFields.get(r)}search(t,r={}){let{searchOptions:n}=this._options,o={...n,...r},i=this.executeQuery(t,r),s=[];for(let[a,{score:c,terms:u,match:l}]of i){let d=u.length||1,f={id:this._documentIds.get(a),score:c*d,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(f,this._storedFields.get(a)),(o.filter==null||o.filter(f))&&s.push(f)}return t===e.wildcard&&o.boostDocument==null||s.sort(_v),s}autoSuggest(t,r={}){r={...this._options.autoSuggestOptions,...r};let n=new Map;for(let{score:i,terms:s}of this.search(t,r)){let a=s.join(" "),c=n.get(a);c!=null?(c.score+=i,c.count+=1):n.set(a,{score:i,terms:s,count:1})}let o=[];for(let[i,{score:s,terms:a,count:c}]of n)o.push({suggestion:i,terms:a,score:s/c});return o.sort(_v),o}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,r){if(r==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),r)}static async loadJSONAsync(t,r){if(r==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),r)}static getDefault(t){if(tl.hasOwnProperty(t))return el(tl,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,r){let{index:n,documentIds:o,fieldLength:i,storedFields:s,serializationVersion:a}=t,c=this.instantiateMiniSearch(t,r);c._documentIds=$s(o),c._fieldLength=$s(i),c._storedFields=$s(s);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of n){let d=new Map;for(let f of Object.keys(l)){let p=l[f];a===1&&(p=p.ds),d.set(parseInt(f,10),$s(p))}c._index.set(u,d)}return c}static async loadJSAsync(t,r){let{index:n,documentIds:o,fieldLength:i,storedFields:s,serializationVersion:a}=t,c=this.instantiateMiniSearch(t,r);c._documentIds=await ks(o),c._fieldLength=await ks(i),c._storedFields=await ks(s);for(let[l,d]of c._documentIds)c._idToShortId.set(d,l);let u=0;for(let[l,d]of n){let f=new Map;for(let p of Object.keys(d)){let m=d[p];a===1&&(m=m.ds),f.set(parseInt(p,10),await ks(m))}++u%1e3===0&&await Sv(0),c._index.set(l,f)}return c}static instantiateMiniSearch(t,r){let{documentCount:n,nextId:o,fieldIds:i,averageFieldLength:s,dirtCount:a,serializationVersion:c}=t;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new e(r);return u._documentCount=n,u._nextId=o,u._idToShortId=new Map,u._fieldIds=i,u._avgFieldLength=s,u._dirtCount=a||0,u._index=new Lo,u}executeQuery(t,r={}){if(t===e.wildcard)return this.executeWildcardQuery(r);if(typeof t!="string"){let f={...r,...t,queries:void 0},p=t.queries.map(m=>this.executeQuery(m,f));return this.combineResults(p,f.combineWith)}let{tokenize:n,processTerm:o,searchOptions:i}=this._options,s={tokenize:n,processTerm:o,...i,...r},{tokenize:a,processTerm:c}=s,d=a(t).flatMap(f=>c(f)).filter(f=>!!f).map(AA(s)).map(f=>this.executeQuerySpec(f,s));return this.combineResults(d,s.combineWith)}executeQuerySpec(t,r){let n={...this._options.searchOptions,...r},o=(n.fields||this._options.fields).reduce((h,g)=>({...h,[g]:el(n.boost,g)||1}),{}),{boostDocument:i,weights:s,maxFuzzy:a,bm25:c}=n,{fuzzy:u,prefix:l}={...hv.weights,...s},d=this._index.get(t.term),f=this.termResults(t.term,t.term,1,t.termBoost,d,o,i,c),p,m;if(t.prefix&&(p=this._index.atPrefix(t.term)),t.fuzzy){let h=t.fuzzy===!0?.2:t.fuzzy,g=h<1?Math.min(a,Math.round(t.term.length*h)):h;g&&(m=this._index.fuzzyGet(t.term,g))}if(p)for(let[h,g]of p){let x=h.length-t.term.length;if(!x)continue;m?.delete(h);let w=l*h.length/(h.length+.3*x);this.termResults(t.term,h,w,t.termBoost,g,o,i,c,f)}if(m)for(let h of m.keys()){let[g,x]=m.get(h);if(!x)continue;let w=u*h.length/(h.length+x);this.termResults(t.term,h,w,t.termBoost,g,o,i,c,f)}return f}executeWildcardQuery(t){let r=new Map,n={...this._options.searchOptions,...t};for(let[o,i]of this._documentIds){let s=n.boostDocument?n.boostDocument(i,"",this._storedFields.get(o)):1;r.set(o,{score:s,terms:[],match:{}})}return r}combineResults(t,r=al){if(t.length===0)return new Map;let n=r.toLowerCase(),o=TA[n];if(!o)throw new Error(`Invalid combination operator: ${r}`);return t.reduce(o)||new Map}toJSON(){let t=[];for(let[r,n]of this._index){let o={};for(let[i,s]of n)o[i]=Object.fromEntries(s);t.push([r,o])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,r,n,o,i,s,a,c,u=new Map){if(i==null)return u;for(let l of Object.keys(s)){let d=s[l],f=this._fieldIds[l],p=i.get(f);if(p==null)continue;let m=p.size,h=this._avgFieldLength[f];for(let g of p.keys()){if(!this._documentIds.has(g)){this.removeTerm(f,g,r),m-=1;continue}let x=a?a(this._documentIds.get(g),r,this._storedFields.get(g)):1;if(!x)continue;let w=p.get(g),$=this._fieldLength.get(g)[f],I=IA(w,m,this._documentCount,$,h,c),A=n*o*d*x*I,de=u.get(g);if(de){de.score+=A,CA(de.terms,t);let ye=el(de.match,r);ye?ye.push(l):de.match[r]=[l]}else u.set(g,{score:A,terms:[t],match:{[r]:[l]}})}}return u}addTerm(t,r,n){let o=this._index.fetch(n,yv),i=o.get(t);if(i==null)i=new Map,i.set(r,1),o.set(t,i);else{let s=i.get(r);i.set(r,(s||0)+1)}}removeTerm(t,r,n){if(!this._index.has(n)){this.warnDocumentChanged(r,t,n);return}let o=this._index.fetch(n,yv),i=o.get(t);i==null||i.get(r)==null?this.warnDocumentChanged(r,t,n):i.get(r)<=1?i.size<=1?o.delete(t):i.delete(r):i.set(r,i.get(r)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(t,r,n){for(let o of Object.keys(this._fieldIds))if(this._fieldIds[o]===r){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${n}" was not present in field "${o}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){let r=this._nextId;return this._idToShortId.set(t,r),this._documentIds.set(r,t),this._documentCount+=1,this._nextId+=1,r}addFields(t){for(let r=0;r<t.length;r++)this._fieldIds[t[r]]=r}addFieldLength(t,r,n,o){let i=this._fieldLength.get(t);i==null&&this._fieldLength.set(t,i=[]),i[r]=o;let a=(this._avgFieldLength[r]||0)*n+o;this._avgFieldLength[r]=a/(n+1)}removeFieldLength(t,r,n,o){if(n===1){this._avgFieldLength[r]=0;return}let i=this._avgFieldLength[r]*n-o;this._avgFieldLength[r]=i/(n-1)}saveStoredFields(t,r){let{storeFields:n,extractField:o}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(t);i==null&&this._storedFields.set(t,i={});for(let s of n){let a=o(r,s);a!==void 0&&(i[s]=a)}}};zn.wildcard=Symbol("*");var el=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,TA={[al]:(e,t)=>{for(let r of t.keys()){let n=e.get(r);if(n==null)e.set(r,t.get(r));else{let{score:o,terms:i,match:s}=t.get(r);n.score=n.score+o,n.match=Object.assign(n.match,s),gv(n.terms,i)}}return e},[kv]:(e,t)=>{let r=new Map;for(let n of t.keys()){let o=e.get(n);if(o==null)continue;let{score:i,terms:s,match:a}=t.get(n);gv(o.terms,s),r.set(n,{score:o.score+i,terms:o.terms,match:Object.assign(o.match,a)})}return r},[EA]:(e,t)=>{for(let r of t.keys())e.delete(r);return e}},PA={k:1.2,b:.7,d:.5},IA=(e,t,r,n,o,i)=>{let{k:s,b:a,d:c}=i;return Math.log(1+(r-t+.5)/(t+.5))*(c+e*(s+1)/(e+s*(1-a+a*n/o)))},AA=e=>(t,r,n)=>{let o=typeof e.fuzzy=="function"?e.fuzzy(t,r,n):e.fuzzy||!1,i=typeof e.prefix=="function"?e.prefix(t,r,n):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,r,n):1;return{term:t,fuzzy:o,prefix:i,termBoost:s}},tl={idField:"id",extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(RA),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof console?.[e]=="function"&&console[e](t)},autoVacuum:!0},hv={combineWith:al,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:PA},OA={combineWith:kv,prefix:(e,t,r)=>t===r.length-1},ol={batchSize:1e3,batchWait:10},il={minDirtFactor:.1,minDirtCount:20},rl={...ol,...il},CA=(e,t)=>{e.includes(t)||e.push(t)},gv=(e,t)=>{for(let r of t)e.includes(r)||e.push(r)},_v=({score:e},{score:t})=>t-e,yv=()=>new Map,$s=e=>{let t=new Map;for(let r of Object.keys(e))t.set(parseInt(r,10),e[r]);return t},ks=async e=>{let t=new Map,r=0;for(let n of Object.keys(e))t.set(parseInt(n,10),e[n]),++r%1e3===0&&await Sv(0);return t},Sv=e=>new Promise(t=>setTimeout(t,e)),RA=/[\n\r\p{Z}\p{P}]+/u;var zv={fields:["pageTitle","sectionTitle","content","description","lib"],storeFields:["pageTitle","sectionTitle","content","path","url","description","lib"],searchOptions:{prefix:!0,fuzzy:.2,boost:{lib:20,sectionTitle:10,pageTitle:5,description:2,content:1}}},zs=class e{index;constructor(t){this.index=new zn(zv),this.index.addAll(t.map((r,n)=>({id:n,...r})))}toJSON(){return JSON.stringify(this.index)}static fromJSON(t){let r=Object.create(e.prototype);return r.index=zn.loadJSON(t,zv),r}search(t){let{q:r,limit:n=10}=t,o=r.trim();if(!o)return[];let i=this.index.search(o);return t.lib&&(i=i.filter(s=>s.lib===t.lib)),i.slice(0,n).map(s=>({pageTitle:s.pageTitle,sectionTitle:s.sectionTitle,content:s.content,description:s.description,path:s.path,url:s.url,lib:s.lib}))}};async function Tv(e,t){try{if(t==null||typeof t!="object")throw new Error("Invalid arguments: expected an object");let r=await e(t);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:JSON.stringify({error:r instanceof Error?r.message:"Unknown error occurred"},null,2)}],isError:!0}}}var Es=class{options;server;_running=!1;onSigInt=()=>{this.shutdown()};onSigTerm=()=>{this.shutdown()};toolHandlers;toolDefinitions;constructor(t){this.options=t,this.toolDefinitions=[],this.toolHandlers=new Map,this.server=new cs({name:t.name,version:t.version},{capabilities:{tools:{}}}),this.server.onerror=r=>{Oe(r)},process.on("SIGINT",this.onSigInt),process.on("SIGTERM",this.onSigTerm),this.init()}async start(){if(this._running)throw new Error("Server is already running");try{Oe(`Starting ${this.options.name} v${this.options.version}...`);let t=new ls;await this.server.connect(t),this._running=!0,Oe("Server started.")}catch(t){throw Oe("Failed to start server:"+(t instanceof Error?t.message:t)),t}}addIndex(t,r,n,o){let i=Ev(t,"utf-8"),s=ws.fromPages(JSON.parse(i)),a=dv(s);this.toolHandlers.set(r,a),this.toolDefinitions.push(uv(r,n)),Oe(`Added index: ${r}`)}addSearchEngine(t,r,n,o){let i=Ev(t,"utf-8"),s=zs.fromJSON(i),a=mv(s);this.toolHandlers.set(r,a),this.toolDefinitions.push(fv(r,n,o)),Oe(`Added search engine: ${r}`)}init(){this.server.setRequestHandler(Ma,async()=>({tools:this.toolDefinitions})),this.server.setRequestHandler(Xn,async t=>{let{name:r,arguments:n}=t.params,o=this.toolHandlers.get(r);return Tv(o||(()=>Promise.reject(new Error(`Unknown tool: ${r}`))),n)})}async shutdown(){if(this._running){Oe("Shutting down..."),this._running=!1,process.removeListener("SIGINT",this.onSigInt),process.removeListener("SIGTERM",this.onSigTerm);try{await this.server.close()}catch{}Oe("Server stopped")}}};var Pv="docs-search-index.json";var Iv="apidocs-search-index.json";import{fileURLToPath as NA}from"url";import{dirname as jA,join as Av,resolve as cl}from"path";import{readFileSync as DA}from"fs";var MA=NA(import.meta.url),ul=jA(MA),ZA=JSON.parse(DA(cl(ul,"./package.json"),"utf-8"));async function Ov(e){try{Oe("Starting server");let t=cl(ul,"data"),r=cl(ul,"apidata"),n=new Es({name:e.serverName,version:ZA.version});n.addSearchEngine(Av(t,Pv),e.docsToolId,e.docsToolDescription,e.excludeLibQueryParam),n.addSearchEngine(Av(r,Iv),e.apiToolId,e.apiToolDescription);let o=async()=>{await n.shutdown(),process.exit(0)};process.on("SIGINT",o),process.on("SIGTERM",o),await n.start()}catch(t){Oe("Error during boot: "),t instanceof Error?(Oe(` Error: ${t.message}`),t.stack&&Oe(` Stack: ${t.stack}`)):Oe(` Unknown error: ${t}`),process.exit(1)}}Ov({serverName:"visuallyjs-svelte-documentation",docsToolId:"search_vjs_svelte",docsToolDescription:"Search VisuallyJs Svelte docs",apiToolId:"search_vjs_svelte_api",apiToolDescription:"Search VisuallyJs Svelte apidocs",excludeLibQueryParam:!0});
78
+ /*! Bundled license information:
79
+
80
+ is-extendable/index.js:
81
+ (*!
82
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
83
+ *
84
+ * Copyright (c) 2015, Jon Schlinkert.
85
+ * Licensed under the MIT License.
86
+ *)
87
+
88
+ strip-bom-string/index.js:
89
+ (*!
90
+ * strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
91
+ *
92
+ * Copyright (c) 2015, 2017, Jon Schlinkert.
93
+ * Released under the MIT License.
94
+ *)
95
+ */