@reddb-io/red-skills 3.19.4 → 3.20.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.
@@ -1,64 +1,64 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
- var yP=Object.create;var Xs=Object.defineProperty;var _P=Object.getOwnPropertyDescriptor;var vP=Object.getOwnPropertyNames;var bP=Object.getPrototypeOf,wP=Object.prototype.hasOwnProperty;var mo=(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 xP=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var k=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ys=(e,t)=>{for(var r in t)Xs(e,r,{get:t[r],enumerable:!0})},by=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vP(t))!wP.call(e,o)&&o!==r&&Xs(e,o,{get:()=>t[o],enumerable:!(n=_P(t,o))||n.enumerable});return e};var Qs=(e,t,r)=>(r=e!=null?yP(bP(e)):{},by(t||!e||!e.__esModule?Xs(r,"default",{value:e,enumerable:!0}):r,e)),Mu=e=>by(Xs({},"__esModule",{value:!0}),e);var ts=k(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.regexpCode=le.getEsmExportName=le.getProperty=le.safeStringify=le.stringify=le.strConcat=le.addCodeArg=le.str=le._=le.nil=le._Code=le.Name=le.IDENTIFIER=le._CodeOrName=void 0;var Qi=class{};le._CodeOrName=Qi;le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Hn=class extends Qi{constructor(t){if(super(),!le.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}}};le.Name=Hn;var Lt=class extends Qi{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 Hn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};le._Code=Lt;le.nil=new Lt("");function gb(e,...t){let r=[e[0]],n=0;for(;n<t.length;)yf(r,t[n]),r.push(e[++n]);return new Lt(r)}le._=gb;var gf=new Lt("+");function yb(e,...t){let r=[es(e[0])],n=0;for(;n<t.length;)r.push(gf),yf(r,t[n]),r.push(gf,es(e[++n]));return vO(r),new Lt(r)}le.str=yb;function yf(e,t){t instanceof Lt?e.push(...t._items):t instanceof Hn?e.push(t):e.push(xO(t))}le.addCodeArg=yf;function vO(e){let t=1;for(;t<e.length-1;){if(e[t]===gf){let r=bO(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function bO(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Hn||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 Hn))return`"${e}${t.slice(1)}`}function wO(e,t){return t.emptyStr()?e:e.emptyStr()?t:yb`${e}${t}`}le.strConcat=wO;function xO(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:es(Array.isArray(e)?e.join(","):e)}function $O(e){return new Lt(es(e))}le.stringify=$O;function es(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}le.safeStringify=es;function SO(e){return typeof e=="string"&&le.IDENTIFIER.test(e)?new Lt(`.${e}`):gb`[${e}]`}le.getProperty=SO;function kO(e){if(typeof e=="string"&&le.IDENTIFIER.test(e))return new Lt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}le.getEsmExportName=kO;function PO(e){return new Lt(e.toString())}le.regexpCode=PO});var bf=k(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.ValueScope=St.ValueScopeName=St.Scope=St.varKinds=St.UsedValueState=void 0;var $t=ts(),_f=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ec;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ec||(St.UsedValueState=ec={}));St.varKinds={const:new $t.Name("const"),let:new $t.Name("let"),var:new $t.Name("var")};var tc=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof $t.Name?t:this.name(t)}name(t){return new $t.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}}};St.Scope=tc;var rc=class extends $t.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,$t._)`.${new $t.Name(r)}[${n}]`}};St.ValueScopeName=rc;var TO=(0,$t._)`\n`,vf=class extends tc{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?TO:$t.nil}}get(){return this._scope}name(t){return new rc(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,$t._)`${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=$t.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,ec.Started);let l=r(u);if(l){let d=this.opts.es5?St.varKinds.var:St.varKinds.const;i=(0,$t._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))i=(0,$t._)`${i}${l}${this.opts._n}`;else throw new _f(u);c.set(u,ec.Completed)})}return i}};St.ValueScope=vf});var Q=k(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.or=ee.and=ee.not=ee.CodeGen=ee.operators=ee.varKinds=ee.ValueScopeName=ee.ValueScope=ee.Scope=ee.Name=ee.regexpCode=ee.stringify=ee.getProperty=ee.nil=ee.strConcat=ee.str=ee._=void 0;var se=ts(),Xt=bf(),Xr=ts();Object.defineProperty(ee,"_",{enumerable:!0,get:function(){return Xr._}});Object.defineProperty(ee,"str",{enumerable:!0,get:function(){return Xr.str}});Object.defineProperty(ee,"strConcat",{enumerable:!0,get:function(){return Xr.strConcat}});Object.defineProperty(ee,"nil",{enumerable:!0,get:function(){return Xr.nil}});Object.defineProperty(ee,"getProperty",{enumerable:!0,get:function(){return Xr.getProperty}});Object.defineProperty(ee,"stringify",{enumerable:!0,get:function(){return Xr.stringify}});Object.defineProperty(ee,"regexpCode",{enumerable:!0,get:function(){return Xr.regexpCode}});Object.defineProperty(ee,"Name",{enumerable:!0,get:function(){return Xr.Name}});var sc=bf();Object.defineProperty(ee,"Scope",{enumerable:!0,get:function(){return sc.Scope}});Object.defineProperty(ee,"ValueScope",{enumerable:!0,get:function(){return sc.ValueScope}});Object.defineProperty(ee,"ValueScopeName",{enumerable:!0,get:function(){return sc.ValueScopeName}});Object.defineProperty(ee,"varKinds",{enumerable:!0,get:function(){return sc.varKinds}});ee.operators={GT:new se._Code(">"),GTE:new se._Code(">="),LT:new se._Code("<"),LTE:new se._Code("<="),EQ:new se._Code("==="),NEQ:new se._Code("!=="),NOT:new se._Code("!"),OR:new se._Code("||"),AND:new se._Code("&&"),ADD:new se._Code("+")};var Pr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},wf=class extends Pr{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Xt.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=jo(this.rhs,t,r)),this}get names(){return this.rhs instanceof se._CodeOrName?this.rhs.names:{}}},nc=class extends Pr{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 se.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=jo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof se.Name?{}:{...this.lhs.names};return ic(t,this.rhs)}},xf=class extends nc{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},$f=class extends Pr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Sf=class extends Pr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},kf=class extends Pr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Pf=class extends Pr{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=jo(this.code,t,r),this}get names(){return this.code instanceof se._CodeOrName?this.code.names:{}}},rs=class extends Pr{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)||(zO(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Jn(t,r.names),{})}},Tr=class extends rs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Tf=class extends rs{},Co=class extends Tr{};Co.kind="else";var Bn=class e extends Tr{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 Co(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(_b(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=jo(this.condition,t,r),this}get names(){let t=super.names;return ic(t,this.condition),this.else&&Jn(t,this.else.names),t}};Bn.kind="if";var Wn=class extends Tr{};Wn.kind="for";var zf=class extends Wn{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=jo(this.iteration,t,r),this}get names(){return Jn(super.names,this.iteration.names)}},Rf=class extends Wn{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Xt.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=ic(super.names,this.from);return ic(t,this.to)}},oc=class extends Wn{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=jo(this.iterable,t,r),this}get names(){return Jn(super.names,this.iterable.names)}},ns=class extends Tr{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)}};ns.kind="func";var os=class extends rs{render(t){return"return "+super.render(t)}};os.kind="return";var Ef=class extends Tr{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&&Jn(t,this.catch.names),this.finally&&Jn(t,this.finally.names),t}},is=class extends Tr{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};is.kind="catch";var ss=class extends Tr{render(t){return"finally"+super.render(t)}};ss.kind="finally";var Of=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
4
- `:""},this._extScope=t,this._scope=new Xt.Scope({parent:t}),this._nodes=[new Tf]}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 wf(t,i,n)),i}const(t,r,n){return this._def(Xt.varKinds.const,t,r,n)}let(t,r,n){return this._def(Xt.varKinds.let,t,r,n)}var(t,r,n){return this._def(Xt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new nc(t,r,n))}add(t,r){return this._leafNode(new xf(t,ee.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==se.nil&&this._leafNode(new Pf(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,se.addCodeArg)(r,o));return r.push("}"),new se._Code(r)}if(t,r,n){if(this._blockNode(new Bn(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 Bn(t))}else(){return this._elseNode(new Co)}endIf(){return this._endBlockNode(Bn,Co)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new zf(t),r)}forRange(t,r,n,o,i=this.opts.es5?Xt.varKinds.var:Xt.varKinds.let){let s=this._scope.toName(t);return this._for(new Rf(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Xt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof se.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,se._)`${s}.length`,a=>{this.var(i,(0,se._)`${s}[${a}]`),n(i)})}return this._for(new oc("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Xt.varKinds.var:Xt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,se._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new oc("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Wn)}label(t){return this._leafNode(new $f(t))}break(t){return this._leafNode(new Sf(t))}return(t){let r=new os;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(os)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Ef;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new is(i),r(i)}return n&&(this._currNode=o.finally=new ss,this.code(n)),this._endBlockNode(is,ss)}throw(t){return this._leafNode(new kf(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=se.nil,n,o){return this._blockNode(new ns(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ns)}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 Bn))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}};ee.CodeGen=Of;function Jn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ic(e,t){return t instanceof se._CodeOrName?Jn(e,t.names):e}function jo(e,t,r){if(e instanceof se.Name)return n(e);if(!o(e))return e;return new se._Code(e._items.reduce((i,s)=>(s instanceof se.Name&&(s=n(s)),s instanceof se._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 se._Code&&i._items.some(s=>s instanceof se.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function zO(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function _b(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,se._)`!${Cf(e)}`}ee.not=_b;var RO=vb(ee.operators.AND);function EO(...e){return e.reduce(RO)}ee.and=EO;var OO=vb(ee.operators.OR);function CO(...e){return e.reduce(OO)}ee.or=CO;function vb(e){return(t,r)=>t===se.nil?r:r===se.nil?t:(0,se._)`${Cf(t)} ${e} ${Cf(r)}`}function Cf(e){return e instanceof se.Name?e:(0,se._)`(${e})`}});var ce=k(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var ve=Q(),jO=ts();function MO(e){let t={};for(let r of e)t[r]=!0;return t}te.toHash=MO;function NO(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(xb(e,t),!$b(t,e.self.RULES.all))}te.alwaysValidSchema=NO;function xb(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]||Pb(e,`unknown keyword: "${i}"`)}te.checkUnknownRules=xb;function $b(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}te.schemaHasRules=$b;function IO(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}te.schemaHasRulesButRef=IO;function DO({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ve._)`${r}`}return(0,ve._)`${e}${t}${(0,ve.getProperty)(n)}`}te.schemaRefOrVal=DO;function AO(e){return Sb(decodeURIComponent(e))}te.unescapeFragment=AO;function qO(e){return encodeURIComponent(Mf(e))}te.escapeFragment=qO;function Mf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Mf;function Sb(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=Sb;function ZO(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}te.eachItem=ZO;function bb({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof ve.Name?(i instanceof ve.Name?e(o,i,s):t(o,i,s),s):i instanceof ve.Name?(t(o,s,i),i):r(i,s);return a===ve.Name&&!(c instanceof ve.Name)?n(o,c):c}}te.mergeEvaluated={props:bb({mergeNames:(e,t,r)=>e.if((0,ve._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ve._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ve._)`${r} || {}`).code((0,ve._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ve._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ve._)`${r} || {}`),Nf(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:kb}),items:bb({mergeNames:(e,t,r)=>e.if((0,ve._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ve._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ve._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ve._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function kb(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ve._)`{}`);return t!==void 0&&Nf(e,r,t),r}te.evaluatedPropsToName=kb;function Nf(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ve._)`${t}${(0,ve.getProperty)(n)}`,!0))}te.setEvaluated=Nf;var wb={};function LO(e,t){return e.scopeValue("func",{ref:t,code:wb[t.code]||(wb[t.code]=new jO._Code(t.code))})}te.useFunc=LO;var jf;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(jf||(te.Type=jf={}));function FO(e,t,r){if(e instanceof ve.Name){let n=t===jf.Num;return r?n?(0,ve._)`"[" + ${e} + "]"`:(0,ve._)`"['" + ${e} + "']"`:n?(0,ve._)`"/" + ${e}`:(0,ve._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ve.getProperty)(e).toString():"/"+Mf(e)}te.getErrorPath=FO;function Pb(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}te.checkStrictMode=Pb});var zr=k(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});var it=Q(),UO={data:new it.Name("data"),valCxt:new it.Name("valCxt"),instancePath:new it.Name("instancePath"),parentData:new it.Name("parentData"),parentDataProperty:new it.Name("parentDataProperty"),rootData:new it.Name("rootData"),dynamicAnchors:new it.Name("dynamicAnchors"),vErrors:new it.Name("vErrors"),errors:new it.Name("errors"),this:new it.Name("this"),self:new it.Name("self"),scope:new it.Name("scope"),json:new it.Name("json"),jsonPos:new it.Name("jsonPos"),jsonLen:new it.Name("jsonLen"),jsonPart:new it.Name("jsonPart")};If.default=UO});var as=k(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.extendErrors=st.resetErrorsCount=st.reportExtraError=st.reportError=st.keyword$DataError=st.keywordError=void 0;var ue=Q(),ac=ce(),yt=zr();st.keywordError={message:({keyword:e})=>(0,ue.str)`must pass "${e}" keyword validation`};st.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ue.str)`"${e}" keyword must be ${t} ($data)`:(0,ue.str)`"${e}" keyword is invalid ($data)`};function VO(e,t=st.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Rb(e,t,r);n??(s||a)?Tb(i,c):zb(o,(0,ue._)`[${c}]`)}st.reportError=VO;function HO(e,t=st.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Rb(e,t,r);Tb(o,a),i||s||zb(n,yt.default.vErrors)}st.reportExtraError=HO;function BO(e,t){e.assign(yt.default.errors,t),e.if((0,ue._)`${yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ue._)`${yt.default.vErrors}.length`,t),()=>e.assign(yt.default.vErrors,null)))}st.resetErrorsCount=BO;function WO({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,yt.default.errors,a=>{e.const(s,(0,ue._)`${yt.default.vErrors}[${a}]`),e.if((0,ue._)`${s}.instancePath === undefined`,()=>e.assign((0,ue._)`${s}.instancePath`,(0,ue.strConcat)(yt.default.instancePath,i.errorPath))),e.assign((0,ue._)`${s}.schemaPath`,(0,ue.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ue._)`${s}.schema`,r),e.assign((0,ue._)`${s}.data`,n))})}st.extendErrors=WO;function Tb(e,t){let r=e.const("err",t);e.if((0,ue._)`${yt.default.vErrors} === null`,()=>e.assign(yt.default.vErrors,(0,ue._)`[${r}]`),(0,ue._)`${yt.default.vErrors}.push(${r})`),e.code((0,ue._)`${yt.default.errors}++`)}function zb(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ue._)`new ${e.ValidationError}(${t})`):(r.assign((0,ue._)`${n}.errors`,t),r.return(!1))}var Gn={keyword:new ue.Name("keyword"),schemaPath:new ue.Name("schemaPath"),params:new ue.Name("params"),propertyName:new ue.Name("propertyName"),message:new ue.Name("message"),schema:new ue.Name("schema"),parentSchema:new ue.Name("parentSchema")};function Rb(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ue._)`{}`:JO(e,t,r)}function JO(e,t,r={}){let{gen:n,it:o}=e,i=[GO(o,r),KO(e,r)];return XO(e,t,i),n.object(...i)}function GO({errorPath:e},{instancePath:t}){let r=t?(0,ue.str)`${e}${(0,ac.getErrorPath)(t,ac.Type.Str)}`:e;return[yt.default.instancePath,(0,ue.strConcat)(yt.default.instancePath,r)]}function KO({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ue.str)`${t}/${e}`;return r&&(o=(0,ue.str)`${o}${(0,ac.getErrorPath)(r,ac.Type.Str)}`),[Gn.schemaPath,o]}function XO(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([Gn.keyword,o],[Gn.params,typeof t=="function"?t(e):t||(0,ue._)`{}`]),c.messages&&n.push([Gn.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Gn.schema,s],[Gn.parentSchema,(0,ue._)`${l}${d}`],[yt.default.data,i]),u&&n.push([Gn.propertyName,u])}});var Ob=k(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.boolOrEmptySchema=Mo.topBoolOrEmptySchema=void 0;var YO=as(),QO=Q(),eC=zr(),tC={message:"boolean schema is false"};function rC(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Eb(e,!1):typeof r=="object"&&r.$async===!0?t.return(eC.default.data):(t.assign((0,QO._)`${n}.errors`,null),t.return(!0))}Mo.topBoolOrEmptySchema=rC;function nC(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Eb(e)):r.var(t,!0)}Mo.boolOrEmptySchema=nC;function Eb(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,YO.reportError)(o,tC,void 0,t)}});var Df=k(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.getRules=No.isJSONType=void 0;var oC=["string","number","integer","boolean","null","object","array"],iC=new Set(oC);function sC(e){return typeof e=="string"&&iC.has(e)}No.isJSONType=sC;function aC(){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:{}}}No.getRules=aC});var Af=k(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.shouldUseRule=Yr.shouldUseGroup=Yr.schemaHasRulesForType=void 0;function cC({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Cb(e,n)}Yr.schemaHasRulesForType=cC;function Cb(e,t){return t.rules.some(r=>jb(e,r))}Yr.shouldUseGroup=Cb;function jb(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))}Yr.shouldUseRule=jb});var cs=k(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.reportTypeError=at.checkDataTypes=at.checkDataType=at.coerceAndCheckDataType=at.getJSONTypes=at.getSchemaTypes=at.DataType=void 0;var uC=Df(),lC=Af(),dC=as(),X=Q(),Mb=ce(),Io;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Io||(at.DataType=Io={}));function fC(e){let t=Nb(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}at.getSchemaTypes=fC;function Nb(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(uC.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}at.getJSONTypes=Nb;function pC(e,t){let{gen:r,data:n,opts:o}=e,i=mC(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,lC.schemaHasRulesForType)(e,t[0]));if(s){let a=Zf(t,n,o.strictNumbers,Io.Wrong);r.if(a,()=>{i.length?hC(e,t,i):Lf(e)})}return s}at.coerceAndCheckDataType=pC;var Ib=new Set(["string","number","integer","boolean","null"]);function mC(e,t){return t?e.filter(r=>Ib.has(r)||t==="array"&&r==="array"):[]}function hC(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,X._)`typeof ${o}`),a=n.let("coerced",(0,X._)`undefined`);i.coerceTypes==="array"&&n.if((0,X._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,X._)`${o}[0]`).assign(s,(0,X._)`typeof ${o}`).if(Zf(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,X._)`${a} !== undefined`);for(let u of r)(Ib.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Lf(e),n.endIf(),n.if((0,X._)`${a} !== undefined`,()=>{n.assign(o,a),gC(e,a)});function c(u){switch(u){case"string":n.elseIf((0,X._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,X._)`"" + ${o}`).elseIf((0,X._)`${o} === null`).assign(a,(0,X._)`""`);return;case"number":n.elseIf((0,X._)`${s} == "boolean" || ${o} === null
3
+ var xP=Object.create;var Ys=Object.defineProperty;var $P=Object.getOwnPropertyDescriptor;var SP=Object.getOwnPropertyNames;var kP=Object.getPrototypeOf,PP=Object.prototype.hasOwnProperty;var ho=(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 TP=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var k=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Qs=(e,t)=>{for(var r in t)Ys(e,r,{get:t[r],enumerable:!0})},$y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of SP(t))!PP.call(e,o)&&o!==r&&Ys(e,o,{get:()=>t[o],enumerable:!(n=$P(t,o))||n.enumerable});return e};var ea=(e,t,r)=>(r=e!=null?xP(kP(e)):{},$y(t||!e||!e.__esModule?Ys(r,"default",{value:e,enumerable:!0}):r,e)),Mu=e=>$y(Ys({},"__esModule",{value:!0}),e);var rs=k(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.regexpCode=le.getEsmExportName=le.getProperty=le.safeStringify=le.stringify=le.strConcat=le.addCodeArg=le.str=le._=le.nil=le._Code=le.Name=le.IDENTIFIER=le._CodeOrName=void 0;var es=class{};le._CodeOrName=es;le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bn=class extends es{constructor(t){if(super(),!le.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}}};le.Name=Bn;var Lt=class extends es{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 Bn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};le._Code=Lt;le.nil=new Lt("");function vb(e,...t){let r=[e[0]],n=0;for(;n<t.length;)vf(r,t[n]),r.push(e[++n]);return new Lt(r)}le._=vb;var _f=new Lt("+");function bb(e,...t){let r=[ts(e[0])],n=0;for(;n<t.length;)r.push(_f),vf(r,t[n]),r.push(_f,ts(e[++n]));return SO(r),new Lt(r)}le.str=bb;function vf(e,t){t instanceof Lt?e.push(...t._items):t instanceof Bn?e.push(t):e.push(TO(t))}le.addCodeArg=vf;function SO(e){let t=1;for(;t<e.length-1;){if(e[t]===_f){let r=kO(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function kO(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Bn||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 Bn))return`"${e}${t.slice(1)}`}function PO(e,t){return t.emptyStr()?e:e.emptyStr()?t:bb`${e}${t}`}le.strConcat=PO;function TO(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ts(Array.isArray(e)?e.join(","):e)}function RO(e){return new Lt(ts(e))}le.stringify=RO;function ts(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}le.safeStringify=ts;function zO(e){return typeof e=="string"&&le.IDENTIFIER.test(e)?new Lt(`.${e}`):vb`[${e}]`}le.getProperty=zO;function EO(e){if(typeof e=="string"&&le.IDENTIFIER.test(e))return new Lt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}le.getEsmExportName=EO;function OO(e){return new Lt(e.toString())}le.regexpCode=OO});var xf=k(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.ValueScope=St.ValueScopeName=St.Scope=St.varKinds=St.UsedValueState=void 0;var $t=rs(),bf=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},tc;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(tc||(St.UsedValueState=tc={}));St.varKinds={const:new $t.Name("const"),let:new $t.Name("let"),var:new $t.Name("var")};var rc=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof $t.Name?t:this.name(t)}name(t){return new $t.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}}};St.Scope=rc;var nc=class extends $t.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,$t._)`.${new $t.Name(r)}[${n}]`}};St.ValueScopeName=nc;var CO=(0,$t._)`\n`,wf=class extends rc{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?CO:$t.nil}}get(){return this._scope}name(t){return new nc(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,$t._)`${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=$t.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,tc.Started);let l=r(u);if(l){let d=this.opts.es5?St.varKinds.var:St.varKinds.const;i=(0,$t._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))i=(0,$t._)`${i}${l}${this.opts._n}`;else throw new bf(u);c.set(u,tc.Completed)})}return i}};St.ValueScope=wf});var Q=k(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.or=ee.and=ee.not=ee.CodeGen=ee.operators=ee.varKinds=ee.ValueScopeName=ee.ValueScope=ee.Scope=ee.Name=ee.regexpCode=ee.stringify=ee.getProperty=ee.nil=ee.strConcat=ee.str=ee._=void 0;var se=rs(),Xt=xf(),Xr=rs();Object.defineProperty(ee,"_",{enumerable:!0,get:function(){return Xr._}});Object.defineProperty(ee,"str",{enumerable:!0,get:function(){return Xr.str}});Object.defineProperty(ee,"strConcat",{enumerable:!0,get:function(){return Xr.strConcat}});Object.defineProperty(ee,"nil",{enumerable:!0,get:function(){return Xr.nil}});Object.defineProperty(ee,"getProperty",{enumerable:!0,get:function(){return Xr.getProperty}});Object.defineProperty(ee,"stringify",{enumerable:!0,get:function(){return Xr.stringify}});Object.defineProperty(ee,"regexpCode",{enumerable:!0,get:function(){return Xr.regexpCode}});Object.defineProperty(ee,"Name",{enumerable:!0,get:function(){return Xr.Name}});var ac=xf();Object.defineProperty(ee,"Scope",{enumerable:!0,get:function(){return ac.Scope}});Object.defineProperty(ee,"ValueScope",{enumerable:!0,get:function(){return ac.ValueScope}});Object.defineProperty(ee,"ValueScopeName",{enumerable:!0,get:function(){return ac.ValueScopeName}});Object.defineProperty(ee,"varKinds",{enumerable:!0,get:function(){return ac.varKinds}});ee.operators={GT:new se._Code(">"),GTE:new se._Code(">="),LT:new se._Code("<"),LTE:new se._Code("<="),EQ:new se._Code("==="),NEQ:new se._Code("!=="),NOT:new se._Code("!"),OR:new se._Code("||"),AND:new se._Code("&&"),ADD:new se._Code("+")};var Pr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},$f=class extends Pr{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Xt.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=No(this.rhs,t,r)),this}get names(){return this.rhs instanceof se._CodeOrName?this.rhs.names:{}}},oc=class extends Pr{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 se.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=No(this.rhs,t,r),this}get names(){let t=this.lhs instanceof se.Name?{}:{...this.lhs.names};return sc(t,this.rhs)}},Sf=class extends oc{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},kf=class extends Pr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Pf=class extends Pr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Tf=class extends Pr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Rf=class extends Pr{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=No(this.code,t,r),this}get names(){return this.code instanceof se._CodeOrName?this.code.names:{}}},ns=class extends Pr{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)||(jO(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Gn(t,r.names),{})}},Tr=class extends ns{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},zf=class extends ns{},jo=class extends Tr{};jo.kind="else";var Wn=class e extends Tr{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 jo(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(wb(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=No(this.condition,t,r),this}get names(){let t=super.names;return sc(t,this.condition),this.else&&Gn(t,this.else.names),t}};Wn.kind="if";var Jn=class extends Tr{};Jn.kind="for";var Ef=class extends Jn{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=No(this.iteration,t,r),this}get names(){return Gn(super.names,this.iteration.names)}},Of=class extends Jn{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Xt.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=sc(super.names,this.from);return sc(t,this.to)}},ic=class extends Jn{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=No(this.iterable,t,r),this}get names(){return Gn(super.names,this.iterable.names)}},os=class extends Tr{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)}};os.kind="func";var is=class extends ns{render(t){return"return "+super.render(t)}};is.kind="return";var Cf=class extends Tr{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&&Gn(t,this.catch.names),this.finally&&Gn(t,this.finally.names),t}},ss=class extends Tr{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};ss.kind="catch";var as=class extends Tr{render(t){return"finally"+super.render(t)}};as.kind="finally";var jf=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
4
+ `:""},this._extScope=t,this._scope=new Xt.Scope({parent:t}),this._nodes=[new zf]}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 $f(t,i,n)),i}const(t,r,n){return this._def(Xt.varKinds.const,t,r,n)}let(t,r,n){return this._def(Xt.varKinds.let,t,r,n)}var(t,r,n){return this._def(Xt.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new oc(t,r,n))}add(t,r){return this._leafNode(new Sf(t,ee.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==se.nil&&this._leafNode(new Rf(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,se.addCodeArg)(r,o));return r.push("}"),new se._Code(r)}if(t,r,n){if(this._blockNode(new Wn(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 Wn(t))}else(){return this._elseNode(new jo)}endIf(){return this._endBlockNode(Wn,jo)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Ef(t),r)}forRange(t,r,n,o,i=this.opts.es5?Xt.varKinds.var:Xt.varKinds.let){let s=this._scope.toName(t);return this._for(new Of(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Xt.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof se.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,se._)`${s}.length`,a=>{this.var(i,(0,se._)`${s}[${a}]`),n(i)})}return this._for(new ic("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Xt.varKinds.var:Xt.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,se._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new ic("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Jn)}label(t){return this._leafNode(new kf(t))}break(t){return this._leafNode(new Pf(t))}return(t){let r=new is;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(is)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Cf;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new ss(i),r(i)}return n&&(this._currNode=o.finally=new as,this.code(n)),this._endBlockNode(ss,as)}throw(t){return this._leafNode(new Tf(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=se.nil,n,o){return this._blockNode(new os(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(os)}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 Wn))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}};ee.CodeGen=jf;function Gn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function sc(e,t){return t instanceof se._CodeOrName?Gn(e,t.names):e}function No(e,t,r){if(e instanceof se.Name)return n(e);if(!o(e))return e;return new se._Code(e._items.reduce((i,s)=>(s instanceof se.Name&&(s=n(s)),s instanceof se._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 se._Code&&i._items.some(s=>s instanceof se.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function jO(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function wb(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,se._)`!${Nf(e)}`}ee.not=wb;var NO=xb(ee.operators.AND);function IO(...e){return e.reduce(NO)}ee.and=IO;var MO=xb(ee.operators.OR);function DO(...e){return e.reduce(MO)}ee.or=DO;function xb(e){return(t,r)=>t===se.nil?r:r===se.nil?t:(0,se._)`${Nf(t)} ${e} ${Nf(r)}`}function Nf(e){return e instanceof se.Name?e:(0,se._)`(${e})`}});var ce=k(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var ve=Q(),AO=rs();function qO(e){let t={};for(let r of e)t[r]=!0;return t}te.toHash=qO;function ZO(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(kb(e,t),!Pb(t,e.self.RULES.all))}te.alwaysValidSchema=ZO;function kb(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]||zb(e,`unknown keyword: "${i}"`)}te.checkUnknownRules=kb;function Pb(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}te.schemaHasRules=Pb;function LO(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}te.schemaHasRulesButRef=LO;function FO({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ve._)`${r}`}return(0,ve._)`${e}${t}${(0,ve.getProperty)(n)}`}te.schemaRefOrVal=FO;function UO(e){return Tb(decodeURIComponent(e))}te.unescapeFragment=UO;function VO(e){return encodeURIComponent(Mf(e))}te.escapeFragment=VO;function Mf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Mf;function Tb(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=Tb;function HO(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}te.eachItem=HO;function $b({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof ve.Name?(i instanceof ve.Name?e(o,i,s):t(o,i,s),s):i instanceof ve.Name?(t(o,s,i),i):r(i,s);return a===ve.Name&&!(c instanceof ve.Name)?n(o,c):c}}te.mergeEvaluated={props:$b({mergeNames:(e,t,r)=>e.if((0,ve._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ve._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ve._)`${r} || {}`).code((0,ve._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ve._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ve._)`${r} || {}`),Df(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Rb}),items:$b({mergeNames:(e,t,r)=>e.if((0,ve._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ve._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ve._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ve._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Rb(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ve._)`{}`);return t!==void 0&&Df(e,r,t),r}te.evaluatedPropsToName=Rb;function Df(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ve._)`${t}${(0,ve.getProperty)(n)}`,!0))}te.setEvaluated=Df;var Sb={};function BO(e,t){return e.scopeValue("func",{ref:t,code:Sb[t.code]||(Sb[t.code]=new AO._Code(t.code))})}te.useFunc=BO;var If;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(If||(te.Type=If={}));function WO(e,t,r){if(e instanceof ve.Name){let n=t===If.Num;return r?n?(0,ve._)`"[" + ${e} + "]"`:(0,ve._)`"['" + ${e} + "']"`:n?(0,ve._)`"/" + ${e}`:(0,ve._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ve.getProperty)(e).toString():"/"+Mf(e)}te.getErrorPath=WO;function zb(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}te.checkStrictMode=zb});var Rr=k(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var it=Q(),JO={data:new it.Name("data"),valCxt:new it.Name("valCxt"),instancePath:new it.Name("instancePath"),parentData:new it.Name("parentData"),parentDataProperty:new it.Name("parentDataProperty"),rootData:new it.Name("rootData"),dynamicAnchors:new it.Name("dynamicAnchors"),vErrors:new it.Name("vErrors"),errors:new it.Name("errors"),this:new it.Name("this"),self:new it.Name("self"),scope:new it.Name("scope"),json:new it.Name("json"),jsonPos:new it.Name("jsonPos"),jsonLen:new it.Name("jsonLen"),jsonPart:new it.Name("jsonPart")};Af.default=JO});var cs=k(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.extendErrors=st.resetErrorsCount=st.reportExtraError=st.reportError=st.keyword$DataError=st.keywordError=void 0;var ue=Q(),cc=ce(),yt=Rr();st.keywordError={message:({keyword:e})=>(0,ue.str)`must pass "${e}" keyword validation`};st.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ue.str)`"${e}" keyword must be ${t} ($data)`:(0,ue.str)`"${e}" keyword is invalid ($data)`};function GO(e,t=st.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=Cb(e,t,r);n??(s||a)?Eb(i,c):Ob(o,(0,ue._)`[${c}]`)}st.reportError=GO;function KO(e,t=st.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=Cb(e,t,r);Eb(o,a),i||s||Ob(n,yt.default.vErrors)}st.reportExtraError=KO;function XO(e,t){e.assign(yt.default.errors,t),e.if((0,ue._)`${yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ue._)`${yt.default.vErrors}.length`,t),()=>e.assign(yt.default.vErrors,null)))}st.resetErrorsCount=XO;function YO({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,yt.default.errors,a=>{e.const(s,(0,ue._)`${yt.default.vErrors}[${a}]`),e.if((0,ue._)`${s}.instancePath === undefined`,()=>e.assign((0,ue._)`${s}.instancePath`,(0,ue.strConcat)(yt.default.instancePath,i.errorPath))),e.assign((0,ue._)`${s}.schemaPath`,(0,ue.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ue._)`${s}.schema`,r),e.assign((0,ue._)`${s}.data`,n))})}st.extendErrors=YO;function Eb(e,t){let r=e.const("err",t);e.if((0,ue._)`${yt.default.vErrors} === null`,()=>e.assign(yt.default.vErrors,(0,ue._)`[${r}]`),(0,ue._)`${yt.default.vErrors}.push(${r})`),e.code((0,ue._)`${yt.default.errors}++`)}function Ob(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ue._)`new ${e.ValidationError}(${t})`):(r.assign((0,ue._)`${n}.errors`,t),r.return(!1))}var Kn={keyword:new ue.Name("keyword"),schemaPath:new ue.Name("schemaPath"),params:new ue.Name("params"),propertyName:new ue.Name("propertyName"),message:new ue.Name("message"),schema:new ue.Name("schema"),parentSchema:new ue.Name("parentSchema")};function Cb(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ue._)`{}`:QO(e,t,r)}function QO(e,t,r={}){let{gen:n,it:o}=e,i=[eC(o,r),tC(e,r)];return rC(e,t,i),n.object(...i)}function eC({errorPath:e},{instancePath:t}){let r=t?(0,ue.str)`${e}${(0,cc.getErrorPath)(t,cc.Type.Str)}`:e;return[yt.default.instancePath,(0,ue.strConcat)(yt.default.instancePath,r)]}function tC({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ue.str)`${t}/${e}`;return r&&(o=(0,ue.str)`${o}${(0,cc.getErrorPath)(r,cc.Type.Str)}`),[Kn.schemaPath,o]}function rC(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([Kn.keyword,o],[Kn.params,typeof t=="function"?t(e):t||(0,ue._)`{}`]),c.messages&&n.push([Kn.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Kn.schema,s],[Kn.parentSchema,(0,ue._)`${l}${d}`],[yt.default.data,i]),u&&n.push([Kn.propertyName,u])}});var Nb=k(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.boolOrEmptySchema=Io.topBoolOrEmptySchema=void 0;var nC=cs(),oC=Q(),iC=Rr(),sC={message:"boolean schema is false"};function aC(e){let{gen:t,schema:r,validateName:n}=e;r===!1?jb(e,!1):typeof r=="object"&&r.$async===!0?t.return(iC.default.data):(t.assign((0,oC._)`${n}.errors`,null),t.return(!0))}Io.topBoolOrEmptySchema=aC;function cC(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),jb(e)):r.var(t,!0)}Io.boolOrEmptySchema=cC;function jb(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,nC.reportError)(o,sC,void 0,t)}});var qf=k(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.getRules=Mo.isJSONType=void 0;var uC=["string","number","integer","boolean","null","object","array"],lC=new Set(uC);function dC(e){return typeof e=="string"&&lC.has(e)}Mo.isJSONType=dC;function fC(){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:{}}}Mo.getRules=fC});var Zf=k(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.shouldUseRule=Yr.shouldUseGroup=Yr.schemaHasRulesForType=void 0;function pC({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Ib(e,n)}Yr.schemaHasRulesForType=pC;function Ib(e,t){return t.rules.some(r=>Mb(e,r))}Yr.shouldUseGroup=Ib;function Mb(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))}Yr.shouldUseRule=Mb});var us=k(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.reportTypeError=at.checkDataTypes=at.checkDataType=at.coerceAndCheckDataType=at.getJSONTypes=at.getSchemaTypes=at.DataType=void 0;var mC=qf(),hC=Zf(),gC=cs(),X=Q(),Db=ce(),Do;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Do||(at.DataType=Do={}));function yC(e){let t=Ab(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}at.getSchemaTypes=yC;function Ab(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(mC.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}at.getJSONTypes=Ab;function _C(e,t){let{gen:r,data:n,opts:o}=e,i=vC(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,hC.schemaHasRulesForType)(e,t[0]));if(s){let a=Ff(t,n,o.strictNumbers,Do.Wrong);r.if(a,()=>{i.length?bC(e,t,i):Uf(e)})}return s}at.coerceAndCheckDataType=_C;var qb=new Set(["string","number","integer","boolean","null"]);function vC(e,t){return t?e.filter(r=>qb.has(r)||t==="array"&&r==="array"):[]}function bC(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,X._)`typeof ${o}`),a=n.let("coerced",(0,X._)`undefined`);i.coerceTypes==="array"&&n.if((0,X._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,X._)`${o}[0]`).assign(s,(0,X._)`typeof ${o}`).if(Ff(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,X._)`${a} !== undefined`);for(let u of r)(qb.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Uf(e),n.endIf(),n.if((0,X._)`${a} !== undefined`,()=>{n.assign(o,a),wC(e,a)});function c(u){switch(u){case"string":n.elseIf((0,X._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,X._)`"" + ${o}`).elseIf((0,X._)`${o} === null`).assign(a,(0,X._)`""`);return;case"number":n.elseIf((0,X._)`${s} == "boolean" || ${o} === null
5
5
  || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,X._)`+${o}`);return;case"integer":n.elseIf((0,X._)`${s} === "boolean" || ${o} === null
6
6
  || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,X._)`+${o}`);return;case"boolean":n.elseIf((0,X._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,X._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,X._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,X._)`${s} === "string" || ${s} === "number"
7
- || ${s} === "boolean" || ${o} === null`).assign(a,(0,X._)`[${o}]`)}}}function gC({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,X._)`${t} !== undefined`,()=>e.assign((0,X._)`${t}[${r}]`,n))}function qf(e,t,r,n=Io.Correct){let o=n===Io.Correct?X.operators.EQ:X.operators.NEQ,i;switch(e){case"null":return(0,X._)`${t} ${o} null`;case"array":i=(0,X._)`Array.isArray(${t})`;break;case"object":i=(0,X._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,X._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,X._)`typeof ${t} ${o} ${e}`}return n===Io.Correct?i:(0,X.not)(i);function s(a=X.nil){return(0,X.and)((0,X._)`typeof ${t} == "number"`,a,r?(0,X._)`isFinite(${t})`:X.nil)}}at.checkDataType=qf;function Zf(e,t,r,n){if(e.length===1)return qf(e[0],t,r,n);let o,i=(0,Mb.toHash)(e);if(i.array&&i.object){let s=(0,X._)`typeof ${t} != "object"`;o=i.null?s:(0,X._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=X.nil;i.number&&delete i.integer;for(let s in i)o=(0,X.and)(o,qf(s,t,r,n));return o}at.checkDataTypes=Zf;var yC={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,X._)`{type: ${e}}`:(0,X._)`{type: ${t}}`};function Lf(e){let t=_C(e);(0,dC.reportError)(t,yC)}at.reportTypeError=Lf;function _C(e){let{gen:t,data:r,schema:n}=e,o=(0,Mb.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var Ab=k(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.assignDefaults=void 0;var Do=Q(),vC=ce();function bC(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)Db(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>Db(e,i,o.default))}cc.assignDefaults=bC;function Db(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Do._)`${i}${(0,Do.getProperty)(t)}`;if(o){(0,vC.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Do._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Do._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Do._)`${a} = ${(0,Do.stringify)(r)}`)}});var Ft=k(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;var Pe=Q(),Ff=ce(),Qr=zr(),wC=ce();function xC(e,t){let{gen:r,data:n,it:o}=e;r.if(Vf(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Pe._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=xC;function $C({gen:e,data:t,it:{opts:r}},n,o){return(0,Pe.or)(...n.map(i=>(0,Pe.and)(Vf(e,t,i,r.ownProperties),(0,Pe._)`${o} = ${i}`)))}ye.checkMissingProp=$C;function SC(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=SC;function qb(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Pe._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=qb;function Uf(e,t,r){return(0,Pe._)`${qb(e)}.call(${t}, ${r})`}ye.isOwnProperty=Uf;function kC(e,t,r,n){let o=(0,Pe._)`${t}${(0,Pe.getProperty)(r)} !== undefined`;return n?(0,Pe._)`${o} && ${Uf(e,t,r)}`:o}ye.propertyInData=kC;function Vf(e,t,r,n){let o=(0,Pe._)`${t}${(0,Pe.getProperty)(r)} === undefined`;return n?(0,Pe.or)(o,(0,Pe.not)(Uf(e,t,r))):o}ye.noPropertyInData=Vf;function Zb(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Zb;function PC(e,t){return Zb(t).filter(r=>!(0,Ff.alwaysValidSchema)(e,t[r]))}ye.schemaProperties=PC;function TC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let l=u?(0,Pe._)`${e}, ${t}, ${n}${o}`:t,d=[[Qr.default.instancePath,(0,Pe.strConcat)(Qr.default.instancePath,i)],[Qr.default.parentData,s.parentData],[Qr.default.parentDataProperty,s.parentDataProperty],[Qr.default.rootData,Qr.default.rootData]];s.opts.dynamicRef&&d.push([Qr.default.dynamicAnchors,Qr.default.dynamicAnchors]);let h=(0,Pe._)`${l}, ${r.object(...d)}`;return c!==Pe.nil?(0,Pe._)`${a}.call(${c}, ${h})`:(0,Pe._)`${a}(${h})`}ye.callValidateCode=TC;var zC=(0,Pe._)`new RegExp`;function RC({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,Pe._)`${o.code==="new RegExp"?zC:(0,wC.useFunc)(e,o)}(${r}, ${n})`})}ye.usePattern=RC;function EC(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,Pe._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Ff.Type.Num},i),t.if((0,Pe.not)(i),a)})}}ye.validateArray=EC;function OC(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,Ff.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,Pe._)`${s} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,Pe.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=OC});var Ub=k(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.validateKeywordUsage=dr.validSchemaType=dr.funcKeywordCode=dr.macroKeywordCode=void 0;var _t=Q(),Kn=zr(),CC=Ft(),jC=as();function MC(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=Fb(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}dr.macroKeywordCode=MC;function NC(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;DC(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,l=Fb(n,o,u),d=n.let("valid");e.block$data(d,h),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function h(){if(t.errors===!1)y(),t.modifying&&Lb(e),v(()=>e.error());else{let P=t.async?m():p();t.modifying&&Lb(e),v(()=>IC(e,P))}}function m(){let P=n.let("ruleErrs",null);return n.try(()=>y((0,_t._)`await `),T=>n.assign(d,!1).if((0,_t._)`${T} instanceof ${c.ValidationError}`,()=>n.assign(P,(0,_t._)`${T}.errors`),()=>n.throw(T))),P}function p(){let P=(0,_t._)`${l}.errors`;return n.assign(P,null),y(_t.nil),P}function y(P=t.async?(0,_t._)`await `:_t.nil){let T=c.opts.passContext?Kn.default.this:Kn.default.self,R=!("compile"in t&&!a||t.schema===!1);n.assign(d,(0,_t._)`${P}${(0,CC.callValidateCode)(e,l,T,R)}`,t.modifying)}function v(P){var T;n.if((0,_t.not)((T=t.valid)!==null&&T!==void 0?T:d),P)}}dr.funcKeywordCode=NC;function Lb(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,_t._)`${n.parentData}[${n.parentDataProperty}]`))}function IC(e,t){let{gen:r}=e;r.if((0,_t._)`Array.isArray(${t})`,()=>{r.assign(Kn.default.vErrors,(0,_t._)`${Kn.default.vErrors} === null ? ${t} : ${Kn.default.vErrors}.concat(${t})`).assign(Kn.default.errors,(0,_t._)`${Kn.default.vErrors}.length`),(0,jC.extendErrors)(e)},()=>e.error())}function DC({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Fb(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,_t.stringify)(r)})}function AC(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")}dr.validSchemaType=AC;function qC({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)}}dr.validateKeywordUsage=qC});var Hb=k(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.extendSubschemaMode=en.extendSubschemaData=en.getSubschema=void 0;var fr=Q(),Vb=ce();function ZC(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,fr._)`${e.schemaPath}${(0,fr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,fr._)`${e.schemaPath}${(0,fr.getProperty)(t)}${(0,fr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Vb.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')}en.getSubschema=ZC;function LC(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,h=a.let("data",(0,fr._)`${t.data}${(0,fr.getProperty)(r)}`,!0);c(h),e.errorPath=(0,fr.str)`${u}${(0,Vb.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,fr._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let u=o instanceof fr.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]}}en.extendSubschemaData=LC;function FC(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}en.extendSubschemaMode=FC});var Hf=k((f9,Bb)=>{"use strict";Bb.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 Jb=k((p9,Wb)=>{"use strict";var tn=Wb.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(){};uc(t,n,o,e,"",e)};tn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};tn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};tn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};tn.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 uc(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 tn.arrayKeywords)for(var h=0;h<d.length;h++)uc(e,t,r,d[h],o+"/"+l+"/"+h,i,o,l,n,h)}else if(l in tn.propsKeywords){if(d&&typeof d=="object")for(var m in d)uc(e,t,r,d[m],o+"/"+l+"/"+UC(m),i,o,l,n,m)}else(l in tn.keywords||e.allKeys&&!(l in tn.skipKeywords))&&uc(e,t,r,d,o+"/"+l,i,o,l,n)}r(n,o,i,s,a,c,u)}}function UC(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var us=k(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.getSchemaRefs=kt.resolveUrl=kt.normalizeId=kt._getFullPath=kt.getFullPath=kt.inlineRef=void 0;var VC=ce(),HC=Hf(),BC=Jb(),WC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function JC(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Bf(e):t?Gb(e)<=t:!1}kt.inlineRef=JC;var GC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Bf(e){for(let t in e){if(GC.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Bf)||typeof r=="object"&&Bf(r))return!0}return!1}function Gb(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!WC.has(r)&&(typeof e[r]=="object"&&(0,VC.eachItem)(e[r],n=>t+=Gb(n)),t===1/0))return 1/0}return t}function Kb(e,t="",r){r!==!1&&(t=Ao(t));let n=e.parse(t);return Xb(e,n)}kt.getFullPath=Kb;function Xb(e,t){return e.serialize(t).split("#")[0]+"#"}kt._getFullPath=Xb;var KC=/#\/?$/;function Ao(e){return e?e.replace(KC,""):""}kt.normalizeId=Ao;function XC(e,t,r){return r=Ao(r),e.resolve(t,r)}kt.resolveUrl=XC;var YC=/^[a-z_][-a-z0-9._]*$/i;function QC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Ao(e[r]||t),i={"":o},s=Kb(n,o,!1),a={},c=new Set;return BC(e,{allKeys:!0},(d,h,m,p)=>{if(p===void 0)return;let y=s+h,v=i[p];typeof d[r]=="string"&&(v=P.call(this,d[r])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[h]=v;function P(R){let I=this.opts.uriResolver.resolve;if(R=Ao(v?I(v,R):R),c.has(R))throw l(R);c.add(R);let C=this.refs[R];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?u(d,C.schema,R):R!==Ao(y)&&(R[0]==="#"?(u(d,a[R],R),a[R]=d):this.refs[R]=y),R}function T(R){if(typeof R=="string"){if(!YC.test(R))throw new Error(`invalid anchor "${R}"`);P.call(this,`#${R}`)}}}),a;function u(d,h,m){if(h!==void 0&&!HC(d,h))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}kt.getSchemaRefs=QC});var fs=k(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.getData=rn.KeywordCxt=rn.validateFunctionCode=void 0;var rw=Ob(),Yb=cs(),Jf=Af(),lc=cs(),ej=Ab(),ds=Ub(),Wf=Hb(),F=Q(),J=zr(),tj=us(),Rr=ce(),ls=as();function rj(e){if(iw(e)&&(sw(e),ow(e))){ij(e);return}nw(e,()=>(0,rw.topBoolOrEmptySchema)(e))}rn.validateFunctionCode=rj;function nw({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,F._)`${J.default.data}, ${J.default.valCxt}`,n.$async,()=>{e.code((0,F._)`"use strict"; ${Qb(r,o)}`),oj(e,o),e.code(i)}):e.func(t,(0,F._)`${J.default.data}, ${nj(o)}`,n.$async,()=>e.code(Qb(r,o)).code(i))}function nj(e){return(0,F._)`{${J.default.instancePath}="", ${J.default.parentData}, ${J.default.parentDataProperty}, ${J.default.rootData}=${J.default.data}${e.dynamicRef?(0,F._)`, ${J.default.dynamicAnchors}={}`:F.nil}}={}`}function oj(e,t){e.if(J.default.valCxt,()=>{e.var(J.default.instancePath,(0,F._)`${J.default.valCxt}.${J.default.instancePath}`),e.var(J.default.parentData,(0,F._)`${J.default.valCxt}.${J.default.parentData}`),e.var(J.default.parentDataProperty,(0,F._)`${J.default.valCxt}.${J.default.parentDataProperty}`),e.var(J.default.rootData,(0,F._)`${J.default.valCxt}.${J.default.rootData}`),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,F._)`${J.default.valCxt}.${J.default.dynamicAnchors}`)},()=>{e.var(J.default.instancePath,(0,F._)`""`),e.var(J.default.parentData,(0,F._)`undefined`),e.var(J.default.parentDataProperty,(0,F._)`undefined`),e.var(J.default.rootData,J.default.data),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,F._)`{}`)})}function ij(e){let{schema:t,opts:r,gen:n}=e;nw(e,()=>{r.$comment&&t.$comment&&cw(e),lj(e),n.let(J.default.vErrors,null),n.let(J.default.errors,0),r.unevaluated&&sj(e),aw(e),pj(e)})}function sj(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,F._)`${r}.evaluated`),t.if((0,F._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,F._)`${e.evaluated}.props`,(0,F._)`undefined`)),t.if((0,F._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,F._)`${e.evaluated}.items`,(0,F._)`undefined`))}function Qb(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,F._)`/*# sourceURL=${r} */`:F.nil}function aj(e,t){if(iw(e)&&(sw(e),ow(e))){cj(e,t);return}(0,rw.boolOrEmptySchema)(e,t)}function ow({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 iw(e){return typeof e.schema!="boolean"}function cj(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&cw(e),dj(e),fj(e);let i=n.const("_errs",J.default.errors);aw(e,i),n.var(t,(0,F._)`${i} === ${J.default.errors}`)}function sw(e){(0,Rr.checkUnknownRules)(e),uj(e)}function aw(e,t){if(e.opts.jtd)return ew(e,[],!1,t);let r=(0,Yb.getSchemaTypes)(e.schema),n=(0,Yb.coerceAndCheckDataType)(e,r);ew(e,r,!n,t)}function uj(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Rr.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function lj(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Rr.checkStrictMode)(e,"default is ignored in the schema root")}function dj(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,tj.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function fj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function cw({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,F._)`${J.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,F.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,F._)`${J.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function pj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,F._)`${J.default.errors} === 0`,()=>t.return(J.default.data),()=>t.throw((0,F._)`new ${o}(${J.default.vErrors})`)):(t.assign((0,F._)`${n}.errors`,J.default.vErrors),i.unevaluated&&mj(e),t.return((0,F._)`${J.default.errors} === 0`))}function mj({gen:e,evaluated:t,props:r,items:n}){r instanceof F.Name&&e.assign((0,F._)`${t}.props`,r),n instanceof F.Name&&e.assign((0,F._)`${t}.items`,n)}function ew(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,Rr.schemaHasRulesButRef)(i,l))){o.block(()=>lw(e,"$ref",l.all.$ref.definition));return}c.jtd||hj(e,t),o.block(()=>{for(let h of l.rules)d(h);d(l.post)});function d(h){(0,Jf.shouldUseGroup)(i,h)&&(h.type?(o.if((0,lc.checkDataType)(h.type,s,c.strictNumbers)),tw(e,h),t.length===1&&t[0]===h.type&&r&&(o.else(),(0,lc.reportTypeError)(e)),o.endIf()):tw(e,h),a||o.if((0,F._)`${J.default.errors} === ${n||0}`))}}function tw(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,ej.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Jf.shouldUseRule)(n,i)&&lw(e,i.keyword,i.definition,t.type)})}function hj(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(gj(e,t),e.opts.allowUnionTypes||yj(e,t),_j(e,e.dataTypes))}function gj(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{uw(e.dataTypes,r)||Gf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),bj(e,t)}}function yj(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Gf(e,"use allowUnionTypes to allow union type keyword")}function _j(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Jf.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>vj(t,s))&&Gf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function vj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function uw(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function bj(e,t){let r=[];for(let n of e.dataTypes)uw(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Gf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Rr.checkStrictMode)(e,t,e.opts.strictTypes)}var dc=class{constructor(t,r,n){if((0,ds.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,Rr.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",dw(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ds.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,F.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,F.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,F._)`${r} !== undefined && (${(0,F.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?ls.reportExtraError:ls.reportError)(this,this.def.error,r)}$dataError(){(0,ls.reportError)(this,this.def.$dataError||ls.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ls.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=F.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=F.nil,r=F.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,F.or)((0,F._)`${o} === undefined`,r)),t!==F.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==F.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,F.or)(s(),a());function s(){if(n.length){if(!(r instanceof F.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,F._)`${(0,lc.checkDataTypes)(c,r,i.opts.strictNumbers,lc.DataType.Wrong)}`}return F.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,F._)`!${c}(${r})`}return F.nil}}subschema(t,r){let n=(0,Wf.getSubschema)(this.it,t);(0,Wf.extendSubschemaData)(n,this.it,t),(0,Wf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return aj(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Rr.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Rr.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,F.Name)),!0}};rn.KeywordCxt=dc;function lw(e,t,r,n){let o=new dc(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ds.funcKeywordCode)(o,r):"macro"in r?(0,ds.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ds.funcKeywordCode)(o,r)}var wj=/^\/(?:[^~]|~0|~1)*$/,xj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function dw(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return J.default.rootData;if(e[0]==="/"){if(!wj.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=J.default.rootData}else{let u=xj.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,F._)`${i}${(0,F.getProperty)((0,Rr.unescapeJsonPointer)(u))}`,s=(0,F._)`${s} && ${i}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}rn.getData=dw});var fc=k(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var Kf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Xf.default=Kf});var ps=k(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var Yf=us(),Qf=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Yf.resolveUrl)(t,r,n),this.missingSchema=(0,Yf.normalizeId)((0,Yf.getFullPath)(t,this.missingRef))}};ep.default=Qf});var mc=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.resolveSchema=Ut.getCompilingSchema=Ut.resolveRef=Ut.compileSchema=Ut.SchemaEnv=void 0;var Yt=Q(),$j=fc(),Xn=zr(),Qt=us(),fw=ce(),Sj=fs(),qo=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,Qt.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};Ut.SchemaEnv=qo;function rp(e){let t=pw.call(this,e);if(t)return t;let r=(0,Qt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Yt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:$j.default,code:(0,Yt._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:Xn.default.data,parentData:Xn.default.parentData,parentDataProperty:Xn.default.parentDataProperty,dataNames:[Xn.default.data],dataPathArr:[Yt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Yt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Yt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Yt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,Sj.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let d=s.toString();l=`${s.scopeRefs(Xn.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let m=new Function(`${Xn.default.self}`,`${Xn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:p,items:y}=u;m.evaluated={props:p instanceof Yt.Name?void 0:p,items:y instanceof Yt.Name?void 0:y,dynamicProps:p instanceof Yt.Name,dynamicItems:y instanceof Yt.Name},m.source&&(m.source.evaluated=(0,Yt.stringify)(m.evaluated))}return e.validate=m,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)}}Ut.compileSchema=rp;function kj(e,t,r){var n;r=(0,Qt.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=zj.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 qo({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Pj.call(this,i)}Ut.resolveRef=kj;function Pj(e){return(0,Qt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:rp.call(this,e)}function pw(e){for(let t of this._compilations)if(Tj(t,e))return t}Ut.getCompilingSchema=pw;function Tj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function zj(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||pc.call(this,e,t)}function pc(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Qt._getFullPath)(this.opts.uriResolver,r),o=(0,Qt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return tp.call(this,r,e);let i=(0,Qt.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=pc.call(this,e,s);return typeof a?.schema!="object"?void 0:tp.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||rp.call(this,s),i===(0,Qt.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Qt.resolveUrl)(this.opts.uriResolver,o,u)),new qo({schema:a,schemaId:c,root:e,baseId:o})}return tp.call(this,r,s)}}Ut.resolveSchema=pc;var Rj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function tp(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,fw.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Rj.has(a)&&u&&(t=(0,Qt.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,fw.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Qt.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=pc.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new qo({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var mw=k((v9,Ej)=>{Ej.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 ip=k((b9,bw)=>{"use strict";var Oj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),gw=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),np=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),yw=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Cj=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function op(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 jj=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function hw(e){return e.length=0,!0}function Mj(e,t,r){if(e.length){let n=op(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function Nj(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=Mj;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=hw}else{o.push(u);continue}}return o.length&&(a===hw?r.zone=o.join(""):s?n.push(o.join("")):n.push(op(o))),r.address=n.join(""),r}function _w(e){if(Ij(e,":")<2)return{host:e,isIPV6:!1};let t=Nj(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 Ij(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function Dj(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 Aj={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},qj=/[@/?#:]/g,Zj=/[@/?#]/g;function vw(e,t){let r=t?Zj:qj;return r.lastIndex=0,e.replace(r,n=>Aj[n])}function Lj(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(np(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&yw(s)?r+=s:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function Fj(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(np(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&yw(i)?t+=i:t+="%"+o,r+=2;continue}}Cj(e[r])?t+=e[r]:t+=escape(e[r])}return t}function Uj(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(np(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function Vj(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!gw(r)){let n=_w(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=vw(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}bw.exports={nonSimpleDomain:jj,recomposeAuthority:Vj,reescapeHostDelimiters:vw,normalizePercentEncoding:Lj,normalizePathEncoding:Fj,escapePreservingEscapes:Uj,removeDotSegments:Dj,isIPv4:gw,isUUID:Oj,normalizeIPv6:_w,stringArrayToHexStripped:op}});var kw=k((w9,Sw)=>{"use strict";var{isUUID:Hj}=ip(),Bj=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Wj=["http","https","ws","wss","urn","urn:uuid"];function Jj(e){return Wj.indexOf(e)!==-1}function sp(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 ww(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function xw(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 Gj(e){return e.secure=sp(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Kj(e){if((e.port===(sp(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 Xj(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Bj);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=ap(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Yj(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=ap(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 Qj(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Hj(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function eM(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var $w={scheme:"http",domainHost:!0,parse:ww,serialize:xw},tM={scheme:"https",domainHost:$w.domainHost,parse:ww,serialize:xw},hc={scheme:"ws",domainHost:!0,parse:Gj,serialize:Kj},rM={scheme:"wss",domainHost:hc.domainHost,parse:hc.parse,serialize:hc.serialize},nM={scheme:"urn",parse:Xj,serialize:Yj,skipNormalize:!0},oM={scheme:"urn:uuid",parse:Qj,serialize:eM,skipNormalize:!0},gc={http:$w,https:tM,ws:hc,wss:rM,urn:nM,"urn:uuid":oM};Object.setPrototypeOf(gc,null);function ap(e){return e&&(gc[e]||gc[e.toLowerCase()])||void 0}Sw.exports={wsIsSecure:sp,SCHEMES:gc,isValidSchemeName:Jj,getSchemeHandler:ap}});var Ow=k((x9,yc)=>{"use strict";var{normalizeIPv6:iM,removeDotSegments:ms,recomposeAuthority:sM,normalizePercentEncoding:aM,normalizePathEncoding:cM,escapePreservingEscapes:uM,reescapeHostDelimiters:lM,isIPv4:dM,nonSimpleDomain:fM}=ip(),{SCHEMES:pM,getSchemeHandler:Tw}=kw();function mM(e,t){return typeof e=="string"?e=vM(e,t):typeof e=="object"&&(e=Zo(Yn(e,t),t)),e}function hM(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=zw(Zo(e,n),Zo(t,n),n,!0);return n.skipEscape=!0,Yn(o,n)}function zw(e,t,r,n){let o={};return n||(e=Zo(Yn(e,r),r),t=Zo(Yn(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=ms(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=ms(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=ms(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=ms(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 gM(e,t,r){let n=Pw(e,r),o=Pw(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Yn(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=Tw(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=aM(r.path):(r.path=uM(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=sM(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=ms(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 yM=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _M(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 Rw(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(yM);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=_M(n,s);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(dM(n.host)===!1){let l=iM(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=Tw(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&fM(n.host))try{n.host=new URL("http://"+n.host).hostname}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=lM(unescape(n.host),i))),n.path&&(n.path=cM(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 Zo(e,t){return Rw(e,t).parsed}function vM(e,t){return Ew(e,t).normalized}function Ew(e,t){let{parsed:r,malformedAuthorityOrPort:n}=Rw(e,t);return{normalized:n?e:Yn(r,t),malformedAuthorityOrPort:n}}function Pw(e,t){if(typeof e=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Ew(e,t);return n?void 0:r}if(typeof e=="object")return Yn(e,t)}var cp={SCHEMES:pM,normalize:mM,resolve:hM,resolveComponent:zw,equal:gM,serialize:Yn,parse:Zo};yc.exports=cp;yc.exports.default=cp;yc.exports.fastUri=cp});var jw=k(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var Cw=Ow();Cw.code='require("ajv/dist/runtime/uri").default';up.default=Cw});var Lw=k(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.CodeGen=tt.Name=tt.nil=tt.stringify=tt.str=tt._=tt.KeywordCxt=void 0;var bM=fs();Object.defineProperty(tt,"KeywordCxt",{enumerable:!0,get:function(){return bM.KeywordCxt}});var Lo=Q();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Lo._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Lo.str}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Lo.stringify}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Lo.nil}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Lo.Name}});Object.defineProperty(tt,"CodeGen",{enumerable:!0,get:function(){return Lo.CodeGen}});var wM=fc(),Aw=ps(),xM=Df(),hs=mc(),$M=Q(),gs=us(),_c=cs(),dp=ce(),Mw=mw(),SM=jw(),qw=(e,t)=>new RegExp(e,t);qw.code="new RegExp";var kM=["removeAdditional","useDefaults","coerceTypes"],PM=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),TM={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."},zM={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Nw=200;function RM(e){var t,r,n,o,i,s,a,c,u,l,d,h,m,p,y,v,P,T,R,I,C,Me,de,mt,vn;let Ar=e.strict,lo=(t=e.code)===null||t===void 0?void 0:t.optimize,bi=lo===!0||lo===void 0?1:lo||0,wi=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:qw,ir=(o=e.uriResolver)!==null&&o!==void 0?o:SM.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Ar)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Ar)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ar)!==null&&l!==void 0?l:"log",strictTuples:(h=(d=e.strictTuples)!==null&&d!==void 0?d:Ar)!==null&&h!==void 0?h:"log",strictRequired:(p=(m=e.strictRequired)!==null&&m!==void 0?m:Ar)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:bi,regExp:wi}:{optimize:bi,regExp:wi},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:Nw,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:Nw,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:(T=e.messages)!==null&&T!==void 0?T:!0,inlineRefs:(R=e.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(I=e.schemaId)!==null&&I!==void 0?I:"$id",addUsedSchema:(C=e.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(Me=e.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(de=e.validateFormats)!==null&&de!==void 0?de:!0,unicodeRegExp:(mt=e.unicodeRegExp)!==null&&mt!==void 0?mt:!0,int32range:(vn=e.int32range)!==null&&vn!==void 0?vn:!0,uriResolver:ir}}var ys=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,...RM(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new $M.ValueScope({scope:{},prefixes:PM,es5:r,lines:n}),this.logger=NM(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,xM.getRules)(),Iw.call(this,TM,t,"NOT SUPPORTED"),Iw.call(this,zM,t,"DEPRECATED","warn"),this._metaOpts=jM.call(this),t.formats&&OM.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&CM.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),EM.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=Mw;n==="id"&&(o={...Mw},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 h=this._addSchema(l,d);return h.validate||s.call(this,h)}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 Aw.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,gs.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=Dw.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new hs.SchemaEnv({schema:{},schemaId:n});if(r=hs.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=Dw.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,gs.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(DM.call(this,n,r),!r)return(0,dp.eachItem)(n,i=>lp.call(this,i)),this;qM.call(this,r);let o={...r,type:(0,_c.getJSONTypes)(r.type),schemaType:(0,_c.getJSONTypes)(r.schemaType)};return(0,dp.eachItem)(n,o.type.length===0?i=>lp.call(this,i,o):i=>o.type.forEach(s=>lp.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]=Zw(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,gs.normalizeId)(s||n);let u=gs.getSchemaRefs.call(this,t,n);return c=new hs.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):hs.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{hs.compileSchema.call(this,t)}finally{this.opts=r}}};ys.ValidationError=wM.default;ys.MissingRefError=Aw.default;tt.default=ys;function Iw(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 Dw(e){return e=(0,gs.normalizeId)(e),this.schemas[e]||this.refs[e]}function EM(){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 OM(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function CM(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 jM(){let e={...this.opts};for(let t of kM)delete e[t];return e}var MM={log(){},warn(){},error(){}};function NM(e){if(e===!1)return MM;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 IM=/^[a-z_$][a-z0-9_$:-]*$/i;function DM(e,t){let{RULES:r}=this;if((0,dp.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!IM.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 lp(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,_c.getJSONTypes)(t.type),schemaType:(0,_c.getJSONTypes)(t.schemaType)}};t.before?AM.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 AM(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 qM(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Zw(t)),e.validateSchema=this.compile(t,!0))}var ZM={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Zw(e){return{anyOf:[e,ZM]}}});var Fw=k(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var LM={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fp.default=LM});var Bw=k(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.callRef=Qn.getValidate=void 0;var FM=ps(),Uw=Ft(),Pt=Q(),Fo=zr(),Vw=mc(),vc=ce(),UM={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=Vw.resolveRef.call(c,u,o,r);if(l===void 0)throw new FM.default(n.opts.uriResolver,o,r);if(l instanceof Vw.SchemaEnv)return h(l);return m(l);function d(){if(i===u)return bc(e,s,i,i.$async);let p=t.scopeValue("root",{ref:u});return bc(e,(0,Pt._)`${p}.validate`,u,u.$async)}function h(p){let y=Hw(e,p);bc(e,y,p,p.$async)}function m(p){let y=t.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,Pt.stringify)(p)}:{ref:p}),v=t.name("valid"),P=e.subschema({schema:p,dataTypes:[],schemaPath:Pt.nil,topSchemaRef:y,errSchemaPath:r},v);e.mergeEvaluated(P),e.ok(v)}}};function Hw(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Pt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Qn.getValidate=Hw;function bc(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Fo.default.this:Pt.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let p=o.let("valid");o.try(()=>{o.code((0,Pt._)`await ${(0,Uw.callValidateCode)(e,t,u)}`),m(t),s||o.assign(p,!0)},y=>{o.if((0,Pt._)`!(${y} instanceof ${i.ValidationError})`,()=>o.throw(y)),h(y),s||o.assign(p,!1)}),e.ok(p)}function d(){e.result((0,Uw.callValidateCode)(e,t,u),()=>m(t),()=>h(t))}function h(p){let y=(0,Pt._)`${p}.errors`;o.assign(Fo.default.vErrors,(0,Pt._)`${Fo.default.vErrors} === null ? ${y} : ${Fo.default.vErrors}.concat(${y})`),o.assign(Fo.default.errors,(0,Pt._)`${Fo.default.vErrors}.length`)}function m(p){var y;if(!i.opts.unevaluated)return;let v=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=vc.mergeEvaluated.props(o,v.props,i.props));else{let P=o.var("props",(0,Pt._)`${p}.evaluated.props`);i.props=vc.mergeEvaluated.props(o,P,i.props,Pt.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=vc.mergeEvaluated.items(o,v.items,i.items));else{let P=o.var("items",(0,Pt._)`${p}.evaluated.items`);i.items=vc.mergeEvaluated.items(o,P,i.items,Pt.Name)}}}Qn.callRef=bc;Qn.default=UM});var Ww=k(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var VM=Fw(),HM=Bw(),BM=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",VM.default,HM.default];pp.default=BM});var Jw=k(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var wc=Q(),nn=wc.operators,xc={maximum:{okStr:"<=",ok:nn.LTE,fail:nn.GT},minimum:{okStr:">=",ok:nn.GTE,fail:nn.LT},exclusiveMaximum:{okStr:"<",ok:nn.LT,fail:nn.GTE},exclusiveMinimum:{okStr:">",ok:nn.GT,fail:nn.LTE}},WM={message:({keyword:e,schemaCode:t})=>(0,wc.str)`must be ${xc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,wc._)`{comparison: ${xc[e].okStr}, limit: ${t}}`},JM={keyword:Object.keys(xc),type:"number",schemaType:"number",$data:!0,error:WM,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,wc._)`${r} ${xc[t].fail} ${n} || isNaN(${r})`)}};mp.default=JM});var Gw=k(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});var _s=Q(),GM={message:({schemaCode:e})=>(0,_s.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,_s._)`{multipleOf: ${e}}`},KM={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:GM,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,_s._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,_s._)`${s} !== parseInt(${s})`;e.fail$data((0,_s._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};hp.default=KM});var Xw=k(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});function Kw(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}gp.default=Kw;Kw.code='require("ajv/dist/runtime/ucs2length").default'});var Yw=k(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var eo=Q(),XM=ce(),YM=Xw(),QM={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,eo.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,eo._)`{limit: ${e}}`},eN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:QM,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?eo.operators.GT:eo.operators.LT,s=o.opts.unicode===!1?(0,eo._)`${r}.length`:(0,eo._)`${(0,XM.useFunc)(e.gen,YM.default)}(${r})`;e.fail$data((0,eo._)`${s} ${i} ${n}`)}};yp.default=eN});var Qw=k(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var tN=Ft(),rN=ce(),Uo=Q(),nN={message:({schemaCode:e})=>(0,Uo.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Uo._)`{pattern: ${e}}`},oN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:nN,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,Uo._)`new RegExp`:(0,rN.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,Uo._)`${u}(${i}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,Uo._)`!${l}`)}else{let c=(0,tN.usePattern)(e,o);e.fail$data((0,Uo._)`!${c}.test(${r})`)}}};_p.default=oN});var ex=k(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});var vs=Q(),iN={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,vs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,vs._)`{limit: ${e}}`},sN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:iN,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?vs.operators.GT:vs.operators.LT;e.fail$data((0,vs._)`Object.keys(${r}).length ${o} ${n}`)}};vp.default=sN});var tx=k(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});var bs=Ft(),ws=Q(),aN=ce(),cN={message:({params:{missingProperty:e}})=>(0,ws.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ws._)`{missingProperty: ${e}}`},uN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cN,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 m=e.parentSchema.properties,{definedProperties:p}=e.it;for(let y of r)if(m?.[y]===void 0&&!p.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,P=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,aN.checkStrictMode)(s,P,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(ws.nil,d);else for(let m of r)(0,bs.checkReportMissingProp)(e,m)}function l(){let m=t.let("missing");if(c||i){let p=t.let("valid",!0);e.block$data(p,()=>h(m,p)),e.ok(p)}else t.if((0,bs.checkMissingProp)(e,r,m)),(0,bs.reportMissingProp)(e,m),t.else()}function d(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,bs.noPropertyInData)(t,o,m,a.ownProperties),()=>e.error())})}function h(m,p){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(p,(0,bs.propertyInData)(t,o,m,a.ownProperties)),t.if((0,ws.not)(p),()=>{e.error(),t.break()})},ws.nil)}}};bp.default=uN});var rx=k(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var xs=Q(),lN={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,xs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,xs._)`{limit: ${e}}`},dN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:lN,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?xs.operators.GT:xs.operators.LT;e.fail$data((0,xs._)`${r}.length ${o} ${n}`)}};wp.default=dN});var $c=k(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});var nx=Hf();nx.code='require("ajv/dist/runtime/equal").default';xp.default=nx});var ox=k(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var $p=cs(),rt=Q(),fN=ce(),pN=$c(),mN={message:({params:{i:e,j:t}})=>(0,rt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,rt._)`{i: ${e}, j: ${t}}`},hN={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:mN,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,$p.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,rt._)`${s} === false`),e.ok(c);function l(){let p=t.let("i",(0,rt._)`${r}.length`),y=t.let("j");e.setParams({i:p,j:y}),t.assign(c,!0),t.if((0,rt._)`${p} > 1`,()=>(d()?h:m)(p,y))}function d(){return u.length>0&&!u.some(p=>p==="object"||p==="array")}function h(p,y){let v=t.name("item"),P=(0,$p.checkDataTypes)(u,v,a.opts.strictNumbers,$p.DataType.Wrong),T=t.const("indices",(0,rt._)`{}`);t.for((0,rt._)`;${p}--;`,()=>{t.let(v,(0,rt._)`${r}[${p}]`),t.if(P,(0,rt._)`continue`),u.length>1&&t.if((0,rt._)`typeof ${v} == "string"`,(0,rt._)`${v} += "_"`),t.if((0,rt._)`typeof ${T}[${v}] == "number"`,()=>{t.assign(y,(0,rt._)`${T}[${v}]`),e.error(),t.assign(c,!1).break()}).code((0,rt._)`${T}[${v}] = ${p}`)})}function m(p,y){let v=(0,fN.useFunc)(t,pN.default),P=t.name("outer");t.label(P).for((0,rt._)`;${p}--;`,()=>t.for((0,rt._)`${y} = ${p}; ${y}--;`,()=>t.if((0,rt._)`${v}(${r}[${p}], ${r}[${y}])`,()=>{e.error(),t.assign(c,!1).break(P)})))}}};Sp.default=hN});var ix=k(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});var kp=Q(),gN=ce(),yN=$c(),_N={message:"must be equal to constant",params:({schemaCode:e})=>(0,kp._)`{allowedValue: ${e}}`},vN={keyword:"const",$data:!0,error:_N,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,kp._)`!${(0,gN.useFunc)(t,yN.default)}(${r}, ${o})`):e.fail((0,kp._)`${i} !== ${r}`)}};Pp.default=vN});var sx=k(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});var $s=Q(),bN=ce(),wN=$c(),xN={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,$s._)`{allowedValues: ${e}}`},$N={keyword:"enum",schemaType:"array",$data:!0,error:xN,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,bN.useFunc)(t,wN.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 m=t.const("vSchema",i);l=(0,$s.or)(...o.map((p,y)=>h(m,y)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",i,m=>t.if((0,$s._)`${u()}(${r}, ${m})`,()=>t.assign(l,!0).break()))}function h(m,p){let y=o[p];return typeof y=="object"&&y!==null?(0,$s._)`${u()}(${r}, ${m}[${p}])`:(0,$s._)`${r} === ${y}`}}};Tp.default=$N});var ax=k(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var SN=Jw(),kN=Gw(),PN=Yw(),TN=Qw(),zN=ex(),RN=tx(),EN=rx(),ON=ox(),CN=ix(),jN=sx(),MN=[SN.default,kN.default,PN.default,TN.default,zN.default,RN.default,EN.default,ON.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},CN.default,jN.default];zp.default=MN});var Ep=k(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.validateAdditionalItems=void 0;var to=Q(),Rp=ce(),NN={message:({params:{len:e}})=>(0,to.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,to._)`{limit: ${e}}`},IN={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:NN,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Rp.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}cx(e,n)}};function cx(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,to._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,to._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Rp.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,to._)`${a} <= ${t.length}`);r.if((0,to.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:Rp.Type.Num},u),s.allErrors||r.if((0,to.not)(u),()=>r.break())})}}Ss.validateAdditionalItems=cx;Ss.default=IN});var Op=k(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.validateTuple=void 0;var ux=Q(),Sc=ce(),DN=Ft(),AN={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return lx(e,"additionalItems",t);r.items=!0,!(0,Sc.alwaysValidSchema)(r,t)&&e.ok((0,DN.validateArray)(e))}};function lx(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=Sc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,ux._)`${i}.length`);r.forEach((d,h)=>{(0,Sc.alwaysValidSchema)(a,d)||(n.if((0,ux._)`${u} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},c)),e.ok(c))});function l(d){let{opts:h,errSchemaPath:m}=a,p=r.length,y=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(h.strictTuples&&!y){let v=`"${s}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,Sc.checkStrictMode)(a,v,h.strictTuples)}}}ks.validateTuple=lx;ks.default=AN});var dx=k(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});var qN=Op(),ZN={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,qN.validateTuple)(e,"items")};Cp.default=ZN});var px=k(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});var fx=Q(),LN=ce(),FN=Ft(),UN=Ep(),VN={message:({params:{len:e}})=>(0,fx.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,fx._)`{limit: ${e}}`},HN={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:VN,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,LN.alwaysValidSchema)(n,t)&&(o?(0,UN.validateAdditionalItems)(e,o):e.ok((0,FN.validateArray)(e)))}};jp.default=HN});var mx=k(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});var Vt=Q(),kc=ce(),BN={message:({params:{min:e,max:t}})=>t===void 0?(0,Vt.str)`must contain at least ${e} valid item(s)`:(0,Vt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Vt._)`{minContains: ${e}}`:(0,Vt._)`{minContains: ${e}, maxContains: ${t}}`},WN={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:BN,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,Vt._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,kc.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,kc.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,kc.alwaysValidSchema)(i,r)){let y=(0,Vt._)`${l} >= ${s}`;a!==void 0&&(y=(0,Vt._)`${y} && ${l} <= ${a}`),e.pass(y);return}i.items=!0;let d=t.name("valid");a===void 0&&s===1?m(d,()=>t.if(d,()=>t.break())):s===0?(t.let(d,!0),a!==void 0&&t.if((0,Vt._)`${o}.length > 0`,h)):(t.let(d,!1),h()),e.result(d,()=>e.reset());function h(){let y=t.name("_valid"),v=t.let("count",0);m(y,()=>t.if(y,()=>p(v)))}function m(y,v){t.forRange("i",0,l,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:kc.Type.Num,compositeRule:!0},y),v()})}function p(y){t.code((0,Vt._)`${y}++`),a===void 0?t.if((0,Vt._)`${y} >= ${s}`,()=>t.assign(d,!0).break()):(t.if((0,Vt._)`${y} > ${a}`,()=>t.assign(d,!1).break()),s===1?t.assign(d,!0):t.if((0,Vt._)`${y} >= ${s}`,()=>t.assign(d,!0)))}}};Mp.default=WN});var yx=k(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.validateSchemaDeps=pr.validatePropertyDeps=pr.error=void 0;var Np=Q(),JN=ce(),Ps=Ft();pr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Np.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Np._)`{property: ${e},
7
+ || ${s} === "boolean" || ${o} === null`).assign(a,(0,X._)`[${o}]`)}}}function wC({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,X._)`${t} !== undefined`,()=>e.assign((0,X._)`${t}[${r}]`,n))}function Lf(e,t,r,n=Do.Correct){let o=n===Do.Correct?X.operators.EQ:X.operators.NEQ,i;switch(e){case"null":return(0,X._)`${t} ${o} null`;case"array":i=(0,X._)`Array.isArray(${t})`;break;case"object":i=(0,X._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,X._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,X._)`typeof ${t} ${o} ${e}`}return n===Do.Correct?i:(0,X.not)(i);function s(a=X.nil){return(0,X.and)((0,X._)`typeof ${t} == "number"`,a,r?(0,X._)`isFinite(${t})`:X.nil)}}at.checkDataType=Lf;function Ff(e,t,r,n){if(e.length===1)return Lf(e[0],t,r,n);let o,i=(0,Db.toHash)(e);if(i.array&&i.object){let s=(0,X._)`typeof ${t} != "object"`;o=i.null?s:(0,X._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=X.nil;i.number&&delete i.integer;for(let s in i)o=(0,X.and)(o,Lf(s,t,r,n));return o}at.checkDataTypes=Ff;var xC={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,X._)`{type: ${e}}`:(0,X._)`{type: ${t}}`};function Uf(e){let t=$C(e);(0,gC.reportError)(t,xC)}at.reportTypeError=Uf;function $C(e){let{gen:t,data:r,schema:n}=e,o=(0,Db.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var Lb=k(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.assignDefaults=void 0;var Ao=Q(),SC=ce();function kC(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)Zb(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>Zb(e,i,o.default))}uc.assignDefaults=kC;function Zb(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ao._)`${i}${(0,Ao.getProperty)(t)}`;if(o){(0,SC.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,Ao._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ao._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ao._)`${a} = ${(0,Ao.stringify)(r)}`)}});var Ft=k(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;var Pe=Q(),Vf=ce(),Qr=Rr(),PC=ce();function TC(e,t){let{gen:r,data:n,it:o}=e;r.if(Bf(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Pe._)`${t}`},!0),e.error()})}ye.checkReportMissingProp=TC;function RC({gen:e,data:t,it:{opts:r}},n,o){return(0,Pe.or)(...n.map(i=>(0,Pe.and)(Bf(e,t,i,r.ownProperties),(0,Pe._)`${o} = ${i}`)))}ye.checkMissingProp=RC;function zC(e,t){e.setParams({missingProperty:t},!0),e.error()}ye.reportMissingProp=zC;function Fb(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Pe._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=Fb;function Hf(e,t,r){return(0,Pe._)`${Fb(e)}.call(${t}, ${r})`}ye.isOwnProperty=Hf;function EC(e,t,r,n){let o=(0,Pe._)`${t}${(0,Pe.getProperty)(r)} !== undefined`;return n?(0,Pe._)`${o} && ${Hf(e,t,r)}`:o}ye.propertyInData=EC;function Bf(e,t,r,n){let o=(0,Pe._)`${t}${(0,Pe.getProperty)(r)} === undefined`;return n?(0,Pe.or)(o,(0,Pe.not)(Hf(e,t,r))):o}ye.noPropertyInData=Bf;function Ub(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ye.allSchemaProperties=Ub;function OC(e,t){return Ub(t).filter(r=>!(0,Vf.alwaysValidSchema)(e,t[r]))}ye.schemaProperties=OC;function CC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let l=u?(0,Pe._)`${e}, ${t}, ${n}${o}`:t,d=[[Qr.default.instancePath,(0,Pe.strConcat)(Qr.default.instancePath,i)],[Qr.default.parentData,s.parentData],[Qr.default.parentDataProperty,s.parentDataProperty],[Qr.default.rootData,Qr.default.rootData]];s.opts.dynamicRef&&d.push([Qr.default.dynamicAnchors,Qr.default.dynamicAnchors]);let h=(0,Pe._)`${l}, ${r.object(...d)}`;return c!==Pe.nil?(0,Pe._)`${a}.call(${c}, ${h})`:(0,Pe._)`${a}(${h})`}ye.callValidateCode=CC;var jC=(0,Pe._)`new RegExp`;function NC({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,Pe._)`${o.code==="new RegExp"?jC:(0,PC.useFunc)(e,o)}(${r}, ${n})`})}ye.usePattern=NC;function IC(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,Pe._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Vf.Type.Num},i),t.if((0,Pe.not)(i),a)})}}ye.validateArray=IC;function MC(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,Vf.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,Pe._)`${s} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,Pe.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}ye.validateUnion=MC});var Bb=k(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.validateKeywordUsage=dr.validSchemaType=dr.funcKeywordCode=dr.macroKeywordCode=void 0;var _t=Q(),Xn=Rr(),DC=Ft(),AC=cs();function qC(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=Hb(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}dr.macroKeywordCode=qC;function ZC(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;FC(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,l=Hb(n,o,u),d=n.let("valid");e.block$data(d,h),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function h(){if(t.errors===!1)y(),t.modifying&&Vb(e),v(()=>e.error());else{let P=t.async?m():p();t.modifying&&Vb(e),v(()=>LC(e,P))}}function m(){let P=n.let("ruleErrs",null);return n.try(()=>y((0,_t._)`await `),T=>n.assign(d,!1).if((0,_t._)`${T} instanceof ${c.ValidationError}`,()=>n.assign(P,(0,_t._)`${T}.errors`),()=>n.throw(T))),P}function p(){let P=(0,_t._)`${l}.errors`;return n.assign(P,null),y(_t.nil),P}function y(P=t.async?(0,_t._)`await `:_t.nil){let T=c.opts.passContext?Xn.default.this:Xn.default.self,z=!("compile"in t&&!a||t.schema===!1);n.assign(d,(0,_t._)`${P}${(0,DC.callValidateCode)(e,l,T,z)}`,t.modifying)}function v(P){var T;n.if((0,_t.not)((T=t.valid)!==null&&T!==void 0?T:d),P)}}dr.funcKeywordCode=ZC;function Vb(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,_t._)`${n.parentData}[${n.parentDataProperty}]`))}function LC(e,t){let{gen:r}=e;r.if((0,_t._)`Array.isArray(${t})`,()=>{r.assign(Xn.default.vErrors,(0,_t._)`${Xn.default.vErrors} === null ? ${t} : ${Xn.default.vErrors}.concat(${t})`).assign(Xn.default.errors,(0,_t._)`${Xn.default.vErrors}.length`),(0,AC.extendErrors)(e)},()=>e.error())}function FC({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Hb(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,_t.stringify)(r)})}function UC(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")}dr.validSchemaType=UC;function VC({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)}}dr.validateKeywordUsage=VC});var Jb=k(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.extendSubschemaMode=en.extendSubschemaData=en.getSubschema=void 0;var fr=Q(),Wb=ce();function HC(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,fr._)`${e.schemaPath}${(0,fr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,fr._)`${e.schemaPath}${(0,fr.getProperty)(t)}${(0,fr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Wb.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')}en.getSubschema=HC;function BC(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,h=a.let("data",(0,fr._)`${t.data}${(0,fr.getProperty)(r)}`,!0);c(h),e.errorPath=(0,fr.str)`${u}${(0,Wb.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,fr._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let u=o instanceof fr.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]}}en.extendSubschemaData=BC;function WC(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}en.extendSubschemaMode=WC});var Wf=k(($9,Gb)=>{"use strict";Gb.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 Xb=k((S9,Kb)=>{"use strict";var tn=Kb.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(){};lc(t,n,o,e,"",e)};tn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};tn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};tn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};tn.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 lc(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 tn.arrayKeywords)for(var h=0;h<d.length;h++)lc(e,t,r,d[h],o+"/"+l+"/"+h,i,o,l,n,h)}else if(l in tn.propsKeywords){if(d&&typeof d=="object")for(var m in d)lc(e,t,r,d[m],o+"/"+l+"/"+JC(m),i,o,l,n,m)}else(l in tn.keywords||e.allKeys&&!(l in tn.skipKeywords))&&lc(e,t,r,d,o+"/"+l,i,o,l,n)}r(n,o,i,s,a,c,u)}}function JC(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var ls=k(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.getSchemaRefs=kt.resolveUrl=kt.normalizeId=kt._getFullPath=kt.getFullPath=kt.inlineRef=void 0;var GC=ce(),KC=Wf(),XC=Xb(),YC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QC(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Jf(e):t?Yb(e)<=t:!1}kt.inlineRef=QC;var ej=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Jf(e){for(let t in e){if(ej.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Jf)||typeof r=="object"&&Jf(r))return!0}return!1}function Yb(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!YC.has(r)&&(typeof e[r]=="object"&&(0,GC.eachItem)(e[r],n=>t+=Yb(n)),t===1/0))return 1/0}return t}function Qb(e,t="",r){r!==!1&&(t=qo(t));let n=e.parse(t);return ew(e,n)}kt.getFullPath=Qb;function ew(e,t){return e.serialize(t).split("#")[0]+"#"}kt._getFullPath=ew;var tj=/#\/?$/;function qo(e){return e?e.replace(tj,""):""}kt.normalizeId=qo;function rj(e,t,r){return r=qo(r),e.resolve(t,r)}kt.resolveUrl=rj;var nj=/^[a-z_][-a-z0-9._]*$/i;function oj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=qo(e[r]||t),i={"":o},s=Qb(n,o,!1),a={},c=new Set;return XC(e,{allKeys:!0},(d,h,m,p)=>{if(p===void 0)return;let y=s+h,v=i[p];typeof d[r]=="string"&&(v=P.call(this,d[r])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[h]=v;function P(z){let M=this.opts.uriResolver.resolve;if(z=qo(v?M(v,z):z),c.has(z))throw l(z);c.add(z);let C=this.refs[z];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?u(d,C.schema,z):z!==qo(y)&&(z[0]==="#"?(u(d,a[z],z),a[z]=d):this.refs[z]=y),z}function T(z){if(typeof z=="string"){if(!nj.test(z))throw new Error(`invalid anchor "${z}"`);P.call(this,`#${z}`)}}}),a;function u(d,h,m){if(h!==void 0&&!KC(d,h))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}kt.getSchemaRefs=oj});var ps=k(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.getData=rn.KeywordCxt=rn.validateFunctionCode=void 0;var iw=Nb(),tw=us(),Kf=Zf(),dc=us(),ij=Lb(),fs=Bb(),Gf=Jb(),F=Q(),J=Rr(),sj=ls(),zr=ce(),ds=cs();function aj(e){if(cw(e)&&(uw(e),aw(e))){lj(e);return}sw(e,()=>(0,iw.topBoolOrEmptySchema)(e))}rn.validateFunctionCode=aj;function sw({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,F._)`${J.default.data}, ${J.default.valCxt}`,n.$async,()=>{e.code((0,F._)`"use strict"; ${rw(r,o)}`),uj(e,o),e.code(i)}):e.func(t,(0,F._)`${J.default.data}, ${cj(o)}`,n.$async,()=>e.code(rw(r,o)).code(i))}function cj(e){return(0,F._)`{${J.default.instancePath}="", ${J.default.parentData}, ${J.default.parentDataProperty}, ${J.default.rootData}=${J.default.data}${e.dynamicRef?(0,F._)`, ${J.default.dynamicAnchors}={}`:F.nil}}={}`}function uj(e,t){e.if(J.default.valCxt,()=>{e.var(J.default.instancePath,(0,F._)`${J.default.valCxt}.${J.default.instancePath}`),e.var(J.default.parentData,(0,F._)`${J.default.valCxt}.${J.default.parentData}`),e.var(J.default.parentDataProperty,(0,F._)`${J.default.valCxt}.${J.default.parentDataProperty}`),e.var(J.default.rootData,(0,F._)`${J.default.valCxt}.${J.default.rootData}`),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,F._)`${J.default.valCxt}.${J.default.dynamicAnchors}`)},()=>{e.var(J.default.instancePath,(0,F._)`""`),e.var(J.default.parentData,(0,F._)`undefined`),e.var(J.default.parentDataProperty,(0,F._)`undefined`),e.var(J.default.rootData,J.default.data),t.dynamicRef&&e.var(J.default.dynamicAnchors,(0,F._)`{}`)})}function lj(e){let{schema:t,opts:r,gen:n}=e;sw(e,()=>{r.$comment&&t.$comment&&dw(e),hj(e),n.let(J.default.vErrors,null),n.let(J.default.errors,0),r.unevaluated&&dj(e),lw(e),_j(e)})}function dj(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,F._)`${r}.evaluated`),t.if((0,F._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,F._)`${e.evaluated}.props`,(0,F._)`undefined`)),t.if((0,F._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,F._)`${e.evaluated}.items`,(0,F._)`undefined`))}function rw(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,F._)`/*# sourceURL=${r} */`:F.nil}function fj(e,t){if(cw(e)&&(uw(e),aw(e))){pj(e,t);return}(0,iw.boolOrEmptySchema)(e,t)}function aw({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 cw(e){return typeof e.schema!="boolean"}function pj(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&dw(e),gj(e),yj(e);let i=n.const("_errs",J.default.errors);lw(e,i),n.var(t,(0,F._)`${i} === ${J.default.errors}`)}function uw(e){(0,zr.checkUnknownRules)(e),mj(e)}function lw(e,t){if(e.opts.jtd)return nw(e,[],!1,t);let r=(0,tw.getSchemaTypes)(e.schema),n=(0,tw.coerceAndCheckDataType)(e,r);nw(e,r,!n,t)}function mj(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,zr.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function hj(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,zr.checkStrictMode)(e,"default is ignored in the schema root")}function gj(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,sj.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function yj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function dw({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,F._)`${J.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,F.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,F._)`${J.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function _j(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,F._)`${J.default.errors} === 0`,()=>t.return(J.default.data),()=>t.throw((0,F._)`new ${o}(${J.default.vErrors})`)):(t.assign((0,F._)`${n}.errors`,J.default.vErrors),i.unevaluated&&vj(e),t.return((0,F._)`${J.default.errors} === 0`))}function vj({gen:e,evaluated:t,props:r,items:n}){r instanceof F.Name&&e.assign((0,F._)`${t}.props`,r),n instanceof F.Name&&e.assign((0,F._)`${t}.items`,n)}function nw(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,zr.schemaHasRulesButRef)(i,l))){o.block(()=>pw(e,"$ref",l.all.$ref.definition));return}c.jtd||bj(e,t),o.block(()=>{for(let h of l.rules)d(h);d(l.post)});function d(h){(0,Kf.shouldUseGroup)(i,h)&&(h.type?(o.if((0,dc.checkDataType)(h.type,s,c.strictNumbers)),ow(e,h),t.length===1&&t[0]===h.type&&r&&(o.else(),(0,dc.reportTypeError)(e)),o.endIf()):ow(e,h),a||o.if((0,F._)`${J.default.errors} === ${n||0}`))}}function ow(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,ij.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,Kf.shouldUseRule)(n,i)&&pw(e,i.keyword,i.definition,t.type)})}function bj(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(wj(e,t),e.opts.allowUnionTypes||xj(e,t),$j(e,e.dataTypes))}function wj(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{fw(e.dataTypes,r)||Xf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),kj(e,t)}}function xj(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Xf(e,"use allowUnionTypes to allow union type keyword")}function $j(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Kf.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>Sj(t,s))&&Xf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Sj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function fw(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function kj(e,t){let r=[];for(let n of e.dataTypes)fw(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Xf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,zr.checkStrictMode)(e,t,e.opts.strictTypes)}var fc=class{constructor(t,r,n){if((0,fs.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,zr.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",mw(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,fs.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,F.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,F.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,F._)`${r} !== undefined && (${(0,F.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?ds.reportExtraError:ds.reportError)(this,this.def.error,r)}$dataError(){(0,ds.reportError)(this,this.def.$dataError||ds.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ds.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=F.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=F.nil,r=F.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,F.or)((0,F._)`${o} === undefined`,r)),t!==F.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==F.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,F.or)(s(),a());function s(){if(n.length){if(!(r instanceof F.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,F._)`${(0,dc.checkDataTypes)(c,r,i.opts.strictNumbers,dc.DataType.Wrong)}`}return F.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,F._)`!${c}(${r})`}return F.nil}}subschema(t,r){let n=(0,Gf.getSubschema)(this.it,t);(0,Gf.extendSubschemaData)(n,this.it,t),(0,Gf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return fj(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=zr.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=zr.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,F.Name)),!0}};rn.KeywordCxt=fc;function pw(e,t,r,n){let o=new fc(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,fs.funcKeywordCode)(o,r):"macro"in r?(0,fs.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,fs.funcKeywordCode)(o,r)}var Pj=/^\/(?:[^~]|~0|~1)*$/,Tj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function mw(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return J.default.rootData;if(e[0]==="/"){if(!Pj.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=J.default.rootData}else{let u=Tj.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,F._)`${i}${(0,F.getProperty)((0,zr.unescapeJsonPointer)(u))}`,s=(0,F._)`${s} && ${i}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}rn.getData=mw});var pc=k(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var Yf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Qf.default=Yf});var ms=k(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var ep=ls(),tp=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,ep.resolveUrl)(t,r,n),this.missingSchema=(0,ep.normalizeId)((0,ep.getFullPath)(t,this.missingRef))}};rp.default=tp});var hc=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.resolveSchema=Ut.getCompilingSchema=Ut.resolveRef=Ut.compileSchema=Ut.SchemaEnv=void 0;var Yt=Q(),Rj=pc(),Yn=Rr(),Qt=ls(),hw=ce(),zj=ps(),Zo=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,Qt.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};Ut.SchemaEnv=Zo;function op(e){let t=gw.call(this,e);if(t)return t;let r=(0,Qt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Yt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:Rj.default,code:(0,Yt._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:Yn.default.data,parentData:Yn.default.parentData,parentDataProperty:Yn.default.parentDataProperty,dataNames:[Yn.default.data],dataPathArr:[Yt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Yt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Yt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Yt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,zj.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let d=s.toString();l=`${s.scopeRefs(Yn.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let m=new Function(`${Yn.default.self}`,`${Yn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:p,items:y}=u;m.evaluated={props:p instanceof Yt.Name?void 0:p,items:y instanceof Yt.Name?void 0:y,dynamicProps:p instanceof Yt.Name,dynamicItems:y instanceof Yt.Name},m.source&&(m.source.evaluated=(0,Yt.stringify)(m.evaluated))}return e.validate=m,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)}}Ut.compileSchema=op;function Ej(e,t,r){var n;r=(0,Qt.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=jj.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 Zo({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Oj.call(this,i)}Ut.resolveRef=Ej;function Oj(e){return(0,Qt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:op.call(this,e)}function gw(e){for(let t of this._compilations)if(Cj(t,e))return t}Ut.getCompilingSchema=gw;function Cj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function jj(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||mc.call(this,e,t)}function mc(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Qt._getFullPath)(this.opts.uriResolver,r),o=(0,Qt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return np.call(this,r,e);let i=(0,Qt.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=mc.call(this,e,s);return typeof a?.schema!="object"?void 0:np.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||op.call(this,s),i===(0,Qt.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Qt.resolveUrl)(this.opts.uriResolver,o,u)),new Zo({schema:a,schemaId:c,root:e,baseId:o})}return np.call(this,r,s)}}Ut.resolveSchema=mc;var Nj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function np(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,hw.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Nj.has(a)&&u&&(t=(0,Qt.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,hw.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Qt.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=mc.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Zo({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var yw=k((E9,Ij)=>{Ij.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 ap=k((O9,$w)=>{"use strict";var Mj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vw=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),ip=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),bw=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Dj=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function sp(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 Aj=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _w(e){return e.length=0,!0}function qj(e,t,r){if(e.length){let n=sp(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function Zj(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=qj;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=_w}else{o.push(u);continue}}return o.length&&(a===_w?r.zone=o.join(""):s?n.push(o.join("")):n.push(sp(o))),r.address=n.join(""),r}function ww(e){if(Lj(e,":")<2)return{host:e,isIPV6:!1};let t=Zj(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 Lj(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function Fj(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 Uj={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Vj=/[@/?#:]/g,Hj=/[@/?#]/g;function xw(e,t){let r=t?Hj:Vj;return r.lastIndex=0,e.replace(r,n=>Uj[n])}function Bj(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(ip(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&bw(s)?r+=s:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function Wj(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(ip(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));i!=="."&&bw(i)?t+=i:t+="%"+o,r+=2;continue}}Dj(e[r])?t+=e[r]:t+=escape(e[r])}return t}function Jj(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(ip(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function Gj(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!vw(r)){let n=ww(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=xw(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}$w.exports={nonSimpleDomain:Aj,recomposeAuthority:Gj,reescapeHostDelimiters:xw,normalizePercentEncoding:Bj,normalizePathEncoding:Wj,escapePreservingEscapes:Jj,removeDotSegments:Fj,isIPv4:vw,isUUID:Mj,normalizeIPv6:ww,stringArrayToHexStripped:sp}});var Rw=k((C9,Tw)=>{"use strict";var{isUUID:Kj}=ap(),Xj=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Yj=["http","https","ws","wss","urn","urn:uuid"];function Qj(e){return Yj.indexOf(e)!==-1}function cp(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 Sw(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function kw(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 eN(e){return e.secure=cp(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function tN(e){if((e.port===(cp(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 rN(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Xj);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=up(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function nN(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=up(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 oN(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Kj(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function iN(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Pw={scheme:"http",domainHost:!0,parse:Sw,serialize:kw},sN={scheme:"https",domainHost:Pw.domainHost,parse:Sw,serialize:kw},gc={scheme:"ws",domainHost:!0,parse:eN,serialize:tN},aN={scheme:"wss",domainHost:gc.domainHost,parse:gc.parse,serialize:gc.serialize},cN={scheme:"urn",parse:rN,serialize:nN,skipNormalize:!0},uN={scheme:"urn:uuid",parse:oN,serialize:iN,skipNormalize:!0},yc={http:Pw,https:sN,ws:gc,wss:aN,urn:cN,"urn:uuid":uN};Object.setPrototypeOf(yc,null);function up(e){return e&&(yc[e]||yc[e.toLowerCase()])||void 0}Tw.exports={wsIsSecure:cp,SCHEMES:yc,isValidSchemeName:Qj,getSchemeHandler:up}});var Nw=k((j9,_c)=>{"use strict";var{normalizeIPv6:lN,removeDotSegments:hs,recomposeAuthority:dN,normalizePercentEncoding:fN,normalizePathEncoding:pN,escapePreservingEscapes:mN,reescapeHostDelimiters:hN,isIPv4:gN,nonSimpleDomain:yN}=ap(),{SCHEMES:_N,getSchemeHandler:Ew}=Rw();function vN(e,t){return typeof e=="string"?e=SN(e,t):typeof e=="object"&&(e=Lo(Qn(e,t),t)),e}function bN(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=Ow(Lo(e,n),Lo(t,n),n,!0);return n.skipEscape=!0,Qn(o,n)}function Ow(e,t,r,n){let o={};return n||(e=Lo(Qn(e,r),r),t=Lo(Qn(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=hs(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=hs(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=hs(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=hs(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 wN(e,t,r){let n=zw(e,r),o=zw(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Qn(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=Ew(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=fN(r.path):(r.path=mN(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=dN(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=hs(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 xN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function $N(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 Cw(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(xN);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=$N(n,s);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(gN(n.host)===!1){let l=lN(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=Ew(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&yN(n.host))try{n.host=new URL("http://"+n.host).hostname}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=hN(unescape(n.host),i))),n.path&&(n.path=pN(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 Lo(e,t){return Cw(e,t).parsed}function SN(e,t){return jw(e,t).normalized}function jw(e,t){let{parsed:r,malformedAuthorityOrPort:n}=Cw(e,t);return{normalized:n?e:Qn(r,t),malformedAuthorityOrPort:n}}function zw(e,t){if(typeof e=="string"){let{normalized:r,malformedAuthorityOrPort:n}=jw(e,t);return n?void 0:r}if(typeof e=="object")return Qn(e,t)}var lp={SCHEMES:_N,normalize:vN,resolve:bN,resolveComponent:Ow,equal:wN,serialize:Qn,parse:Lo};_c.exports=lp;_c.exports.default=lp;_c.exports.fastUri=lp});var Mw=k(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var Iw=Nw();Iw.code='require("ajv/dist/runtime/uri").default';dp.default=Iw});var Vw=k(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.CodeGen=tt.Name=tt.nil=tt.stringify=tt.str=tt._=tt.KeywordCxt=void 0;var kN=ps();Object.defineProperty(tt,"KeywordCxt",{enumerable:!0,get:function(){return kN.KeywordCxt}});var Fo=Q();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Fo._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Fo.str}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Fo.stringify}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Fo.nil}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Fo.Name}});Object.defineProperty(tt,"CodeGen",{enumerable:!0,get:function(){return Fo.CodeGen}});var PN=pc(),Lw=ms(),TN=qf(),gs=hc(),RN=Q(),ys=ls(),vc=us(),pp=ce(),Dw=yw(),zN=Mw(),Fw=(e,t)=>new RegExp(e,t);Fw.code="new RegExp";var EN=["removeAdditional","useDefaults","coerceTypes"],ON=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),CN={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."},jN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Aw=200;function NN(e){var t,r,n,o,i,s,a,c,u,l,d,h,m,p,y,v,P,T,z,M,C,Ne,de,mt,bn;let Ar=e.strict,fo=(t=e.code)===null||t===void 0?void 0:t.optimize,wi=fo===!0||fo===void 0?1:fo||0,xi=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Fw,ir=(o=e.uriResolver)!==null&&o!==void 0?o:zN.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Ar)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Ar)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ar)!==null&&l!==void 0?l:"log",strictTuples:(h=(d=e.strictTuples)!==null&&d!==void 0?d:Ar)!==null&&h!==void 0?h:"log",strictRequired:(p=(m=e.strictRequired)!==null&&m!==void 0?m:Ar)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:wi,regExp:xi}:{optimize:wi,regExp:xi},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:Aw,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:Aw,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:(T=e.messages)!==null&&T!==void 0?T:!0,inlineRefs:(z=e.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(C=e.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(Ne=e.validateSchema)!==null&&Ne!==void 0?Ne:!0,validateFormats:(de=e.validateFormats)!==null&&de!==void 0?de:!0,unicodeRegExp:(mt=e.unicodeRegExp)!==null&&mt!==void 0?mt:!0,int32range:(bn=e.int32range)!==null&&bn!==void 0?bn:!0,uriResolver:ir}}var _s=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,...NN(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new RN.ValueScope({scope:{},prefixes:ON,es5:r,lines:n}),this.logger=ZN(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,TN.getRules)(),qw.call(this,CN,t,"NOT SUPPORTED"),qw.call(this,jN,t,"DEPRECATED","warn"),this._metaOpts=AN.call(this),t.formats&&MN.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&DN.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),IN.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=Dw;n==="id"&&(o={...Dw},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 h=this._addSchema(l,d);return h.validate||s.call(this,h)}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 Lw.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,ys.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=Zw.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new gs.SchemaEnv({schema:{},schemaId:n});if(r=gs.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=Zw.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,ys.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(FN.call(this,n,r),!r)return(0,pp.eachItem)(n,i=>fp.call(this,i)),this;VN.call(this,r);let o={...r,type:(0,vc.getJSONTypes)(r.type),schemaType:(0,vc.getJSONTypes)(r.schemaType)};return(0,pp.eachItem)(n,o.type.length===0?i=>fp.call(this,i,o):i=>o.type.forEach(s=>fp.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]=Uw(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,ys.normalizeId)(s||n);let u=ys.getSchemaRefs.call(this,t,n);return c=new gs.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):gs.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{gs.compileSchema.call(this,t)}finally{this.opts=r}}};_s.ValidationError=PN.default;_s.MissingRefError=Lw.default;tt.default=_s;function qw(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 Zw(e){return e=(0,ys.normalizeId)(e),this.schemas[e]||this.refs[e]}function IN(){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 MN(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function DN(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 AN(){let e={...this.opts};for(let t of EN)delete e[t];return e}var qN={log(){},warn(){},error(){}};function ZN(e){if(e===!1)return qN;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 LN=/^[a-z_$][a-z0-9_$:-]*$/i;function FN(e,t){let{RULES:r}=this;if((0,pp.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!LN.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 fp(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,vc.getJSONTypes)(t.type),schemaType:(0,vc.getJSONTypes)(t.schemaType)}};t.before?UN.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 UN(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 VN(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Uw(t)),e.validateSchema=this.compile(t,!0))}var HN={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Uw(e){return{anyOf:[e,HN]}}});var Hw=k(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var BN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mp.default=BN});var Gw=k(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.callRef=eo.getValidate=void 0;var WN=ms(),Bw=Ft(),Pt=Q(),Uo=Rr(),Ww=hc(),bc=ce(),JN={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=Ww.resolveRef.call(c,u,o,r);if(l===void 0)throw new WN.default(n.opts.uriResolver,o,r);if(l instanceof Ww.SchemaEnv)return h(l);return m(l);function d(){if(i===u)return wc(e,s,i,i.$async);let p=t.scopeValue("root",{ref:u});return wc(e,(0,Pt._)`${p}.validate`,u,u.$async)}function h(p){let y=Jw(e,p);wc(e,y,p,p.$async)}function m(p){let y=t.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,Pt.stringify)(p)}:{ref:p}),v=t.name("valid"),P=e.subschema({schema:p,dataTypes:[],schemaPath:Pt.nil,topSchemaRef:y,errSchemaPath:r},v);e.mergeEvaluated(P),e.ok(v)}}};function Jw(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Pt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}eo.getValidate=Jw;function wc(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Uo.default.this:Pt.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let p=o.let("valid");o.try(()=>{o.code((0,Pt._)`await ${(0,Bw.callValidateCode)(e,t,u)}`),m(t),s||o.assign(p,!0)},y=>{o.if((0,Pt._)`!(${y} instanceof ${i.ValidationError})`,()=>o.throw(y)),h(y),s||o.assign(p,!1)}),e.ok(p)}function d(){e.result((0,Bw.callValidateCode)(e,t,u),()=>m(t),()=>h(t))}function h(p){let y=(0,Pt._)`${p}.errors`;o.assign(Uo.default.vErrors,(0,Pt._)`${Uo.default.vErrors} === null ? ${y} : ${Uo.default.vErrors}.concat(${y})`),o.assign(Uo.default.errors,(0,Pt._)`${Uo.default.vErrors}.length`)}function m(p){var y;if(!i.opts.unevaluated)return;let v=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(i.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(i.props=bc.mergeEvaluated.props(o,v.props,i.props));else{let P=o.var("props",(0,Pt._)`${p}.evaluated.props`);i.props=bc.mergeEvaluated.props(o,P,i.props,Pt.Name)}if(i.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(i.items=bc.mergeEvaluated.items(o,v.items,i.items));else{let P=o.var("items",(0,Pt._)`${p}.evaluated.items`);i.items=bc.mergeEvaluated.items(o,P,i.items,Pt.Name)}}}eo.callRef=wc;eo.default=JN});var Kw=k(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});var GN=Hw(),KN=Gw(),XN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",GN.default,KN.default];hp.default=XN});var Xw=k(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var xc=Q(),nn=xc.operators,$c={maximum:{okStr:"<=",ok:nn.LTE,fail:nn.GT},minimum:{okStr:">=",ok:nn.GTE,fail:nn.LT},exclusiveMaximum:{okStr:"<",ok:nn.LT,fail:nn.GTE},exclusiveMinimum:{okStr:">",ok:nn.GT,fail:nn.LTE}},YN={message:({keyword:e,schemaCode:t})=>(0,xc.str)`must be ${$c[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,xc._)`{comparison: ${$c[e].okStr}, limit: ${t}}`},QN={keyword:Object.keys($c),type:"number",schemaType:"number",$data:!0,error:YN,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,xc._)`${r} ${$c[t].fail} ${n} || isNaN(${r})`)}};gp.default=QN});var Yw=k(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var vs=Q(),eI={message:({schemaCode:e})=>(0,vs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,vs._)`{multipleOf: ${e}}`},tI={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eI,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,vs._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,vs._)`${s} !== parseInt(${s})`;e.fail$data((0,vs._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};yp.default=tI});var ex=k(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});function Qw(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}_p.default=Qw;Qw.code='require("ajv/dist/runtime/ucs2length").default'});var tx=k(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});var to=Q(),rI=ce(),nI=ex(),oI={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,to.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,to._)`{limit: ${e}}`},iI={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:oI,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?to.operators.GT:to.operators.LT,s=o.opts.unicode===!1?(0,to._)`${r}.length`:(0,to._)`${(0,rI.useFunc)(e.gen,nI.default)}(${r})`;e.fail$data((0,to._)`${s} ${i} ${n}`)}};vp.default=iI});var rx=k(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});var sI=Ft(),aI=ce(),Vo=Q(),cI={message:({schemaCode:e})=>(0,Vo.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Vo._)`{pattern: ${e}}`},uI={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cI,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,Vo._)`new RegExp`:(0,aI.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,Vo._)`${u}(${i}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,Vo._)`!${l}`)}else{let c=(0,sI.usePattern)(e,o);e.fail$data((0,Vo._)`!${c}.test(${r})`)}}};bp.default=uI});var nx=k(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var bs=Q(),lI={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,bs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,bs._)`{limit: ${e}}`},dI={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lI,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?bs.operators.GT:bs.operators.LT;e.fail$data((0,bs._)`Object.keys(${r}).length ${o} ${n}`)}};wp.default=dI});var ox=k(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});var ws=Ft(),xs=Q(),fI=ce(),pI={message:({params:{missingProperty:e}})=>(0,xs.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,xs._)`{missingProperty: ${e}}`},mI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:pI,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 m=e.parentSchema.properties,{definedProperties:p}=e.it;for(let y of r)if(m?.[y]===void 0&&!p.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,P=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,fI.checkStrictMode)(s,P,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(xs.nil,d);else for(let m of r)(0,ws.checkReportMissingProp)(e,m)}function l(){let m=t.let("missing");if(c||i){let p=t.let("valid",!0);e.block$data(p,()=>h(m,p)),e.ok(p)}else t.if((0,ws.checkMissingProp)(e,r,m)),(0,ws.reportMissingProp)(e,m),t.else()}function d(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m}),t.if((0,ws.noPropertyInData)(t,o,m,a.ownProperties),()=>e.error())})}function h(m,p){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(p,(0,ws.propertyInData)(t,o,m,a.ownProperties)),t.if((0,xs.not)(p),()=>{e.error(),t.break()})},xs.nil)}}};xp.default=mI});var ix=k($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});var $s=Q(),hI={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,$s.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,$s._)`{limit: ${e}}`},gI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:hI,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?$s.operators.GT:$s.operators.LT;e.fail$data((0,$s._)`${r}.length ${o} ${n}`)}};$p.default=gI});var Sc=k(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var sx=Wf();sx.code='require("ajv/dist/runtime/equal").default';Sp.default=sx});var ax=k(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});var kp=us(),rt=Q(),yI=ce(),_I=Sc(),vI={message:({params:{i:e,j:t}})=>(0,rt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,rt._)`{i: ${e}, j: ${t}}`},bI={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:vI,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,kp.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,rt._)`${s} === false`),e.ok(c);function l(){let p=t.let("i",(0,rt._)`${r}.length`),y=t.let("j");e.setParams({i:p,j:y}),t.assign(c,!0),t.if((0,rt._)`${p} > 1`,()=>(d()?h:m)(p,y))}function d(){return u.length>0&&!u.some(p=>p==="object"||p==="array")}function h(p,y){let v=t.name("item"),P=(0,kp.checkDataTypes)(u,v,a.opts.strictNumbers,kp.DataType.Wrong),T=t.const("indices",(0,rt._)`{}`);t.for((0,rt._)`;${p}--;`,()=>{t.let(v,(0,rt._)`${r}[${p}]`),t.if(P,(0,rt._)`continue`),u.length>1&&t.if((0,rt._)`typeof ${v} == "string"`,(0,rt._)`${v} += "_"`),t.if((0,rt._)`typeof ${T}[${v}] == "number"`,()=>{t.assign(y,(0,rt._)`${T}[${v}]`),e.error(),t.assign(c,!1).break()}).code((0,rt._)`${T}[${v}] = ${p}`)})}function m(p,y){let v=(0,yI.useFunc)(t,_I.default),P=t.name("outer");t.label(P).for((0,rt._)`;${p}--;`,()=>t.for((0,rt._)`${y} = ${p}; ${y}--;`,()=>t.if((0,rt._)`${v}(${r}[${p}], ${r}[${y}])`,()=>{e.error(),t.assign(c,!1).break(P)})))}}};Pp.default=bI});var cx=k(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var Tp=Q(),wI=ce(),xI=Sc(),$I={message:"must be equal to constant",params:({schemaCode:e})=>(0,Tp._)`{allowedValue: ${e}}`},SI={keyword:"const",$data:!0,error:$I,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,Tp._)`!${(0,wI.useFunc)(t,xI.default)}(${r}, ${o})`):e.fail((0,Tp._)`${i} !== ${r}`)}};Rp.default=SI});var ux=k(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var Ss=Q(),kI=ce(),PI=Sc(),TI={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Ss._)`{allowedValues: ${e}}`},RI={keyword:"enum",schemaType:"array",$data:!0,error:TI,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,kI.useFunc)(t,PI.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 m=t.const("vSchema",i);l=(0,Ss.or)(...o.map((p,y)=>h(m,y)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",i,m=>t.if((0,Ss._)`${u()}(${r}, ${m})`,()=>t.assign(l,!0).break()))}function h(m,p){let y=o[p];return typeof y=="object"&&y!==null?(0,Ss._)`${u()}(${r}, ${m}[${p}])`:(0,Ss._)`${r} === ${y}`}}};zp.default=RI});var lx=k(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});var zI=Xw(),EI=Yw(),OI=tx(),CI=rx(),jI=nx(),NI=ox(),II=ix(),MI=ax(),DI=cx(),AI=ux(),qI=[zI.default,EI.default,OI.default,CI.default,jI.default,NI.default,II.default,MI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DI.default,AI.default];Ep.default=qI});var Cp=k(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.validateAdditionalItems=void 0;var ro=Q(),Op=ce(),ZI={message:({params:{len:e}})=>(0,ro.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ro._)`{limit: ${e}}`},LI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ZI,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Op.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}dx(e,n)}};function dx(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,ro._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ro._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Op.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,ro._)`${a} <= ${t.length}`);r.if((0,ro.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:Op.Type.Num},u),s.allErrors||r.if((0,ro.not)(u),()=>r.break())})}}ks.validateAdditionalItems=dx;ks.default=LI});var jp=k(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.validateTuple=void 0;var fx=Q(),kc=ce(),FI=Ft(),UI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return px(e,"additionalItems",t);r.items=!0,!(0,kc.alwaysValidSchema)(r,t)&&e.ok((0,FI.validateArray)(e))}};function px(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=kc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,fx._)`${i}.length`);r.forEach((d,h)=>{(0,kc.alwaysValidSchema)(a,d)||(n.if((0,fx._)`${u} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},c)),e.ok(c))});function l(d){let{opts:h,errSchemaPath:m}=a,p=r.length,y=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(h.strictTuples&&!y){let v=`"${s}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,kc.checkStrictMode)(a,v,h.strictTuples)}}}Ps.validateTuple=px;Ps.default=UI});var mx=k(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var VI=jp(),HI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,VI.validateTuple)(e,"items")};Np.default=HI});var gx=k(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var hx=Q(),BI=ce(),WI=Ft(),JI=Cp(),GI={message:({params:{len:e}})=>(0,hx.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,hx._)`{limit: ${e}}`},KI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:GI,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,BI.alwaysValidSchema)(n,t)&&(o?(0,JI.validateAdditionalItems)(e,o):e.ok((0,WI.validateArray)(e)))}};Ip.default=KI});var yx=k(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});var Vt=Q(),Pc=ce(),XI={message:({params:{min:e,max:t}})=>t===void 0?(0,Vt.str)`must contain at least ${e} valid item(s)`:(0,Vt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Vt._)`{minContains: ${e}}`:(0,Vt._)`{minContains: ${e}, maxContains: ${t}}`},YI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:XI,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,Vt._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Pc.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Pc.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Pc.alwaysValidSchema)(i,r)){let y=(0,Vt._)`${l} >= ${s}`;a!==void 0&&(y=(0,Vt._)`${y} && ${l} <= ${a}`),e.pass(y);return}i.items=!0;let d=t.name("valid");a===void 0&&s===1?m(d,()=>t.if(d,()=>t.break())):s===0?(t.let(d,!0),a!==void 0&&t.if((0,Vt._)`${o}.length > 0`,h)):(t.let(d,!1),h()),e.result(d,()=>e.reset());function h(){let y=t.name("_valid"),v=t.let("count",0);m(y,()=>t.if(y,()=>p(v)))}function m(y,v){t.forRange("i",0,l,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:Pc.Type.Num,compositeRule:!0},y),v()})}function p(y){t.code((0,Vt._)`${y}++`),a===void 0?t.if((0,Vt._)`${y} >= ${s}`,()=>t.assign(d,!0).break()):(t.if((0,Vt._)`${y} > ${a}`,()=>t.assign(d,!1).break()),s===1?t.assign(d,!0):t.if((0,Vt._)`${y} >= ${s}`,()=>t.assign(d,!0)))}}};Mp.default=YI});var bx=k(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.validateSchemaDeps=pr.validatePropertyDeps=pr.error=void 0;var Dp=Q(),QI=ce(),Ts=Ft();pr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Dp.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Dp._)`{property: ${e},
8
8
  missingProperty: ${n},
9
9
  depsCount: ${t},
10
- deps: ${r}}`};var GN={keyword:"dependencies",type:"object",schemaType:"object",error:pr.error,code(e){let[t,r]=KN(e);hx(e,t),gx(e,r)}};function KN({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 hx(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,Ps.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,Ps.checkReportMissingProp)(e,u)}):(r.if((0,Np._)`${c} && (${(0,Ps.checkMissingProp)(e,a,i)})`),(0,Ps.reportMissingProp)(e,i),r.else())}}pr.validatePropertyDeps=hx;function gx(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,JN.alwaysValidSchema)(i,t[a])||(r.if((0,Ps.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))}pr.validateSchemaDeps=gx;pr.default=GN});var vx=k(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var _x=Q(),XN=ce(),YN={message:"property name must be valid",params:({params:e})=>(0,_x._)`{propertyName: ${e.propertyName}}`},QN={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:YN,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,XN.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,_x.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Ip.default=QN});var Ap=k(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});var Pc=Ft(),er=Q(),eI=zr(),Tc=ce(),tI={message:"must NOT have additional properties",params:({params:e})=>(0,er._)`{additionalProperty: ${e.additionalProperty}}`},rI={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:tI,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,Tc.alwaysValidSchema)(s,r))return;let u=(0,Pc.allSchemaProperties)(n.properties),l=(0,Pc.allSchemaProperties)(n.patternProperties);d(),e.ok((0,er._)`${i} === ${eI.default.errors}`);function d(){t.forIn("key",o,v=>{!u.length&&!l.length?p(v):t.if(h(v),()=>p(v))})}function h(v){let P;if(u.length>8){let T=(0,Tc.schemaRefOrVal)(s,n.properties,"properties");P=(0,Pc.isOwnProperty)(t,T,v)}else u.length?P=(0,er.or)(...u.map(T=>(0,er._)`${v} === ${T}`)):P=er.nil;return l.length&&(P=(0,er.or)(P,...l.map(T=>(0,er._)`${(0,Pc.usePattern)(e,T)}.test(${v})`))),(0,er.not)(P)}function m(v){t.code((0,er._)`delete ${o}[${v}]`)}function p(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Tc.alwaysValidSchema)(s,r)){let P=t.name("valid");c.removeAdditional==="failing"?(y(v,P,!1),t.if((0,er.not)(P),()=>{e.reset(),m(v)})):(y(v,P),a||t.if((0,er.not)(P),()=>t.break()))}}function y(v,P,T){let R={keyword:"additionalProperties",dataProp:v,dataPropType:Tc.Type.Str};T===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(R,P)}}};Dp.default=rI});var xx=k(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var nI=fs(),bx=Ft(),qp=ce(),wx=Ap(),oI={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&&wx.default.code(new nI.KeywordCxt(i,wx.default,"additionalProperties"));let s=(0,bx.allSchemaProperties)(r);for(let d of s)i.definedProperties.add(d);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=qp.mergeEvaluated.props(t,(0,qp.toHash)(s),i.props));let a=s.filter(d=>!(0,qp.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,bx.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)}}};Zp.default=oI});var Px=k(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var $x=Ft(),zc=Q(),Sx=ce(),kx=ce(),iI={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,$x.allSchemaProperties)(r),c=a.filter(y=>(0,Sx.alwaysValidSchema)(i,r[y]));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 zc.Name)&&(i.props=(0,kx.evaluatedPropsToName)(t,i.props));let{props:d}=i;h();function h(){for(let y of a)u&&m(y),i.allErrors?p(y):(t.var(l,!0),p(y),t.if(l))}function m(y){for(let v in u)new RegExp(y).test(v)&&(0,Sx.checkStrictMode)(i,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function p(y){t.forIn("key",n,v=>{t.if((0,zc._)`${(0,$x.usePattern)(e,y)}.test(${v})`,()=>{let P=c.includes(y);P||e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:kx.Type.Str},l),i.opts.unevaluated&&d!==!0?t.assign((0,zc._)`${d}[${v}]`,!0):!P&&!i.allErrors&&t.if((0,zc.not)(l),()=>t.break())})})}}};Lp.default=iI});var Tx=k(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});var sI=ce(),aI={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,sI.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"}};Fp.default=aI});var zx=k(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var cI=Ft(),uI={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cI.validateUnion,error:{message:"must match a schema in anyOf"}};Up.default=uI});var Rx=k(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var Rc=Q(),lI=ce(),dI={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Rc._)`{passingSchemas: ${e.passing}}`},fI={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dI,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 h;(0,lI.alwaysValidSchema)(o,l)?t.var(c,!0):h=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Rc._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Rc._)`[${a}, ${d}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,d),h&&e.mergeEvaluated(h,Rc.Name)})})}}};Vp.default=fI});var Ex=k(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});var pI=ce(),mI={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,pI.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Hp.default=mI});var jx=k(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});var Ec=Q(),Cx=ce(),hI={message:({params:e})=>(0,Ec.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ec._)`{failingKeyword: ${e.ifClause}}`},gI={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:hI,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Cx.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Ox(n,"then"),i=Ox(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,Ec.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 h=e.subschema({keyword:l},a);t.assign(s,a),e.mergeValidEvaluated(h,s),d?t.assign(d,(0,Ec._)`${l}`):e.setParams({ifClause:l})}}}};function Ox(e,t){let r=e.schema[t];return r!==void 0&&!(0,Cx.alwaysValidSchema)(e,r)}Bp.default=gI});var Mx=k(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var yI=ce(),_I={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,yI.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Wp.default=_I});var Nx=k(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var vI=Ep(),bI=dx(),wI=Op(),xI=px(),$I=mx(),SI=yx(),kI=vx(),PI=Ap(),TI=xx(),zI=Px(),RI=Tx(),EI=zx(),OI=Rx(),CI=Ex(),jI=jx(),MI=Mx();function NI(e=!1){let t=[RI.default,EI.default,OI.default,CI.default,jI.default,MI.default,kI.default,PI.default,SI.default,TI.default,zI.default];return e?t.push(bI.default,xI.default):t.push(vI.default,wI.default),t.push($I.default),t}Jp.default=NI});var Ix=k(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});var Le=Q(),II={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},DI={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:II,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?h():m();function h(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),y=r.const("fDef",(0,Le._)`${p}[${s}]`),v=r.let("fType"),P=r.let("format");r.if((0,Le._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(v,(0,Le._)`${y}.type || "string"`).assign(P,(0,Le._)`${y}.validate`),()=>r.assign(v,(0,Le._)`"string"`).assign(P,y)),e.fail$data((0,Le.or)(T(),R()));function T(){return c.strictSchema===!1?Le.nil:(0,Le._)`${s} && !${P}`}function R(){let I=l.$async?(0,Le._)`(${y}.async ? await ${P}(${n}) : ${P}(${n}))`:(0,Le._)`${P}(${n})`,C=(0,Le._)`(typeof ${P} == "function" ? ${I} : ${P}.test(${n}))`;return(0,Le._)`${P} && ${P} !== true && ${v} === ${t} && !${C}`}}function m(){let p=d.formats[i];if(!p){T();return}if(p===!0)return;let[y,v,P]=R(p);y===t&&e.pass(I());function T(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function R(C){let Me=C instanceof RegExp?(0,Le.regexpCode)(C):c.code.formats?(0,Le._)`${c.code.formats}${(0,Le.getProperty)(i)}`:void 0,de=r.scopeValue("formats",{key:i,ref:C,code:Me});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,Le._)`${de}.validate`]:["string",C,de]}function I(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${P}(${n})`}return typeof v=="function"?(0,Le._)`${P}(${n})`:(0,Le._)`${P}.test(${n})`}}}};Gp.default=DI});var Dx=k(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});var AI=Ix(),qI=[AI.default];Kp.default=qI});var Ax=k(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.contentVocabulary=Vo.metadataVocabulary=void 0;Vo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Zx=k(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var ZI=Ww(),LI=ax(),FI=Nx(),UI=Dx(),qx=Ax(),VI=[ZI.default,LI.default,(0,FI.default)(),UI.default,qx.metadataVocabulary,qx.contentVocabulary];Xp.default=VI});var Fx=k(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.DiscrError=void 0;var Lx;(function(e){e.Tag="tag",e.Mapping="mapping"})(Lx||(Oc.DiscrError=Lx={}))});var Vx=k(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});var Ho=Q(),Yp=Fx(),Ux=mc(),HI=ps(),BI=ce(),WI={message:({params:{discrError:e,tagName:t}})=>e===Yp.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Ho._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},JI={keyword:"discriminator",type:"object",schemaType:"object",error:WI,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,Ho._)`${r}${(0,Ho.getProperty)(a)}`);t.if((0,Ho._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Yp.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let m=h();t.if(!1);for(let p in m)t.elseIf((0,Ho._)`${u} === ${p}`),t.assign(c,d(m[p]));t.else(),e.error(!1,{discrError:Yp.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function d(m){let p=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:m},p);return e.mergeEvaluated(y,Ho.Name),p}function h(){var m;let p={},y=P(o),v=!0;for(let I=0;I<s.length;I++){let C=s[I];if(C?.$ref&&!(0,BI.schemaHasRulesButRef)(C,i.self.RULES)){let de=C.$ref;if(C=Ux.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,de),C instanceof Ux.SchemaEnv&&(C=C.schema),C===void 0)throw new HI.default(i.opts.uriResolver,i.baseId,de)}let Me=(m=C?.properties)===null||m===void 0?void 0:m[a];if(typeof Me!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(y||P(C)),T(Me,I)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return p;function P({required:I}){return Array.isArray(I)&&I.includes(a)}function T(I,C){if(I.const)R(I.const,C);else if(I.enum)for(let Me of I.enum)R(Me,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function R(I,C){if(typeof I!="string"||I in p)throw new Error(`discriminator: "${a}" values must be unique strings`);p[I]=C}}}};Qp.default=JI});var Hx=k((lF,GI)=>{GI.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 tm=k((Te,em)=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MissingRefError=Te.ValidationError=Te.CodeGen=Te.Name=Te.nil=Te.stringify=Te.str=Te._=Te.KeywordCxt=Te.Ajv=void 0;var KI=Lw(),XI=Zx(),YI=Vx(),Bx=Hx(),QI=["/properties"],Cc="http://json-schema.org/draft-07/schema",Bo=class extends KI.default{_addVocabularies(){super._addVocabularies(),XI.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(YI.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(Bx,QI):Bx;this.addMetaSchema(t,Cc,!1),this.refs["http://json-schema.org/schema"]=Cc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Cc)?Cc:void 0)}};Te.Ajv=Bo;em.exports=Te=Bo;em.exports.Ajv=Bo;Object.defineProperty(Te,"__esModule",{value:!0});Te.default=Bo;var e1=fs();Object.defineProperty(Te,"KeywordCxt",{enumerable:!0,get:function(){return e1.KeywordCxt}});var Wo=Q();Object.defineProperty(Te,"_",{enumerable:!0,get:function(){return Wo._}});Object.defineProperty(Te,"str",{enumerable:!0,get:function(){return Wo.str}});Object.defineProperty(Te,"stringify",{enumerable:!0,get:function(){return Wo.stringify}});Object.defineProperty(Te,"nil",{enumerable:!0,get:function(){return Wo.nil}});Object.defineProperty(Te,"Name",{enumerable:!0,get:function(){return Wo.Name}});Object.defineProperty(Te,"CodeGen",{enumerable:!0,get:function(){return Wo.CodeGen}});var t1=fc();Object.defineProperty(Te,"ValidationError",{enumerable:!0,get:function(){return t1.default}});var r1=ps();Object.defineProperty(Te,"MissingRefError",{enumerable:!0,get:function(){return r1.default}})});var e$=k(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.formatNames=hr.fastFormats=hr.fullFormats=void 0;function mr(e,t){return{validate:e,compare:t}}hr.fullFormats={date:mr(Kx,im),time:mr(nm(!0),sm),"date-time":mr(Wx(!0),Yx),"iso-time":mr(nm(),Xx),"iso-date-time":mr(Wx(),Qx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:c1,"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:h1,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:u1,int32:{type:"number",validate:f1},int64:{type:"number",validate:p1},float:{type:"number",validate:Gx},double:{type:"number",validate:Gx},password:!0,binary:!0};hr.fastFormats={...hr.fullFormats,date:mr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,im),time:mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sm),"date-time":mr(/^\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,Yx),"iso-time":mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Xx),"iso-date-time":mr(/^\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,Qx),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};hr.formatNames=Object.keys(hr.fullFormats);function n1(e){return e%4===0&&(e%100!==0||e%400===0)}var o1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Kx(e){let t=o1.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&&n1(r)?29:i1[n])}function im(e,t){if(e&&t)return e>t?1:e<t?-1:0}var rm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function nm(e){return function(r){let n=rm.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,h=o-u*c-(d<0?1:0);return(h===23||h===-1)&&(d===59||d===-1)&&s<61}}function sm(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 Xx(e,t){if(!(e&&t))return;let r=rm.exec(e),n=rm.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 om=/t|\s/i;function Wx(e){let t=nm(e);return function(n){let o=n.split(om);return o.length===2&&Kx(o[0])&&t(o[1])}}function Yx(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function Qx(e,t){if(!(e&&t))return;let[r,n]=e.split(om),[o,i]=t.split(om),s=im(r,o);if(s!==void 0)return s||sm(n,i)}var s1=/\/|:/,a1=/^(?:[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 c1(e){return s1.test(e)&&a1.test(e)}var Jx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function u1(e){return Jx.lastIndex=0,Jx.test(e)}var l1=-(2**31),d1=2**31-1;function f1(e){return Number.isInteger(e)&&e<=d1&&e>=l1}function p1(e){return Number.isInteger(e)}function Gx(){return!0}var m1=/[^\\]\\Z/;function h1(e){if(m1.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var t$=k(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.formatLimitDefinition=void 0;var g1=tm(),tr=Q(),on=tr.operators,jc={formatMaximum:{okStr:"<=",ok:on.LTE,fail:on.GT},formatMinimum:{okStr:">=",ok:on.GTE,fail:on.LT},formatExclusiveMaximum:{okStr:"<",ok:on.LT,fail:on.GTE},formatExclusiveMinimum:{okStr:">",ok:on.GT,fail:on.LTE}},y1={message:({keyword:e,schemaCode:t})=>(0,tr.str)`should be ${jc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,tr._)`{comparison: ${jc[e].okStr}, limit: ${t}}`};Jo.formatLimitDefinition={keyword:Object.keys(jc),type:"string",schemaType:"string",$data:!0,error:y1,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 g1.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),m=t.const("fmt",(0,tr._)`${h}[${c.schemaCode}]`);e.fail$data((0,tr.or)((0,tr._)`typeof ${m} != "object"`,(0,tr._)`${m} instanceof RegExp`,(0,tr._)`typeof ${m}.compare != "function"`,d(m)))}function l(){let h=c.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${o}": format "${h}" does not define "compare" function`);let p=t.scopeValue("formats",{key:h,ref:m,code:s.code.formats?(0,tr._)`${s.code.formats}${(0,tr.getProperty)(h)}`:void 0});e.fail$data(d(p))}function d(h){return(0,tr._)`${h}.compare(${r}, ${n}) ${jc[o].fail} 0`}},dependencies:["format"]};var _1=e=>(e.addKeyword(Jo.formatLimitDefinition),e);Jo.default=_1});var i$=k((Ts,o$)=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var Go=e$(),v1=t$(),am=Q(),r$=new am.Name("fullFormats"),b1=new am.Name("fastFormats"),cm=(e,t={keywords:!0})=>{if(Array.isArray(t))return n$(e,t,Go.fullFormats,r$),e;let[r,n]=t.mode==="fast"?[Go.fastFormats,b1]:[Go.fullFormats,r$],o=t.formats||Go.formatNames;return n$(e,o,r,n),t.keywords&&(0,v1.default)(e),e};cm.get=(e,t="full")=>{let n=(t==="fast"?Go.fastFormats:Go.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function n$(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,am._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}o$.exports=Ts=cm;Object.defineProperty(Ts,"__esModule",{value:!0});Ts.default=cm});var Xo=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.boolean=tD;Er.string=E$;Er.number=rD;Er.error=nD;Er.func=oD;Er.array=O$;Er.stringArray=iD;function tD(e){return e===!0||e===!1}function E$(e){return typeof e=="string"||e instanceof String}function rD(e){return typeof e=="number"||e instanceof Number}function nD(e){return e instanceof Error}function oD(e){return typeof e=="function"}function O$(e){return Array.isArray(e)}function iD(e){return O$(e)&&e.every(t=>E$(t))}});var Zm=k(D=>{"use strict";var sD=D&&D.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),aD=D&&D.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),cD=D&&D.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&sD(r,t,n[o]);return aD(r,t),r}})();Object.defineProperty(D,"__esModule",{value:!0});D.Message=D.NotificationType9=D.NotificationType8=D.NotificationType7=D.NotificationType6=D.NotificationType5=D.NotificationType4=D.NotificationType3=D.NotificationType2=D.NotificationType1=D.NotificationType0=D.NotificationType=D.RequestType9=D.RequestType8=D.RequestType7=D.RequestType6=D.RequestType5=D.RequestType4=D.RequestType3=D.RequestType2=D.RequestType1=D.RequestType=D.RequestType0=D.AbstractMessageSignature=D.ParameterStructures=D.ResponseError=D.ErrorCodes=void 0;var oo=cD(Xo()),gm;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(gm||(D.ErrorCodes=gm={}));var ym=class e extends Error{code;data;constructor(t,r,n){super(r),this.code=oo.number(t)?t:gm.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};D.ResponseError=ym;var cn=class e{kind;static auto=new e("auto");static byPosition=new e("byPosition");static byName=new e("byName");constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};D.ParameterStructures=cn;var ze=class{method;numberOfParams;constructor(t,r){this.method=t,this.numberOfParams=r}get parameterStructures(){return cn.auto}};D.AbstractMessageSignature=ze;var _m=class extends ze{_;constructor(t){super(t,0)}};D.RequestType0=_m;var vm=class extends ze{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.RequestType=vm;var bm=class extends ze{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.RequestType1=bm;var wm=class extends ze{_;constructor(t){super(t,2)}};D.RequestType2=wm;var xm=class extends ze{_;constructor(t){super(t,3)}};D.RequestType3=xm;var $m=class extends ze{_;constructor(t){super(t,4)}};D.RequestType4=$m;var Sm=class extends ze{_;constructor(t){super(t,5)}};D.RequestType5=Sm;var km=class extends ze{_;constructor(t){super(t,6)}};D.RequestType6=km;var Pm=class extends ze{_;constructor(t){super(t,7)}};D.RequestType7=Pm;var Tm=class extends ze{_;constructor(t){super(t,8)}};D.RequestType8=Tm;var zm=class extends ze{_;constructor(t){super(t,9)}};D.RequestType9=zm;var Rm=class extends ze{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.NotificationType=Rm;var Em=class extends ze{_;constructor(t){super(t,0)}};D.NotificationType0=Em;var Om=class extends ze{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.NotificationType1=Om;var Cm=class extends ze{_;constructor(t){super(t,2)}};D.NotificationType2=Cm;var jm=class extends ze{_;constructor(t){super(t,3)}};D.NotificationType3=jm;var Mm=class extends ze{_;constructor(t){super(t,4)}};D.NotificationType4=Mm;var Nm=class extends ze{_;constructor(t){super(t,5)}};D.NotificationType5=Nm;var Im=class extends ze{_;constructor(t){super(t,6)}};D.NotificationType6=Im;var Dm=class extends ze{_;constructor(t){super(t,7)}};D.NotificationType7=Dm;var Am=class extends ze{_;constructor(t){super(t,8)}};D.NotificationType8=Am;var qm=class extends ze{_;constructor(t){super(t,9)}};D.NotificationType9=qm;var C$;(function(e){function t(o){let i=o;return i&&oo.string(i.method)&&(oo.string(i.id)||oo.number(i.id))}e.isRequest=t;function r(o){let i=o;return i&&oo.string(i.method)&&o.id===void 0}e.isNotification=r;function n(o){let i=o;return i&&(i.result!==void 0||!!i.error)&&(oo.string(i.id)||oo.number(i.id)||i.id===null)}e.isResponse=n})(C$||(D.Message=C$={}))});var Fm=k(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.LRUCache=un.LinkedMap=un.Touch=void 0;var ct;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(ct||(un.Touch=ct={}));var Uc=class{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(t){let r=this._map.get(t);return r?r.previous?.value:void 0}after(t){let r=this._map.get(t);return r?r.next?.value:void 0}has(t){return this._map.has(t)}get(t,r=ct.None){let n=this._map.get(t);if(n)return r!==ct.None&&this.touch(n,r),n.value}set(t,r,n=ct.None){let o=this._map.get(t);if(o)o.value=r,n!==ct.None&&this.touch(o,n);else{switch(o={key:t,value:r,next:void 0,previous:void 0},n){case ct.None:this.addItemLast(o);break;case ct.First:this.addItemFirst(o);break;case ct.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(t,o),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let r=this._map.get(t);if(r)return this._map.delete(t),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,r){let n=this._state,o=this._head;for(;o;){if(r?t.bind(r)(o.value,o.key,this):t(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}values(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}entries(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}[Symbol.iterator](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>t;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let r=t.next,n=t.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}t.next=void 0,t.previous=void 0,this._state++}touch(t,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==ct.First&&r!==ct.Last)){if(r===ct.First){if(t===this._head)return;let n=t.next,o=t.previous;t===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(r===ct.Last){if(t===this._tail)return;let n=t.next,o=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((r,n)=>{t.push([n,r])}),t}fromJSON(t){this.clear();for(let[r,n]of t)this.set(r,n)}};un.LinkedMap=Uc;var Lm=class extends Uc{_limit;_ratio;constructor(t,r=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,r=ct.AsNew){return super.get(t,r)}peek(t){return super.get(t,ct.None)}set(t,r){return super.set(t,r,ct.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};un.LRUCache=Lm});var M$=k(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Disposable=void 0;var j$;(function(e){function t(r){return{dispose:r}}e.create=t})(j$||(Vc.Disposable=j$={}))});var ln=k(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});var Um;function Vm(){if(Um===void 0)throw new Error("No runtime abstraction layer installed");return Um}(function(e){function t(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Um=r}e.install=t})(Vm||(Vm={}));Hm.default=Vm});var Yo=k(dn=>{"use strict";var uD=dn&&dn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dn,"__esModule",{value:!0});dn.Emitter=dn.Event=void 0;var lD=uD(ln()),N$;(function(e){let t={dispose(){}};e.None=function(){return t}})(N$||(dn.Event=N$={}));var Bm=class{_callbacks;_contexts;add(t,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(t,r)})}remove(t,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,i=this._callbacks.length;o<i;o++)if(this._callbacks[o]===t)if(this._contexts[o]===r){this._callbacks.splice(o,1),this._contexts.splice(o,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),o=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{r.push(n[i].apply(o[i],t))}catch(a){(0,lD.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Wm=class e{_options;static _noop=function(){};_event;_callbacks;constructor(t){this._options=t}get event(){return this._event||(this._event=(t,r,n)=>{this._callbacks||(this._callbacks=new Bm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,r);let o={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,r),o.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(o),o}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};dn.Emitter=Wm});var Wc=k(Tt=>{"use strict";var dD=Tt&&Tt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),fD=Tt&&Tt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),pD=Tt&&Tt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&dD(r,t,n[o]);return fD(r,t),r}})(),mD=Tt&&Tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.CancellationTokenSource=Tt.CancellationToken=void 0;var hD=mD(ln()),gD=pD(Xo()),Jm=Yo(),Hc;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Jm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Jm.Event.None});function t(r){let n=r;return n&&(n===e.None||n===e.Cancelled||gD.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}e.is=t})(Hc||(Tt.CancellationToken=Hc={}));var yD=Object.freeze(function(e,t){let r=(0,hD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){r.dispose()}}}),Bc=class{_isCancelled=!1;_emitter;cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?yD:(this._emitter||(this._emitter=new Jm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Gm=class{_token;get token(){return this._token||(this._token=new Bc),this._token}cancel(){this._token?this._token.cancel():this._token=Hc.Cancelled}dispose(){this._token?this._token instanceof Bc&&this._token.dispose():this._token=Hc.None}};Tt.CancellationTokenSource=Gm});var I$=k(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.SharedArrayReceiverStrategy=Qo.SharedArraySenderStrategy=void 0;var _D=Wc(),Os;(function(e){e.Continue=0,e.Cancelled=1})(Os||(Os={}));var Km=class{buffers;constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Os.Continue,this.buffers.set(t.id,r),t.$cancellationData=r}async sendCancellation(t,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,Os.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};Qo.SharedArraySenderStrategy=Km;var Xm=class{data;constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Os.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Ym=class{token;constructor(t){this.token=new Xm(t)}cancel(){}dispose(){}},Qm=class{kind="request";createCancellationTokenSource(t){let r=t.$cancellationData;return r===void 0?new _D.CancellationTokenSource:new Ym(r)}};Qo.SharedArrayReceiverStrategy=Qm});var th=k(ei=>{"use strict";var vD=ei&&ei.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ei,"__esModule",{value:!0});ei.Semaphore=void 0;var bD=vD(ln()),eh=class{_capacity;_active;_waiting;constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((r,n)=>{this._waiting.push({thunk:t,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,bD.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{let r=t.thunk();r instanceof Promise?r.then(n=>{this._active--,t.resolve(n),this.runNext()},n=>{this._active--,t.reject(n),this.runNext()}):(this._active--,t.resolve(r),this.runNext())}catch(r){this._active--,t.reject(r),this.runNext()}}};ei.Semaphore=eh});var A$=k(ut=>{"use strict";var wD=ut&&ut.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),xD=ut&&ut.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),$D=ut&&ut.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&wD(r,t,n[o]);return xD(r,t),r}})(),SD=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ut,"__esModule",{value:!0});ut.ReadableStreamMessageReader=ut.AbstractMessageReader=ut.MessageReader=void 0;var nh=SD(ln()),ti=$D(Xo()),rh=Yo(),kD=th(),D$;(function(e){function t(r){let n=r;return n&&ti.func(n.listen)&&ti.func(n.dispose)&&ti.func(n.onError)&&ti.func(n.onClose)&&ti.func(n.onPartialMessage)}e.is=t})(D$||(ut.MessageReader=D$={}));var Jc=class{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new rh.Emitter,this.closeEmitter=new rh.Emitter,this.partialMessageEmitter=new rh.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${ti.string(t.message)?t.message:"unknown"}`)}};ut.AbstractMessageReader=Jc;var oh;(function(e){function t(r){let n,o,i,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(i=r.contentDecoder,s.set(i.name,i)),r.contentDecoders!==void 0)for(let u of r.contentDecoders)s.set(u.name,u);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let u of r.contentTypeDecoders)c.set(u.name,u)}return a===void 0&&(a=(0,nh.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:i,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}e.fromOptions=t})(oh||(oh={}));var ih=class extends Jc{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor(t,r){super(),this.readable=t,this.options=oh.fromOptions(r),this.buffer=(0,nh.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new kD.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property.
11
- ${JSON.stringify(Object.fromEntries(n))}`));return}let i=parseInt(o);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=i}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,nh.default)().timer.setTimeout((t,r)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ut.ReadableStreamMessageReader=ih});var U$=k(lt=>{"use strict";var PD=lt&&lt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),TD=lt&&lt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),zD=lt&&lt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&PD(r,t,n[o]);return TD(r,t),r}})(),RD=lt&&lt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lt,"__esModule",{value:!0});lt.WriteableStreamMessageWriter=lt.AbstractMessageWriter=lt.MessageWriter=void 0;var q$=RD(ln()),Cs=zD(Xo()),ED=th(),Z$=Yo(),OD="Content-Length: ",L$=`\r
12
- `,F$;(function(e){function t(r){let n=r;return n&&Cs.func(n.dispose)&&Cs.func(n.onClose)&&Cs.func(n.onError)&&Cs.func(n.write)}e.is=t})(F$||(lt.MessageWriter=F$={}));var Gc=class{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new Z$.Emitter,this.closeEmitter=new Z$.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,r,n){this.errorEmitter.fire([this.asError(t),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${Cs.string(t.message)?t.message:"unknown"}`)}};lt.AbstractMessageWriter=Gc;var sh;(function(e){function t(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,q$.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,q$.default)().applicationJson.encoder}}e.fromOptions=t})(sh||(sh={}));var ah=class extends Gc{writable;options;errorCount;writeSemaphore;constructor(t,r){super(),this.writable=t,this.options=sh.fromOptions(r),this.errorCount=0,this.writeSemaphore=new ED.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(OD,n.byteLength.toString(),L$),o.push(L$),this.doWrite(t,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(t,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,t),Promise.reject(o)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){this.writable.end()}};lt.WriteableStreamMessageWriter=ah});var V$=k(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.AbstractMessageBuffer=void 0;var CD=13,jD=10,MD=`\r
13
- `,ch=class{_encoding;_chunks;_totalLength;constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let r=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,i=0;e:for(;n<this._chunks.length;){let u=this._chunks[n];for(o=0;o<u.length;){switch(u[o]){case CD:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case jD:switch(r){case 1:r=2;break;case 3:r=4,o++;break e;default:r=0}break;default:r=0}o++}i+=u.byteLength,n++}if(r!==4)return;let s=this._read(i+o),a=new Map,c=this.toString(s,"ascii").split(MD);if(c.length<2)return a;for(let u=0;u<c.length-2;u++){let l=c[u],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
14
- ${l}`);let h=l.substr(0,d),m=l.substr(d+1).trim();a.set(t?h.toLowerCase():h,m)}return a}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(i)}if(this._chunks[0].byteLength>t){let i=this._chunks[0],s=this.asNative(i,t);return this._chunks[0]=i.slice(t),this._totalLength-=t,s}let r=this.allocNative(t),n=0,o=0;for(;t>0;){let i=this._chunks[o];if(i.byteLength>t){let s=i.slice(0,t);r.set(s,n),n+=t,this._chunks[o]=i.slice(t),this._totalLength-=t,t-=t}else r.set(i,n),n+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,t-=i.byteLength}return r}};Kc.AbstractMessageBuffer=ch});var J$=k(V=>{"use strict";var ND=V&&V.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),ID=V&&V.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),DD=V&&V.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&ND(r,t,n[o]);return ID(r,t),r}})(),AD=V&&V.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V,"__esModule",{value:!0});V.ConnectionOptions=V.MessageStrategy=V.CancellationStrategy=V.CancellationSenderStrategy=V.CancellationReceiverStrategy=V.RequestCancellationReceiverStrategy=V.IdCancellationReceiverStrategy=V.ConnectionStrategy=V.ConnectionError=V.ConnectionErrors=V.LogTraceNotification=V.SetTraceNotification=V.TraceFormat=V.TraceValues=V.TraceValue=V.Trace=V.NullLogger=V.ProgressType=V.ProgressToken=void 0;V.createMessageConnection=qD;var H$=AD(ln()),De=DD(Xo()),G=Zm(),B$=Fm(),js=Yo(),uh=Wc(),Is;(function(e){e.type=new G.NotificationType("$/cancelRequest")})(Is||(Is={}));var lh;(function(e){function t(r){return typeof r=="string"||typeof r=="number"}e.is=t})(lh||(V.ProgressToken=lh={}));var Ms;(function(e){e.type=new G.NotificationType("$/progress")})(Ms||(Ms={}));var dh=class{__;_pr;constructor(){}};V.ProgressType=dh;var fh;(function(e){function t(r){return De.func(r)}e.is=t})(fh||(fh={}));V.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var pe;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(pe||(V.Trace=pe={}));var ph;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(ph||(V.TraceValue=ph={}));V.TraceValues=ph;(function(e){function t(n){if(!De.string(n))return e.Off;switch(n=n.toLowerCase(),n){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function r(n){switch(n){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=r})(pe||(V.Trace=pe={}));var jt;(function(e){e.Text="text",e.JSON="json"})(jt||(V.TraceFormat=jt={}));(function(e){function t(r){return De.string(r)?(r=r.toLowerCase(),r==="json"?e.JSON:e.Text):e.Text}e.fromString=t})(jt||(V.TraceFormat=jt={}));var mh;(function(e){e.type=new G.NotificationType("$/setTrace")})(mh||(V.SetTraceNotification=mh={}));var Xc;(function(e){e.type=new G.NotificationType("$/logTrace")})(Xc||(V.LogTraceNotification=Xc={}));var Ns;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(Ns||(V.ConnectionErrors=Ns={}));var ri=class e extends Error{code;constructor(t,r){super(r),this.code=t,Object.setPrototypeOf(this,e.prototype)}};V.ConnectionError=ri;var hh;(function(e){function t(r){let n=r;return n&&De.func(n.cancelUndispatched)}e.is=t})(hh||(V.ConnectionStrategy=hh={}));var Yc;(function(e){function t(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}e.is=t})(Yc||(V.IdCancellationReceiverStrategy=Yc={}));var gh;(function(e){function t(r){let n=r;return n&&n.kind==="request"&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}e.is=t})(gh||(V.RequestCancellationReceiverStrategy=gh={}));var Qc;(function(e){e.Message=Object.freeze({createCancellationTokenSource(r){return new uh.CancellationTokenSource}});function t(r){return Yc.is(r)||gh.is(r)}e.is=t})(Qc||(V.CancellationReceiverStrategy=Qc={}));var eu;(function(e){e.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Is.type,{id:n})},cleanup(r){}});function t(r){let n=r;return n&&De.func(n.sendCancellation)&&De.func(n.cleanup)}e.is=t})(eu||(V.CancellationSenderStrategy=eu={}));var tu;(function(e){e.Message=Object.freeze({receiver:Qc.Message,sender:eu.Message});function t(r){let n=r;return n&&Qc.is(n.receiver)&&eu.is(n.sender)}e.is=t})(tu||(V.CancellationStrategy=tu={}));var ru;(function(e){function t(r){let n=r;return n&&De.func(n.handleMessage)}e.is=t})(ru||(V.MessageStrategy=ru={}));var W$;(function(e){function t(r){let n=r;return n&&(tu.is(n.cancellationStrategy)||hh.is(n.connectionStrategy)||ru.is(n.messageStrategy)||De.number(n.maxParallelism))}e.is=t})(W$||(V.ConnectionOptions=W$={}));var rr;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"})(rr||(rr={}));function qD(e,t,r,n){let o=r!==void 0?r:V.NullLogger,i=0,s=0,a=0,c="2.0",u=n?.maxParallelism??-1,l=0,d,h=new Map,m,p=new Map,y=new Map,v,P=new B$.LinkedMap,T=new Map,R=new Set,I=new Map,C=pe.Off,Me=jt.Text,de,mt=rr.New,vn=new js.Emitter,Ar=new js.Emitter,lo=new js.Emitter,bi=new js.Emitter,wi=new js.Emitter,ir=n&&n.cancellationStrategy?n.cancellationStrategy:tu.Message;function eP(g){}function dy(){return mt===rr.Listening}function fy(){return mt===rr.Closed}function fo(){return mt===rr.Disposed}function py(){(mt===rr.New||mt===rr.Listening)&&(mt=rr.Closed,Ar.fire(void 0))}function tP(g){vn.fire([g,void 0,void 0])}function rP(g){vn.fire(g)}e.onClose(py),e.onError(tP),t.onClose(py),t.onError(rP);function my(g){if(g===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+g.toString()}function nP(g){return g===null?"res-unknown-"+(++a).toString():"res-"+g.toString()}function oP(){return"not-"+(++s).toString()}function iP(g,S){G.Message.isRequest(S)?g.set(my(S.id),S):G.Message.isResponse(S)?u===-1?g.set(nP(S.id),S):gy(S):g.set(oP(),S)}function Eu(){v||P.size===0||u!==-1&&l>=u||(v=(0,H$.default)().timer.setImmediate(async()=>{if(v=void 0,P.size===0||u!==-1&&l>=u)return;let g=P.shift(),S;try{l++;let O=n?.messageStrategy;ru.is(O)?S=O.handleMessage(g,hy):S=hy(g)}catch(O){o.error(`Processing message queue failed: ${O.toString()}`)}finally{S instanceof Promise?S.then(()=>{l--,Eu()}).catch(O=>{o.error(`Processing message queue failed: ${O.toString()}`)}):l--,Eu()}}))}async function hy(g){return G.Message.isRequest(g)?aP(g):G.Message.isNotification(g)?cP(g):G.Message.isResponse(g)?gy(g):uP(g)}let sP=g=>{try{if(G.Message.isNotification(g)&&g.method===Is.type.method){let S=g.params.id,O=my(S),A=P.get(O);if(G.Message.isRequest(A)){let Ne=n?.connectionStrategy,he=Ne&&Ne.cancelUndispatched?Ne.cancelUndispatched(A,eP):void 0;if(he&&(he.error!==void 0||he.result!==void 0)){P.delete(O),I.delete(S),he.id=A.id,Ou(he,g.method,Date.now()),t.write(he).catch(()=>o.error("Sending response for canceled message failed."));return}}let fe=I.get(S);if(fe!==void 0){fe.cancel(),Cu(g);return}else R.add(S)}iP(P,g)}finally{Eu()}};async function aP(g){if(fo())return Promise.resolve();function S(He,nt,qe){let Ze={jsonrpc:c,id:g.id};return He instanceof G.ResponseError?Ze.error=He.toJson():Ze.result=He===void 0?null:He,Ou(Ze,nt,qe),t.write(Ze)}function O(He,nt,qe){let Ze={jsonrpc:c,id:g.id,error:He.toJson()};return Ou(Ze,nt,qe),t.write(Ze)}fP(g);let A=h.get(g.method),fe,Ne;A&&(fe=A.type,Ne=A.handler);let he=Date.now();if(Ne||d){let He=g.id??String(Date.now()),nt=Yc.is(ir.receiver)?ir.receiver.createCancellationTokenSource(He):ir.receiver.createCancellationTokenSource(g);g.id!==null&&R.has(g.id)&&nt.cancel(),g.id!==null&&I.set(He,nt);try{let qe;if(Ne)if(g.params===void 0){if(fe!==void 0&&fe.numberOfParams!==0)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines ${fe.numberOfParams} params but received none.`),g.method,he);qe=Ne(nt.token)}else if(Array.isArray(g.params)){if(fe!==void 0&&fe.parameterStructures===G.ParameterStructures.byName)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by name but received parameters by position`),g.method,he);qe=Ne(...g.params,nt.token)}else{if(fe!==void 0&&fe.parameterStructures===G.ParameterStructures.byPosition)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by position but received parameters by name`),g.method,he);qe=Ne(g.params,nt.token)}else d&&(qe=d(g.method,g.params,nt.token));let Ze=await qe;await S(Ze,g.method,he)}catch(qe){qe instanceof G.ResponseError?await S(qe,g.method,he):qe&&De.string(qe.message)?await O(new G.ResponseError(G.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${qe.message}`),g.method,he):await O(new G.ResponseError(G.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,he)}finally{I.delete(He)}}else await O(new G.ResponseError(G.ErrorCodes.MethodNotFound,`Unhandled method ${g.method}`),g.method,he)}function gy(g){if(!fo())if(g.id===null)g.error?o.error(`Received response message without id: Error is:
15
- ${JSON.stringify(g.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let S=g.id,O=T.get(S);if(pP(g,O),O!==void 0){T.delete(S);try{if(g.error){let A=g.error;O.reject(new G.ResponseError(A.code,A.message,A.data))}else if(g.result!==void 0)O.resolve(g.result);else throw new Error("Should never happen.")}catch(A){A.message?o.error(`Response handler '${O.method}' failed with message: ${A.message}`):o.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}async function cP(g){if(fo())return;let S,O;if(g.method===Is.type.method){let A=g.params.id;R.delete(A),Cu(g);return}else{let A=p.get(g.method);A&&(O=A.handler,S=A.type)}if(O||m)try{if(Cu(g),O)if(g.params===void 0)S!==void 0&&S.numberOfParams!==0&&S.parameterStructures!==G.ParameterStructures.byName&&o.error(`Notification ${g.method} defines ${S.numberOfParams} params but received none.`),await O();else if(Array.isArray(g.params)){let A=g.params;g.method===Ms.type.method&&A.length===2&&lh.is(A[0])?await O({token:A[0],value:A[1]}):(S!==void 0&&(S.parameterStructures===G.ParameterStructures.byName&&o.error(`Notification ${g.method} defines parameters by name but received parameters by position`),S.numberOfParams!==g.params.length&&o.error(`Notification ${g.method} defines ${S.numberOfParams} params but received ${A.length} arguments`)),await O(...A))}else S!==void 0&&S.parameterStructures===G.ParameterStructures.byPosition&&o.error(`Notification ${g.method} defines parameters by position but received parameters by name`),await O(g.params);else m&&await m(g.method,g.params)}catch(A){A.message?o.error(`Notification handler '${g.method}' failed with message: ${A.message}`):o.error(`Notification handler '${g.method}' failed unexpectedly.`)}else lo.fire(g)}function uP(g){if(!g){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message:
16
- ${JSON.stringify(g,null,4)}`);let S=g;if(De.string(S.id)||De.number(S.id)){let O=S.id,A=T.get(O);A&&A.reject(new Error("The received response has neither a result nor an error property."))}}function qr(g){if(g!=null)switch(C){case pe.Verbose:return JSON.stringify(g,null,4);case pe.Compact:return JSON.stringify(g);default:return}}function lP(g){if(!(C===pe.Off||!de))if(Me===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&g.params&&(S=`Params: ${qr(g.params)}`),de.log(`Sending request '${g.method} - (${g.id})'.`,S)}else po("send-request",g)}function dP(g){if(!(C===pe.Off||!de))if(Me===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&(g.params?S=`Params: ${qr(g.params)}`:S="No parameters provided."),de.log(`Sending notification '${g.method}'.`,S)}else po("send-notification",g)}function Ou(g,S,O){if(!(C===pe.Off||!de))if(Me===jt.Text){let A;(C===pe.Verbose||C===pe.Compact)&&(g.error&&g.error.data?A=`Error data: ${qr(g.error.data)}`:g.result?A=`Result: ${qr(g.result)}`:g.error===void 0&&(A="No result returned.")),de.log(`Sending response '${S} - (${g.id})'. Processing request took ${Date.now()-O}ms`,A)}else po("send-response",g)}function fP(g){if(!(C===pe.Off||!de))if(Me===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&g.params&&(S=`Params: ${qr(g.params)}`),de.log(`Received request '${g.method} - (${g.id})'.`,S)}else po("receive-request",g)}function Cu(g){if(!(C===pe.Off||!de||g.method===Xc.type.method))if(Me===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&(g.params?S=`Params: ${qr(g.params)}`:S="No parameters provided."),de.log(`Received notification '${g.method}'.`,S)}else po("receive-notification",g)}function pP(g,S){if(!(C===pe.Off||!de))if(Me===jt.Text){let O;if((C===pe.Verbose||C===pe.Compact)&&(g.error&&g.error.data?O=`Error data: ${qr(g.error.data)}`:g.result?O=`Result: ${qr(g.result)}`:g.error===void 0&&(O="No result returned.")),S){let A=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:"";de.log(`Received response '${S.method} - (${g.id})' in ${Date.now()-S.timerStart}ms.${A}`,O)}else de.log(`Received response ${g.id} without active response promise.`,O)}else po("receive-response",g)}function po(g,S){if(!de||C===pe.Off)return;let O={isLSPMessage:!0,type:g,message:S,timestamp:Date.now()};de.log(O)}function xi(){if(fy())throw new ri(Ns.Closed,"Connection is closed.");if(fo())throw new ri(Ns.Disposed,"Connection is disposed.")}function mP(){if(dy())throw new ri(Ns.AlreadyListening,"Connection is already listening")}function hP(){if(!dy())throw new Error("Call listen() first.")}function $i(g){return g===void 0?null:g}function yy(g){if(g!==null)return g}function _y(g){return g!=null&&!Array.isArray(g)&&typeof g=="object"}function ju(g,S){switch(g){case G.ParameterStructures.auto:return _y(S)?yy(S):[$i(S)];case G.ParameterStructures.byName:if(!_y(S))throw new Error("Received parameters by name but param is not an object literal.");return yy(S);case G.ParameterStructures.byPosition:return[$i(S)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}function vy(g,S){let O,A=g.numberOfParams;switch(A){case 0:O=void 0;break;case 1:O=ju(g.parameterStructures,S[0]);break;default:O=[];for(let fe=0;fe<S.length&&fe<A;fe++)O.push($i(S[fe]));if(S.length<A)for(let fe=S.length;fe<A;fe++)O.push(null);break}return O}let bn={sendNotification:(g,...S)=>{xi();let O,A;if(De.string(g)){O=g;let Ne=S[0],he=0,He=G.ParameterStructures.auto;G.ParameterStructures.is(Ne)&&(he=1,He=Ne);let nt=S.length,qe=nt-he;switch(qe){case 0:A=void 0;break;case 1:A=ju(He,S[he]);break;default:if(He===G.ParameterStructures.byName)throw new Error(`Received ${qe} parameters for 'by Name' notification parameter structure.`);A=S.slice(he,nt).map(Ze=>$i(Ze));break}}else{let Ne=S;O=g.method,A=vy(g,Ne)}let fe={jsonrpc:c,method:O,params:A};return dP(fe),t.write(fe).catch(Ne=>{throw o.error("Sending notification failed."),Ne})},onNotification:(g,S)=>{xi();let O;return De.func(g)?m=g:S&&(De.string(g)?(O=g,p.set(g,{type:void 0,handler:S})):(O=g.method,p.set(g.method,{type:g,handler:S}))),{dispose:()=>{O!==void 0?p.get(O)?.handler===S&&p.delete(O):m===g&&(m=void 0)}}},onProgress:(g,S,O)=>{if(y.has(S))throw new Error(`Progress handler for token ${S} already registered`);return y.set(S,O),{dispose:()=>{y.get(S)===O&&y.delete(S)}}},sendProgress:(g,S,O)=>bn.sendNotification(Ms.type,{token:S,value:O}),onUnhandledProgress:bi.event,sendRequest:(g,...S)=>{xi(),hP();function O(Ze,Bt){let br=ir.sender.sendCancellation(Ze,Bt);br===void 0?o.log(`Received no promise from cancellation strategy when cancelling id ${Bt}`):br.catch(()=>{o.log(`Sending cancellation messages for id ${Bt} failed.`)})}let A,fe,Ne;if(De.string(g)){A=g;let Ze=S[0],Bt=S[S.length-1],br=0,Si=G.ParameterStructures.auto;G.ParameterStructures.is(Ze)&&(br=1,Si=Ze);let wn=S.length;uh.CancellationToken.is(Bt)&&(wn=wn-1,Ne=Bt);let sr=wn-br;switch(sr){case 0:fe=void 0;break;case 1:fe=ju(Si,S[br]);break;default:if(Si===G.ParameterStructures.byName)throw new Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);fe=S.slice(br,wn).map(gP=>$i(gP));break}}else{let Ze=S;A=g.method,fe=vy(g,Ze);let Bt=g.numberOfParams;Ne=uh.CancellationToken.is(Ze[Bt])?Ze[Bt]:void 0}let he=i++,He,nt=!1;Ne!==void 0&&(Ne.isCancellationRequested?nt=!0:He=Ne.onCancellationRequested(()=>{O(bn,he)}));let qe={jsonrpc:c,id:he,method:A,params:fe};return lP(qe),typeof ir.sender.enableCancellation=="function"&&ir.sender.enableCancellation(qe),new Promise(async(Ze,Bt)=>{let br=sr=>{Ze(sr),ir.sender.cleanup(he),He?.dispose()},Si=sr=>{Bt(sr),ir.sender.cleanup(he),He?.dispose()},wn={method:A,timerStart:Date.now(),resolve:br,reject:Si};try{T.set(he,wn),await t.write(qe),nt&&O(bn,he)}catch(sr){throw T.delete(he),wn.reject(new G.ResponseError(G.ErrorCodes.MessageWriteError,sr.message?sr.message:"Unknown reason")),o.error("Sending request failed."),sr}})},onRequest:(g,S)=>{xi();let O=null;return fh.is(g)?(O=void 0,d=g):De.string(g)?(O=null,S!==void 0&&(O=g,h.set(g,{handler:S,type:void 0}))):S!==void 0&&(O=g.method,h.set(g.method,{type:g,handler:S})),{dispose:()=>{O!==null&&(O!==void 0?h.get(O)?.handler===S&&h.delete(O):d===g&&(d=void 0))}}},hasPendingResponse:()=>T.size>0,trace:async(g,S,O)=>{let A=!1,fe=jt.Text;O!==void 0&&(De.boolean(O)?A=O:(A=O.sendNotification||!1,fe=O.traceFormat||jt.Text)),C=g,Me=fe,C===pe.Off?de=void 0:de=S,A&&!fy()&&!fo()&&await bn.sendNotification(mh.type,{value:pe.toString(g)})},onError:vn.event,onClose:Ar.event,onUnhandledNotification:lo.event,onDispose:wi.event,end:()=>{t.end()},dispose:()=>{if(fo())return;mt=rr.Disposed,wi.fire(void 0);let g=new G.ResponseError(G.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let S of T.values())S.reject(g);T=new Map,I=new Map,R=new Set,P=new B$.LinkedMap,De.func(t.dispose)&&t.dispose(),De.func(e.dispose)&&e.dispose()},listen:()=>{xi(),mP(),mt=rr.Listening,e.listen(sP)},inspect:()=>{(0,H$.default)().console.log("inspect")}};return bn.onNotification(Xc.type,g=>{if(C===pe.Off||!de)return;let S=C===pe.Verbose||C===pe.Compact;de.log(g.message,S?g.verbose:void 0)}),bn.onNotification(Ms.type,async g=>{let S=y.get(g.token);S?await S(g.value):bi.fire(g)}),bn}});var Or=k(w=>{"use strict";var ZD=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.RequestCancellationReceiverStrategy=w.IdCancellationReceiverStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.TraceValue=w.Trace=void 0;var Se=Zm();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return Se.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return Se.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return Se.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return Se.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return Se.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return Se.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return Se.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return Se.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return Se.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return Se.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return Se.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return Se.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return Se.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return Se.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return Se.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return Se.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return Se.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return Se.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return Se.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return Se.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return Se.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return Se.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return Se.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return Se.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return Se.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return Se.ParameterStructures}});var yh=Fm();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return yh.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return yh.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return yh.Touch}});var LD=M$();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return LD.Disposable}});var G$=Yo();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return G$.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return G$.Emitter}});var K$=Wc();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return K$.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return K$.CancellationToken}});var X$=I$();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return X$.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return X$.SharedArrayReceiverStrategy}});var _h=A$();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return _h.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return _h.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _h.ReadableStreamMessageReader}});var vh=U$();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return vh.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return vh.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return vh.WriteableStreamMessageWriter}});var FD=V$();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return FD.AbstractMessageBuffer}});var Fe=J$();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Fe.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Fe.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Fe.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Fe.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Fe.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Fe.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Fe.Trace}});Object.defineProperty(w,"TraceValue",{enumerable:!0,get:function(){return Fe.TraceValue}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Fe.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Fe.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Fe.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Fe.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Fe.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.CancellationReceiverStrategy}});Object.defineProperty(w,"IdCancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.IdCancellationReceiverStrategy}});Object.defineProperty(w,"RequestCancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.RequestCancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Fe.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Fe.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Fe.MessageStrategy}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Fe.TraceValues}});var UD=ZD(ln());w.RAL=UD.default});var e0=k(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var Y$=mo("util"),Cr=Or(),bh=class e extends Cr.AbstractMessageBuffer{static emptyBuffer=Buffer.allocUnsafe(0);constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,r){return Buffer.from(t,r)}toString(t,r){return t instanceof Buffer?t.toString(r):new Y$.TextDecoder(r).decode(t)}asNative(t,r){return r===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,r):Buffer.from(t,0,r)}allocNative(t){return Buffer.allocUnsafe(t)}},wh=class{stream;constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Cr.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Cr.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Cr.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),Cr.Disposable.create(()=>this.stream.off("data",t))}},xh=class{stream;constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Cr.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Cr.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Cr.Disposable.create(()=>this.stream.off("end",t))}write(t,r){return new Promise((n,o)=>{let i=s=>{s==null?n():o(s)};typeof t=="string"?this.stream.write(t,r,i):this.stream.write(t,i)})}end(){this.stream.end()}},Q$=Object.freeze({messageBuffer:Object.freeze({create:e=>new bh(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Y$.TextDecoder(t.charset).decode(e)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:e=>new wh(e),asWritableStream:e=>new xh(e)}),console,timer:Object.freeze({setTimeout(e,t,...r){let n=setTimeout(e,t,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(e,...t){let r=setImmediate(e,...t);return{dispose:()=>clearImmediate(r)}},setInterval(e,t,...r){let n=setInterval(e,t,...r);return{dispose:()=>clearInterval(n)}}})});function $h(){return Q$}(function(e){function t(){Cr.RAL.install(Q$)}e.install=t})($h||($h={}));Sh.default=$h});var Eh=k(ae=>{"use strict";var r0=ae&&ae.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),VD=ae&&ae.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Rh=ae&&ae.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&r0(r,t,n[o]);return VD(r,t),r}})(),HD=ae&&ae.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&r0(t,e,r)},BD=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ae,"__esModule",{value:!0});ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;ae.generateRandomPipeName=YD;ae.createClientPipeTransport=QD;ae.createServerPipeTransport=eA;ae.createClientSocketTransport=tA;ae.createServerSocketTransport=rA;ae.createMessageConnection=iA;var Ds=BD(e0());Ds.default.install();var WD=Rh(mo("path")),JD=Rh(mo("os")),GD=Rh(mo("fs")),t0=mo("crypto"),iu=mo("net"),Mt=Or();HD(Or(),ae);var kh=class extends Mt.AbstractMessageReader{process;constructor(t){super(),this.process=t;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Mt.Disposable.create(()=>this.process.off("message",t))}};ae.IPCMessageReader=kh;var Ph=class extends Mt.AbstractMessageWriter{process;errorCount;constructor(t){super(),this.process=t,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,t)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){}};ae.IPCMessageWriter=Ph;var Th=class extends Mt.AbstractMessageReader{onData;constructor(t){super(),this.onData=new Mt.Emitter,t.on("close",()=>this.fireClose),t.on("error",r=>this.fireError(r)),t.on("message",r=>{this.onData.fire(r)})}listen(t){return this.onData.event(t)}};ae.PortMessageReader=Th;var zh=class extends Mt.AbstractMessageWriter{port;errorCount;constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",r=>this.fireError(r))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){}};ae.PortMessageWriter=zh;var io=class extends Mt.ReadableStreamMessageReader{constructor(t,r="utf-8"){super((0,Ds.default)().stream.asReadableStream(t),r)}};ae.SocketMessageReader=io;var so=class extends Mt.WriteableStreamMessageWriter{socket;constructor(t,r){super((0,Ds.default)().stream.asWritableStream(t),r),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=so;var nu=class extends Mt.ReadableStreamMessageReader{constructor(t,r){super((0,Ds.default)().stream.asReadableStream(t),r)}};ae.StreamMessageReader=nu;var ou=class extends Mt.WriteableStreamMessageWriter{constructor(t,r){super((0,Ds.default)().stream.asWritableStream(t),r)}};ae.StreamMessageWriter=ou;var KD=process.env.XDG_RUNTIME_DIR,XD=new Map([["linux",107],["darwin",102]]);function YD(){if(process.platform==="win32")return`\\\\.\\pipe\\lsp-${(0,t0.randomBytes)(16).toString("hex")}-sock`;let e=32,t=10,r=GD.realpathSync(KD??JD.tmpdir()),n=XD.get(process.platform);if(n!==void 0&&(e=Math.min(n-r.length-t,e)),e<16)throw new Error(`Unable to generate a random pipe name with ${e} characters.`);let o=(0,t0.randomBytes)(Math.floor(e/2)).toString("hex");return WD.join(r,`lsp-${o}.sock`)}function QD(e,t="utf-8"){let r,n=new Promise((o,i)=>{r=o});return new Promise((o,i)=>{let s=(0,iu.createServer)(a=>{s.close(),r([new io(a,t),new so(a,t)])});s.on("error",i),s.listen(e,()=>{s.removeListener("error",i),o({onConnected:()=>n})})})}function eA(e,t="utf-8"){let r=(0,iu.createConnection)(e);return[new io(r,t),new so(r,t)]}function tA(e,t="utf-8"){let r,n=new Promise((o,i)=>{r=o});return new Promise((o,i)=>{let s=(0,iu.createServer)(a=>{s.close(),r([new io(a,t),new so(a,t)])});s.on("error",i),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",i),o({onConnected:()=>n})})})}function rA(e,t="utf-8"){let r=(0,iu.createConnection)(e,"127.0.0.1");return[new io(r,t),new so(r,t)]}function nA(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function oA(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function iA(e,t,r,n){r||(r=Mt.NullLogger);let o=nA(e)?new nu(e):e,i=oA(t)?new ou(t):t;return Mt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Mt.createMessageConnection)(o,i,r,n)}});var gu={};Ys(gu,{AnnotatedTextEdit:()=>jr,ApplyKind:()=>Yh,ChangeAnnotation:()=>fn,ChangeAnnotationIdentifier:()=>We,CodeAction:()=>mg,CodeActionContext:()=>pg,CodeActionKind:()=>fg,CodeActionTag:()=>fu,CodeActionTriggerKind:()=>Vs,CodeDescription:()=>Zh,CodeLens:()=>hg,Color:()=>au,ColorInformation:()=>Mh,ColorPresentation:()=>Nh,Command:()=>ao,CompletionItem:()=>eg,CompletionItemKind:()=>Wh,CompletionItemLabelDetails:()=>Qh,CompletionItemTag:()=>Gh,CompletionList:()=>tg,CreateFile:()=>oi,DeleteFile:()=>si,Diagnostic:()=>Zs,DiagnosticRelatedInformation:()=>cu,DiagnosticSeverity:()=>Ah,DiagnosticTag:()=>qh,DocumentHighlight:()=>sg,DocumentHighlightKind:()=>ig,DocumentLink:()=>yg,DocumentSymbol:()=>dg,DocumentUri:()=>Oh,EOL:()=>sA,FoldingRange:()=>Dh,FoldingRangeKind:()=>Ih,FormattingOptions:()=>gg,Hover:()=>rg,InlayHint:()=>Pg,InlayHintKind:()=>pu,InlayHintLabelPart:()=>mu,InlineCompletionContext:()=>Og,InlineCompletionItem:()=>Tg,InlineCompletionList:()=>zg,InlineCompletionTriggerKind:()=>Rg,InlineValueContext:()=>kg,InlineValueEvaluatableExpression:()=>Sg,InlineValueText:()=>xg,InlineValueVariableLookup:()=>$g,InsertReplaceEdit:()=>Kh,InsertTextFormat:()=>Jh,InsertTextMode:()=>Xh,LanguageKind:()=>Hh,Location:()=>qs,LocationLink:()=>jh,MarkedString:()=>Us,MarkupContent:()=>pn,MarkupKind:()=>du,OptionalVersionedTextDocumentIdentifier:()=>Fs,ParameterInformation:()=>ng,Position:()=>Ht,Range:()=>Ae,RenameFile:()=>ii,SelectedCompletionInfo:()=>Eg,SelectionRange:()=>_g,SemanticTokenModifiers:()=>bg,SemanticTokenTypes:()=>vg,SemanticTokens:()=>wg,SignatureInformation:()=>og,SnippetTextEdit:()=>Lh,StringValue:()=>hu,SymbolInformation:()=>ug,SymbolKind:()=>ag,SymbolTag:()=>cg,TextDocument:()=>jg,TextDocumentEdit:()=>Ls,TextDocumentIdentifier:()=>Uh,TextDocumentItem:()=>Bh,TextEdit:()=>gr,URI:()=>su,VersionedTextDocumentIdentifier:()=>Vh,WorkspaceChange:()=>Fh,WorkspaceEdit:()=>uu,WorkspaceFolder:()=>Cg,WorkspaceSymbol:()=>lg,integer:()=>Ch,uinteger:()=>As});var Oh,su,Ch,As,Ht,Ae,qs,jh,au,Mh,Nh,Ih,Dh,cu,Ah,qh,Zh,Zs,ao,gr,fn,We,jr,Ls,oi,ii,si,uu,ni,Lh,lu,Fh,Uh,Vh,Fs,Hh,Bh,du,pn,Wh,Jh,Gh,Kh,Xh,Yh,Qh,eg,tg,Us,rg,ng,og,ig,sg,ag,cg,ug,lg,dg,fg,Vs,pg,fu,mg,hg,gg,yg,_g,vg,bg,wg,xg,$g,Sg,kg,pu,mu,Pg,hu,Tg,zg,Rg,Eg,Og,Cg,sA,jg,Mg,_,yu=xP(()=>{"use strict";(function(e){function t(r){return typeof r=="string"}e.is=t})(Oh||(Oh={}));(function(e){function t(r){return typeof r=="string"}e.is=t})(su||(su={}));(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}e.is=t})(Ch||(Ch={}));(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}e.is=t})(As||(As={}));(function(e){function t(n,o){return n===Number.MAX_VALUE&&(n=As.MAX_VALUE),o===Number.MAX_VALUE&&(o=As.MAX_VALUE),{line:n,character:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.uinteger(o.line)&&_.uinteger(o.character)}e.is=r})(Ht||(Ht={}));(function(e){function t(n,o,i,s){if(_.uinteger(n)&&_.uinteger(o)&&_.uinteger(i)&&_.uinteger(s))return{start:Ht.create(n,o),end:Ht.create(i,s)};if(Ht.is(n)&&Ht.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${i}, ${s}]`)}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ht.is(o.start)&&Ht.is(o.end)}e.is=r})(Ae||(Ae={}));(function(e){function t(n,o){return{uri:n,range:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&(_.string(o.uri)||_.undefined(o.uri))}e.is=r})(qs||(qs={}));(function(e){function t(n,o,i,s){return{targetUri:n,targetRange:o,targetSelectionRange:i,originSelectionRange:s}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.targetRange)&&_.string(o.targetUri)&&Ae.is(o.targetSelectionRange)&&(Ae.is(o.originSelectionRange)||_.undefined(o.originSelectionRange))}e.is=r})(jh||(jh={}));(function(e){function t(n,o,i,s){return{red:n,green:o,blue:i,alpha:s}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.numberRange(o.red,0,1)&&_.numberRange(o.green,0,1)&&_.numberRange(o.blue,0,1)&&_.numberRange(o.alpha,0,1)}e.is=r})(au||(au={}));(function(e){function t(n,o){return{range:n,color:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&au.is(o.color)}e.is=r})(Mh||(Mh={}));(function(e){function t(n,o,i){return{label:n,textEdit:o,additionalTextEdits:i}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.string(o.label)&&(_.undefined(o.textEdit)||gr.is(o))&&(_.undefined(o.additionalTextEdits)||_.typedArray(o.additionalTextEdits,gr.is))}e.is=r})(Nh||(Nh={}));(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Ih||(Ih={}));(function(e){function t(n,o,i,s,a,c){let u={startLine:n,endLine:o};return _.defined(i)&&(u.startCharacter=i),_.defined(s)&&(u.endCharacter=s),_.defined(a)&&(u.kind=a),_.defined(c)&&(u.collapsedText=c),u}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.uinteger(o.startLine)&&_.uinteger(o.startLine)&&(_.undefined(o.startCharacter)||_.uinteger(o.startCharacter))&&(_.undefined(o.endCharacter)||_.uinteger(o.endCharacter))&&(_.undefined(o.kind)||_.string(o.kind))}e.is=r})(Dh||(Dh={}));(function(e){function t(n,o){return{location:n,message:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&qs.is(o.location)&&_.string(o.message)}e.is=r})(cu||(cu={}));(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Ah||(Ah={}));(function(e){e.Unnecessary=1,e.Deprecated=2})(qh||(qh={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&_.string(n.href)}e.is=t})(Zh||(Zh={}));(function(e){function t(i,s,a,c,u,l){let d={range:i,message:s};return _.defined(a)&&(d.severity=a),_.defined(c)&&(d.code=c),_.defined(u)&&(d.source=u),_.defined(l)&&(d.relatedInformation=l),d}e.create=t;function r(i){var s;let a=i;return _.defined(a)&&Ae.is(a.range)&&(_.string(a.message)||pn.is(a.message))&&(_.number(a.severity)||_.undefined(a.severity))&&(_.integer(a.code)||_.string(a.code)||_.undefined(a.code))&&(_.undefined(a.codeDescription)||_.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(_.string(a.source)||_.undefined(a.source))&&(_.undefined(a.relatedInformation)||_.typedArray(a.relatedInformation,cu.is))}e.is=r;function n(i){return _.string(i.message)}e.is3_17=n;function o(i){if(_.string(i.message))return i.message;if(pn.is(i.message))return i.message.value;throw new Error(`Unknown message type ${typeof i.message}`)}e.getMessageString=o})(Zs||(Zs={}));(function(e){function t(n,o,...i){let s={title:n,command:o};return _.defined(i)&&i.length>0&&(s.arguments=i),s}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.title)&&(o.tooltip===void 0||_.string(o.tooltip))&&_.string(o.command)}e.is=r})(ao||(ao={}));(function(e){function t(i,s){return{range:i,newText:s}}e.replace=t;function r(i,s){return{range:{start:i,end:i},newText:s}}e.insert=r;function n(i){return{range:i,newText:""}}e.del=n;function o(i){let s=i;return _.objectLiteral(s)&&_.string(s.newText)&&Ae.is(s.range)}e.is=o})(gr||(gr={}));(function(e){function t(n,o,i){let s={label:n};return o!==void 0&&(s.needsConfirmation=o),i!==void 0&&(s.description=i),s}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.string(o.label)&&(_.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(_.string(o.description)||o.description===void 0)}e.is=r})(fn||(fn={}));(function(e){function t(r){let n=r;return _.string(n)}e.is=t})(We||(We={}));(function(e){function t(i,s,a){return{range:i,newText:s,annotationId:a}}e.replace=t;function r(i,s,a){return{range:{start:i,end:i},newText:s,annotationId:a}}e.insert=r;function n(i,s){return{range:i,newText:"",annotationId:s}}e.del=n;function o(i){let s=i;return gr.is(s)&&(fn.is(s.annotationId)||We.is(s.annotationId))}e.is=o})(jr||(jr={}));(function(e){function t(n,o){return{textDocument:n,edits:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&Fs.is(o.textDocument)&&Array.isArray(o.edits)}e.is=r})(Ls||(Ls={}));(function(e){function t(n,o,i){let s={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(s.options=o),i!==void 0&&(s.annotationId=i),s}e.create=t;function r(n){let o=n;return o&&o.kind==="create"&&_.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||_.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||_.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(oi||(oi={}));(function(e){function t(n,o,i,s){let a={kind:"rename",oldUri:n,newUri:o};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}e.create=t;function r(n){let o=n;return o&&o.kind==="rename"&&_.string(o.oldUri)&&_.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||_.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||_.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(ii||(ii={}));(function(e){function t(n,o,i){let s={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(s.options=o),i!==void 0&&(s.annotationId=i),s}e.create=t;function r(n){let o=n;return o&&o.kind==="delete"&&_.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||_.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||_.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(si||(si={}));(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>_.string(o.kind)?oi.is(o)||ii.is(o)||si.is(o):Ls.is(o)))}e.is=t})(uu||(uu={}));ni=class{constructor(t,r){this.edits=t,this.changeAnnotations=r}insert(t,r,n){let o,i;if(n===void 0?o=gr.insert(t,r):We.is(n)?(i=n,o=jr.insert(t,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),o=jr.insert(t,r,i)),this.edits.push(o),i!==void 0)return i}replace(t,r,n){let o,i;if(n===void 0?o=gr.replace(t,r):We.is(n)?(i=n,o=jr.replace(t,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),o=jr.replace(t,r,i)),this.edits.push(o),i!==void 0)return i}delete(t,r){let n,o;if(r===void 0?n=gr.del(t):We.is(r)?(o=r,n=jr.del(t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=jr.del(t,o)),this.edits.push(n),o!==void 0)return o}add(t){this.edits.push(t)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(t){if(t===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}};(function(e){function t(r){let n=r;return _.objectLiteral(n)&&Ae.is(n.range)&&hu.isSnippet(n.snippet)&&(n.annotationId===void 0||fn.is(n.annotationId)||We.is(n.annotationId))}e.is=t})(Lh||(Lh={}));lu=class{constructor(t){this._annotations=t===void 0?Object.create(null):t,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(t,r){let n;if(We.is(t)?n=t:(n=this.nextId(),r=t),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Fh=class{constructor(t){this._textEditChanges=Object.create(null),t!==void 0?(this._workspaceEdit=t,t.documentChanges?(this._changeAnnotations=new lu(t.changeAnnotations),t.changeAnnotations=this._changeAnnotations.all(),t.documentChanges.forEach(r=>{if(Ls.is(r)){let n=new ni(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):t.changes&&Object.keys(t.changes).forEach(r=>{let n=new ni(t.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(t){if(Fs.is(t)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:t.uri,version:t.version},n=this._textEditChanges[r.uri];if(!n){let o=[],i={textDocument:r,edits:o};this._workspaceEdit.documentChanges.push(i),n=new ni(o,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[t];if(!r){let n=[];this._workspaceEdit.changes[t]=n,r=new ni(n),this._textEditChanges[t]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lu,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;fn.is(r)||We.is(r)?o=r:n=r;let i,s;if(o===void 0?i=oi.create(t,n):(s=We.is(o)?o:this._changeAnnotations.manage(o),i=oi.create(t,n,s)),this._workspaceEdit.documentChanges.push(i),s!==void 0)return s}renameFile(t,r,n,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;fn.is(n)||We.is(n)?i=n:o=n;let s,a;if(i===void 0?s=ii.create(t,r,o):(a=We.is(i)?i:this._changeAnnotations.manage(i),s=ii.create(t,r,o,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;fn.is(r)||We.is(r)?o=r:n=r;let i,s;if(o===void 0?i=si.create(t,n):(s=We.is(o)?o:this._changeAnnotations.manage(o),i=si.create(t,n,s)),this._workspaceEdit.documentChanges.push(i),s!==void 0)return s}};(function(e){function t(n){return{uri:n}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)}e.is=r})(Uh||(Uh={}));(function(e){function t(n,o){return{uri:n,version:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&_.integer(o.version)}e.is=r})(Vh||(Vh={}));(function(e){function t(n,o){return{uri:n,version:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&(o.version===null||_.integer(o.version))}e.is=r})(Fs||(Fs={}));(function(e){e.ABAP="abap",e.WindowsBat="bat",e.BibTeX="bibtex",e.Clojure="clojure",e.Coffeescript="coffeescript",e.C="c",e.CPP="cpp",e.CSharp="csharp",e.CSS="css",e.D="d",e.Delphi="pascal",e.Diff="diff",e.Dart="dart",e.Dockerfile="dockerfile",e.Elixir="elixir",e.Erlang="erlang",e.FSharp="fsharp",e.GitCommit="git-commit",e.GitRebase="git-rebase",e.Go="go",e.Groovy="groovy",e.Handlebars="handlebars",e.Haskell="haskell",e.HTML="html",e.Ini="ini",e.Java="java",e.JavaScript="javascript",e.JavaScriptReact="javascriptreact",e.JSON="json",e.LaTeX="latex",e.Less="less",e.Lua="lua",e.Makefile="makefile",e.Markdown="markdown",e.ObjectiveC="objective-c",e.ObjectiveCPP="objective-cpp",e.Pascal="pascal",e.Perl="perl",e.Perl6="perl6",e.PHP="php",e.Plaintext="plaintext",e.Powershell="powershell",e.Pug="jade",e.Python="python",e.R="r",e.Razor="razor",e.Ruby="ruby",e.Rust="rust",e.SCSS="scss",e.SASS="sass",e.Scala="scala",e.ShaderLab="shaderlab",e.ShellScript="shellscript",e.SQL="sql",e.Swift="swift",e.TypeScript="typescript",e.TypeScriptReact="typescriptreact",e.TeX="tex",e.VisualBasic="vb",e.XML="xml",e.XSL="xsl",e.YAML="yaml"})(Hh||(Hh={}));(function(e){function t(n,o,i,s){return{uri:n,languageId:o,version:i,text:s}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&_.string(o.languageId)&&_.integer(o.version)&&_.string(o.text)}e.is=r})(Bh||(Bh={}));(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){let n=r;return n===e.PlainText||n===e.Markdown}e.is=t})(du||(du={}));(function(e){function t(r){let n=r;return _.objectLiteral(r)&&du.is(n.kind)&&_.string(n.value)}e.is=t})(pn||(pn={}));(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Wh||(Wh={}));(function(e){e.PlainText=1,e.Snippet=2})(Jh||(Jh={}));(function(e){e.Deprecated=1})(Gh||(Gh={}));(function(e){function t(n,o,i){return{newText:n,insert:o,replace:i}}e.create=t;function r(n){let o=n;return o&&_.string(o.newText)&&Ae.is(o.insert)&&Ae.is(o.replace)}e.is=r})(Kh||(Kh={}));(function(e){e.asIs=1,e.adjustIndentation=2})(Xh||(Xh={}));(function(e){e.Replace=1,e.Merge=2})(Yh||(Yh={}));(function(e){function t(r){let n=r;return n&&(_.string(n.detail)||n.detail===void 0)&&(_.string(n.description)||n.description===void 0)}e.is=t})(Qh||(Qh={}));(function(e){function t(r){return{label:r}}e.create=t})(eg||(eg={}));(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}e.create=t})(tg||(tg={}));(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function r(n){let o=n;return _.string(o)||_.objectLiteral(o)&&_.string(o.language)&&_.string(o.value)}e.is=r})(Us||(Us={}));(function(e){function t(r){let n=r;return!!n&&_.objectLiteral(n)&&(pn.is(n.contents)||Us.is(n.contents)||_.typedArray(n.contents,Us.is))&&(r.range===void 0||Ae.is(r.range))}e.is=t})(rg||(rg={}));(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}e.create=t})(ng||(ng={}));(function(e){function t(r,n,...o){let i={label:r};return _.defined(n)&&(i.documentation=n),_.defined(o)?i.parameters=o:i.parameters=[],i}e.create=t})(og||(og={}));(function(e){e.Text=1,e.Read=2,e.Write=3})(ig||(ig={}));(function(e){function t(r,n){let o={range:r};return _.number(n)&&(o.kind=n),o}e.create=t})(sg||(sg={}));(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(ag||(ag={}));(function(e){e.Deprecated=1})(cg||(cg={}));(function(e){function t(r,n,o,i,s){let a={name:r,kind:n,location:{uri:i,range:o}};return s&&(a.containerName=s),a}e.create=t})(ug||(ug={}));(function(e){function t(r,n,o,i){return i!==void 0?{name:r,kind:n,location:{uri:o,range:i}}:{name:r,kind:n,location:{uri:o}}}e.create=t})(lg||(lg={}));(function(e){function t(n,o,i,s,a,c){let u={name:n,detail:o,kind:i,range:s,selectionRange:a};return c!==void 0&&(u.children=c),u}e.create=t;function r(n){let o=n;return o&&_.string(o.name)&&_.number(o.kind)&&Ae.is(o.range)&&Ae.is(o.selectionRange)&&(o.detail===void 0||_.string(o.detail))&&(o.deprecated===void 0||_.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}e.is=r})(dg||(dg={}));(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorMove="refactor.move",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll",e.Notebook="notebook"})(fg||(fg={}));(function(e){e.Invoked=1,e.Automatic=2})(Vs||(Vs={}));(function(e){function t(n,o,i){let s={diagnostics:n};return o!=null&&(s.only=o),i!=null&&(s.triggerKind=i),s}e.create=t;function r(n){let o=n;return _.defined(o)&&_.typedArray(o.diagnostics,Zs.is)&&(o.only===void 0||_.typedArray(o.only,_.string))&&(o.triggerKind===void 0||o.triggerKind===Vs.Invoked||o.triggerKind===Vs.Automatic)}e.is=r})(pg||(pg={}));(function(e){e.LLMGenerated=1;function t(r){return _.defined(r)&&r===e.LLMGenerated}e.is=t})(fu||(fu={}));(function(e){function t(n,o,i){let s={title:n},a=!0;return typeof o=="string"?(a=!1,s.kind=o):ao.is(o)?s.command=o:s.edit=o,a&&i!==void 0&&(s.kind=i),s}e.create=t;function r(n){let o=n;return o&&_.string(o.title)&&(o.diagnostics===void 0||_.typedArray(o.diagnostics,Zs.is))&&(o.kind===void 0||_.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||ao.is(o.command))&&(o.isPreferred===void 0||_.boolean(o.isPreferred))&&(o.edit===void 0||uu.is(o.edit))&&(o.tags===void 0||_.typedArray(o.tags,fu.is))}e.is=r})(mg||(mg={}));(function(e){function t(n,o){let i={range:n};return _.defined(o)&&(i.data=o),i}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(o.range)&&(_.undefined(o.command)||ao.is(o.command))}e.is=r})(hg||(hg={}));(function(e){function t(n,o){return{tabSize:n,insertSpaces:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.uinteger(o.tabSize)&&_.boolean(o.insertSpaces)}e.is=r})(gg||(gg={}));(function(e){function t(n,o,i){return{range:n,target:o,data:i}}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(o.range)&&(_.undefined(o.target)||_.string(o.target))}e.is=r})(yg||(yg={}));(function(e){function t(n,o){return{range:n,parent:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&(o.parent===void 0||e.is(o.parent))}e.is=r})(_g||(_g={}));(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator",e.label="label"})(vg||(vg={}));(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(bg||(bg={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}e.is=t})(wg||(wg={}));(function(e){function t(n,o){return{range:n,text:o}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&_.string(o.text)}e.is=r})(xg||(xg={}));(function(e){function t(n,o,i){return{range:n,variableName:o,caseSensitiveLookup:i}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&_.boolean(o.caseSensitiveLookup)&&(_.string(o.variableName)||o.variableName===void 0)}e.is=r})($g||($g={}));(function(e){function t(n,o){return{range:n,expression:o}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&(_.string(o.expression)||o.expression===void 0)}e.is=r})(Sg||(Sg={}));(function(e){function t(n,o){return{frameId:n,stoppedLocation:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(n.stoppedLocation)}e.is=r})(kg||(kg={}));(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}e.is=t})(pu||(pu={}));(function(e){function t(n){return{value:n}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&(o.tooltip===void 0||_.string(o.tooltip)||pn.is(o.tooltip))&&(o.location===void 0||qs.is(o.location))&&(o.command===void 0||ao.is(o.command))}e.is=r})(mu||(mu={}));(function(e){function t(n,o,i){let s={position:n,label:o};return i!==void 0&&(s.kind=i),s}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ht.is(o.position)&&(_.string(o.label)||_.typedArray(o.label,mu.is))&&(o.kind===void 0||pu.is(o.kind))&&o.textEdits===void 0||_.typedArray(o.textEdits,gr.is)&&(o.tooltip===void 0||_.string(o.tooltip)||pn.is(o.tooltip))&&(o.paddingLeft===void 0||_.boolean(o.paddingLeft))&&(o.paddingRight===void 0||_.boolean(o.paddingRight))}e.is=r})(Pg||(Pg={}));(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t;function r(n){let o=n;return _.objectLiteral(o)&&o.kind==="snippet"&&_.string(o.value)}e.isSnippet=r})(hu||(hu={}));(function(e){function t(r,n,o,i){return{insertText:r,filterText:n,range:o,command:i}}e.create=t})(Tg||(Tg={}));(function(e){function t(r){return{items:r}}e.create=t})(zg||(zg={}));(function(e){e.Invoked=1,e.Automatic=2})(Rg||(Rg={}));(function(e){function t(r,n){return{range:r,text:n}}e.create=t})(Eg||(Eg={}));(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}e.create=t})(Og||(Og={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&su.is(n.uri)&&_.string(n.name)}e.is=t})(Cg||(Cg={}));sA=[`
10
+ deps: ${r}}`};var eM={keyword:"dependencies",type:"object",schemaType:"object",error:pr.error,code(e){let[t,r]=tM(e);_x(e,t),vx(e,r)}};function tM({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 _x(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,Ts.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,Ts.checkReportMissingProp)(e,u)}):(r.if((0,Dp._)`${c} && (${(0,Ts.checkMissingProp)(e,a,i)})`),(0,Ts.reportMissingProp)(e,i),r.else())}}pr.validatePropertyDeps=_x;function vx(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,QI.alwaysValidSchema)(i,t[a])||(r.if((0,Ts.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))}pr.validateSchemaDeps=vx;pr.default=eM});var xx=k(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var wx=Q(),rM=ce(),nM={message:"property name must be valid",params:({params:e})=>(0,wx._)`{propertyName: ${e.propertyName}}`},oM={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:nM,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,rM.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,wx.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};Ap.default=oM});var Zp=k(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var Tc=Ft(),er=Q(),iM=Rr(),Rc=ce(),sM={message:"must NOT have additional properties",params:({params:e})=>(0,er._)`{additionalProperty: ${e.additionalProperty}}`},aM={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:sM,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,Rc.alwaysValidSchema)(s,r))return;let u=(0,Tc.allSchemaProperties)(n.properties),l=(0,Tc.allSchemaProperties)(n.patternProperties);d(),e.ok((0,er._)`${i} === ${iM.default.errors}`);function d(){t.forIn("key",o,v=>{!u.length&&!l.length?p(v):t.if(h(v),()=>p(v))})}function h(v){let P;if(u.length>8){let T=(0,Rc.schemaRefOrVal)(s,n.properties,"properties");P=(0,Tc.isOwnProperty)(t,T,v)}else u.length?P=(0,er.or)(...u.map(T=>(0,er._)`${v} === ${T}`)):P=er.nil;return l.length&&(P=(0,er.or)(P,...l.map(T=>(0,er._)`${(0,Tc.usePattern)(e,T)}.test(${v})`))),(0,er.not)(P)}function m(v){t.code((0,er._)`delete ${o}[${v}]`)}function p(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Rc.alwaysValidSchema)(s,r)){let P=t.name("valid");c.removeAdditional==="failing"?(y(v,P,!1),t.if((0,er.not)(P),()=>{e.reset(),m(v)})):(y(v,P),a||t.if((0,er.not)(P),()=>t.break()))}}function y(v,P,T){let z={keyword:"additionalProperties",dataProp:v,dataPropType:Rc.Type.Str};T===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(z,P)}}};qp.default=aM});var kx=k(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});var cM=ps(),$x=Ft(),Lp=ce(),Sx=Zp(),uM={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&&Sx.default.code(new cM.KeywordCxt(i,Sx.default,"additionalProperties"));let s=(0,$x.allSchemaProperties)(r);for(let d of s)i.definedProperties.add(d);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Lp.mergeEvaluated.props(t,(0,Lp.toHash)(s),i.props));let a=s.filter(d=>!(0,Lp.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,$x.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)}}};Fp.default=uM});var zx=k(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var Px=Ft(),zc=Q(),Tx=ce(),Rx=ce(),lM={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,Px.allSchemaProperties)(r),c=a.filter(y=>(0,Tx.alwaysValidSchema)(i,r[y]));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 zc.Name)&&(i.props=(0,Rx.evaluatedPropsToName)(t,i.props));let{props:d}=i;h();function h(){for(let y of a)u&&m(y),i.allErrors?p(y):(t.var(l,!0),p(y),t.if(l))}function m(y){for(let v in u)new RegExp(y).test(v)&&(0,Tx.checkStrictMode)(i,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function p(y){t.forIn("key",n,v=>{t.if((0,zc._)`${(0,Px.usePattern)(e,y)}.test(${v})`,()=>{let P=c.includes(y);P||e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:Rx.Type.Str},l),i.opts.unevaluated&&d!==!0?t.assign((0,zc._)`${d}[${v}]`,!0):!P&&!i.allErrors&&t.if((0,zc.not)(l),()=>t.break())})})}}};Up.default=lM});var Ex=k(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var dM=ce(),fM={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,dM.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"}};Vp.default=fM});var Ox=k(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});var pM=Ft(),mM={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pM.validateUnion,error:{message:"must match a schema in anyOf"}};Hp.default=mM});var Cx=k(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});var Ec=Q(),hM=ce(),gM={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ec._)`{passingSchemas: ${e.passing}}`},yM={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:gM,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 h;(0,hM.alwaysValidSchema)(o,l)?t.var(c,!0):h=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Ec._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Ec._)`[${a}, ${d}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,d),h&&e.mergeEvaluated(h,Ec.Name)})})}}};Bp.default=yM});var jx=k(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var _M=ce(),vM={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,_M.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};Wp.default=vM});var Mx=k(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var Oc=Q(),Ix=ce(),bM={message:({params:e})=>(0,Oc.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Oc._)`{failingKeyword: ${e.ifClause}}`},wM={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:bM,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Ix.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Nx(n,"then"),i=Nx(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,Oc.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 h=e.subschema({keyword:l},a);t.assign(s,a),e.mergeValidEvaluated(h,s),d?t.assign(d,(0,Oc._)`${l}`):e.setParams({ifClause:l})}}}};function Nx(e,t){let r=e.schema[t];return r!==void 0&&!(0,Ix.alwaysValidSchema)(e,r)}Jp.default=wM});var Dx=k(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});var xM=ce(),$M={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,xM.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Gp.default=$M});var Ax=k(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});var SM=Cp(),kM=mx(),PM=jp(),TM=gx(),RM=yx(),zM=bx(),EM=xx(),OM=Zp(),CM=kx(),jM=zx(),NM=Ex(),IM=Ox(),MM=Cx(),DM=jx(),AM=Mx(),qM=Dx();function ZM(e=!1){let t=[NM.default,IM.default,MM.default,DM.default,AM.default,qM.default,EM.default,OM.default,zM.default,CM.default,jM.default];return e?t.push(kM.default,TM.default):t.push(SM.default,PM.default),t.push(RM.default),t}Kp.default=ZM});var qx=k(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Le=Q(),LM={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},FM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:LM,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?h():m();function h(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),y=r.const("fDef",(0,Le._)`${p}[${s}]`),v=r.let("fType"),P=r.let("format");r.if((0,Le._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(v,(0,Le._)`${y}.type || "string"`).assign(P,(0,Le._)`${y}.validate`),()=>r.assign(v,(0,Le._)`"string"`).assign(P,y)),e.fail$data((0,Le.or)(T(),z()));function T(){return c.strictSchema===!1?Le.nil:(0,Le._)`${s} && !${P}`}function z(){let M=l.$async?(0,Le._)`(${y}.async ? await ${P}(${n}) : ${P}(${n}))`:(0,Le._)`${P}(${n})`,C=(0,Le._)`(typeof ${P} == "function" ? ${M} : ${P}.test(${n}))`;return(0,Le._)`${P} && ${P} !== true && ${v} === ${t} && !${C}`}}function m(){let p=d.formats[i];if(!p){T();return}if(p===!0)return;let[y,v,P]=z(p);y===t&&e.pass(M());function T(){if(c.strictSchema===!1){d.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function z(C){let Ne=C instanceof RegExp?(0,Le.regexpCode)(C):c.code.formats?(0,Le._)`${c.code.formats}${(0,Le.getProperty)(i)}`:void 0,de=r.scopeValue("formats",{key:i,ref:C,code:Ne});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,Le._)`${de}.validate`]:["string",C,de]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${P}(${n})`}return typeof v=="function"?(0,Le._)`${P}(${n})`:(0,Le._)`${P}.test(${n})`}}}};Xp.default=FM});var Zx=k(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});var UM=qx(),VM=[UM.default];Yp.default=VM});var Lx=k(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.contentVocabulary=Ho.metadataVocabulary=void 0;Ho.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ho.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Ux=k(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});var HM=Kw(),BM=lx(),WM=Ax(),JM=Zx(),Fx=Lx(),GM=[HM.default,BM.default,(0,WM.default)(),JM.default,Fx.metadataVocabulary,Fx.contentVocabulary];Qp.default=GM});var Hx=k(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.DiscrError=void 0;var Vx;(function(e){e.Tag="tag",e.Mapping="mapping"})(Vx||(Cc.DiscrError=Vx={}))});var Wx=k(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var Bo=Q(),em=Hx(),Bx=hc(),KM=ms(),XM=ce(),YM={message:({params:{discrError:e,tagName:t}})=>e===em.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Bo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},QM={keyword:"discriminator",type:"object",schemaType:"object",error:YM,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,Bo._)`${r}${(0,Bo.getProperty)(a)}`);t.if((0,Bo._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:em.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let m=h();t.if(!1);for(let p in m)t.elseIf((0,Bo._)`${u} === ${p}`),t.assign(c,d(m[p]));t.else(),e.error(!1,{discrError:em.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function d(m){let p=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:m},p);return e.mergeEvaluated(y,Bo.Name),p}function h(){var m;let p={},y=P(o),v=!0;for(let M=0;M<s.length;M++){let C=s[M];if(C?.$ref&&!(0,XM.schemaHasRulesButRef)(C,i.self.RULES)){let de=C.$ref;if(C=Bx.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,de),C instanceof Bx.SchemaEnv&&(C=C.schema),C===void 0)throw new KM.default(i.opts.uriResolver,i.baseId,de)}let Ne=(m=C?.properties)===null||m===void 0?void 0:m[a];if(typeof Ne!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(y||P(C)),T(Ne,M)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return p;function P({required:M}){return Array.isArray(M)&&M.includes(a)}function T(M,C){if(M.const)z(M.const,C);else if(M.enum)for(let Ne of M.enum)z(Ne,C);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function z(M,C){if(typeof M!="string"||M in p)throw new Error(`discriminator: "${a}" values must be unique strings`);p[M]=C}}}};tm.default=QM});var Jx=k((wF,e1)=>{e1.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 nm=k((Te,rm)=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.MissingRefError=Te.ValidationError=Te.CodeGen=Te.Name=Te.nil=Te.stringify=Te.str=Te._=Te.KeywordCxt=Te.Ajv=void 0;var t1=Vw(),r1=Ux(),n1=Wx(),Gx=Jx(),o1=["/properties"],jc="http://json-schema.org/draft-07/schema",Wo=class extends t1.default{_addVocabularies(){super._addVocabularies(),r1.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(n1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(Gx,o1):Gx;this.addMetaSchema(t,jc,!1),this.refs["http://json-schema.org/schema"]=jc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(jc)?jc:void 0)}};Te.Ajv=Wo;rm.exports=Te=Wo;rm.exports.Ajv=Wo;Object.defineProperty(Te,"__esModule",{value:!0});Te.default=Wo;var i1=ps();Object.defineProperty(Te,"KeywordCxt",{enumerable:!0,get:function(){return i1.KeywordCxt}});var Jo=Q();Object.defineProperty(Te,"_",{enumerable:!0,get:function(){return Jo._}});Object.defineProperty(Te,"str",{enumerable:!0,get:function(){return Jo.str}});Object.defineProperty(Te,"stringify",{enumerable:!0,get:function(){return Jo.stringify}});Object.defineProperty(Te,"nil",{enumerable:!0,get:function(){return Jo.nil}});Object.defineProperty(Te,"Name",{enumerable:!0,get:function(){return Jo.Name}});Object.defineProperty(Te,"CodeGen",{enumerable:!0,get:function(){return Jo.CodeGen}});var s1=pc();Object.defineProperty(Te,"ValidationError",{enumerable:!0,get:function(){return s1.default}});var a1=ms();Object.defineProperty(Te,"MissingRefError",{enumerable:!0,get:function(){return a1.default}})});var n$=k(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.formatNames=hr.fastFormats=hr.fullFormats=void 0;function mr(e,t){return{validate:e,compare:t}}hr.fullFormats={date:mr(Qx,am),time:mr(im(!0),cm),"date-time":mr(Kx(!0),t$),"iso-time":mr(im(),e$),"iso-date-time":mr(Kx(),r$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p1,"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:b1,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:m1,int32:{type:"number",validate:y1},int64:{type:"number",validate:_1},float:{type:"number",validate:Yx},double:{type:"number",validate:Yx},password:!0,binary:!0};hr.fastFormats={...hr.fullFormats,date:mr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,am),time:mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,cm),"date-time":mr(/^\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,t$),"iso-time":mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,e$),"iso-date-time":mr(/^\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,r$),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};hr.formatNames=Object.keys(hr.fullFormats);function c1(e){return e%4===0&&(e%100!==0||e%400===0)}var u1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,l1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Qx(e){let t=u1.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&&c1(r)?29:l1[n])}function am(e,t){if(e&&t)return e>t?1:e<t?-1:0}var om=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function im(e){return function(r){let n=om.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,h=o-u*c-(d<0?1:0);return(h===23||h===-1)&&(d===59||d===-1)&&s<61}}function cm(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 e$(e,t){if(!(e&&t))return;let r=om.exec(e),n=om.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 sm=/t|\s/i;function Kx(e){let t=im(e);return function(n){let o=n.split(sm);return o.length===2&&Qx(o[0])&&t(o[1])}}function t$(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function r$(e,t){if(!(e&&t))return;let[r,n]=e.split(sm),[o,i]=t.split(sm),s=am(r,o);if(s!==void 0)return s||cm(n,i)}var d1=/\/|:/,f1=/^(?:[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 p1(e){return d1.test(e)&&f1.test(e)}var Xx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m1(e){return Xx.lastIndex=0,Xx.test(e)}var h1=-(2**31),g1=2**31-1;function y1(e){return Number.isInteger(e)&&e<=g1&&e>=h1}function _1(e){return Number.isInteger(e)}function Yx(){return!0}var v1=/[^\\]\\Z/;function b1(e){if(v1.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var o$=k(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.formatLimitDefinition=void 0;var w1=nm(),tr=Q(),on=tr.operators,Nc={formatMaximum:{okStr:"<=",ok:on.LTE,fail:on.GT},formatMinimum:{okStr:">=",ok:on.GTE,fail:on.LT},formatExclusiveMaximum:{okStr:"<",ok:on.LT,fail:on.GTE},formatExclusiveMinimum:{okStr:">",ok:on.GT,fail:on.LTE}},x1={message:({keyword:e,schemaCode:t})=>(0,tr.str)`should be ${Nc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,tr._)`{comparison: ${Nc[e].okStr}, limit: ${t}}`};Go.formatLimitDefinition={keyword:Object.keys(Nc),type:"string",schemaType:"string",$data:!0,error:x1,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 w1.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),m=t.const("fmt",(0,tr._)`${h}[${c.schemaCode}]`);e.fail$data((0,tr.or)((0,tr._)`typeof ${m} != "object"`,(0,tr._)`${m} instanceof RegExp`,(0,tr._)`typeof ${m}.compare != "function"`,d(m)))}function l(){let h=c.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${o}": format "${h}" does not define "compare" function`);let p=t.scopeValue("formats",{key:h,ref:m,code:s.code.formats?(0,tr._)`${s.code.formats}${(0,tr.getProperty)(h)}`:void 0});e.fail$data(d(p))}function d(h){return(0,tr._)`${h}.compare(${r}, ${n}) ${Nc[o].fail} 0`}},dependencies:["format"]};var $1=e=>(e.addKeyword(Go.formatLimitDefinition),e);Go.default=$1});var c$=k((Rs,a$)=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});var Ko=n$(),S1=o$(),um=Q(),i$=new um.Name("fullFormats"),k1=new um.Name("fastFormats"),lm=(e,t={keywords:!0})=>{if(Array.isArray(t))return s$(e,t,Ko.fullFormats,i$),e;let[r,n]=t.mode==="fast"?[Ko.fastFormats,k1]:[Ko.fullFormats,i$],o=t.formats||Ko.formatNames;return s$(e,o,r,n),t.keywords&&(0,S1.default)(e),e};lm.get=(e,t="full")=>{let n=(t==="fast"?Ko.fastFormats:Ko.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function s$(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,um._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}a$.exports=Rs=lm;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.default=lm});var Yo=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.boolean=sD;Er.string=j$;Er.number=aD;Er.error=cD;Er.func=uD;Er.array=N$;Er.stringArray=lD;function sD(e){return e===!0||e===!1}function j$(e){return typeof e=="string"||e instanceof String}function aD(e){return typeof e=="number"||e instanceof Number}function cD(e){return e instanceof Error}function uD(e){return typeof e=="function"}function N$(e){return Array.isArray(e)}function lD(e){return N$(e)&&e.every(t=>j$(t))}});var Fm=k(D=>{"use strict";var dD=D&&D.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),fD=D&&D.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),pD=D&&D.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&dD(r,t,n[o]);return fD(r,t),r}})();Object.defineProperty(D,"__esModule",{value:!0});D.Message=D.NotificationType9=D.NotificationType8=D.NotificationType7=D.NotificationType6=D.NotificationType5=D.NotificationType4=D.NotificationType3=D.NotificationType2=D.NotificationType1=D.NotificationType0=D.NotificationType=D.RequestType9=D.RequestType8=D.RequestType7=D.RequestType6=D.RequestType5=D.RequestType4=D.RequestType3=D.RequestType2=D.RequestType1=D.RequestType=D.RequestType0=D.AbstractMessageSignature=D.ParameterStructures=D.ResponseError=D.ErrorCodes=void 0;var io=pD(Yo()),_m;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(_m||(D.ErrorCodes=_m={}));var vm=class e extends Error{code;data;constructor(t,r,n){super(r),this.code=io.number(t)?t:_m.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};D.ResponseError=vm;var cn=class e{kind;static auto=new e("auto");static byPosition=new e("byPosition");static byName=new e("byName");constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};D.ParameterStructures=cn;var Re=class{method;numberOfParams;constructor(t,r){this.method=t,this.numberOfParams=r}get parameterStructures(){return cn.auto}};D.AbstractMessageSignature=Re;var bm=class extends Re{_;constructor(t){super(t,0)}};D.RequestType0=bm;var wm=class extends Re{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.RequestType=wm;var xm=class extends Re{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.RequestType1=xm;var $m=class extends Re{_;constructor(t){super(t,2)}};D.RequestType2=$m;var Sm=class extends Re{_;constructor(t){super(t,3)}};D.RequestType3=Sm;var km=class extends Re{_;constructor(t){super(t,4)}};D.RequestType4=km;var Pm=class extends Re{_;constructor(t){super(t,5)}};D.RequestType5=Pm;var Tm=class extends Re{_;constructor(t){super(t,6)}};D.RequestType6=Tm;var Rm=class extends Re{_;constructor(t){super(t,7)}};D.RequestType7=Rm;var zm=class extends Re{_;constructor(t){super(t,8)}};D.RequestType8=zm;var Em=class extends Re{_;constructor(t){super(t,9)}};D.RequestType9=Em;var Om=class extends Re{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.NotificationType=Om;var Cm=class extends Re{_;constructor(t){super(t,0)}};D.NotificationType0=Cm;var jm=class extends Re{_parameterStructures;_;constructor(t,r=cn.auto){super(t,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};D.NotificationType1=jm;var Nm=class extends Re{_;constructor(t){super(t,2)}};D.NotificationType2=Nm;var Im=class extends Re{_;constructor(t){super(t,3)}};D.NotificationType3=Im;var Mm=class extends Re{_;constructor(t){super(t,4)}};D.NotificationType4=Mm;var Dm=class extends Re{_;constructor(t){super(t,5)}};D.NotificationType5=Dm;var Am=class extends Re{_;constructor(t){super(t,6)}};D.NotificationType6=Am;var qm=class extends Re{_;constructor(t){super(t,7)}};D.NotificationType7=qm;var Zm=class extends Re{_;constructor(t){super(t,8)}};D.NotificationType8=Zm;var Lm=class extends Re{_;constructor(t){super(t,9)}};D.NotificationType9=Lm;var I$;(function(e){function t(o){let i=o;return i&&io.string(i.method)&&(io.string(i.id)||io.number(i.id))}e.isRequest=t;function r(o){let i=o;return i&&io.string(i.method)&&o.id===void 0}e.isNotification=r;function n(o){let i=o;return i&&(i.result!==void 0||!!i.error)&&(io.string(i.id)||io.number(i.id)||i.id===null)}e.isResponse=n})(I$||(D.Message=I$={}))});var Vm=k(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.LRUCache=un.LinkedMap=un.Touch=void 0;var ct;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(ct||(un.Touch=ct={}));var Vc=class{[Symbol.toStringTag]="LinkedMap";_map;_head;_tail;_size;_state;constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}before(t){let r=this._map.get(t);return r?r.previous?.value:void 0}after(t){let r=this._map.get(t);return r?r.next?.value:void 0}has(t){return this._map.has(t)}get(t,r=ct.None){let n=this._map.get(t);if(n)return r!==ct.None&&this.touch(n,r),n.value}set(t,r,n=ct.None){let o=this._map.get(t);if(o)o.value=r,n!==ct.None&&this.touch(o,n);else{switch(o={key:t,value:r,next:void 0,previous:void 0},n){case ct.None:this.addItemLast(o);break;case ct.First:this.addItemFirst(o);break;case ct.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(t,o),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let r=this._map.get(t);if(r)return this._map.delete(t),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,r){let n=this._state,o=this._head;for(;o;){if(r?t.bind(r)(o.value,o.key,this):t(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}values(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}entries(){let t=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return n}[Symbol.iterator](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>t;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let r=t.next,n=t.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}t.next=void 0,t.previous=void 0,this._state++}touch(t,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==ct.First&&r!==ct.Last)){if(r===ct.First){if(t===this._head)return;let n=t.next,o=t.previous;t===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(r===ct.Last){if(t===this._tail)return;let n=t.next,o=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((r,n)=>{t.push([n,r])}),t}fromJSON(t){this.clear();for(let[r,n]of t)this.set(r,n)}};un.LinkedMap=Vc;var Um=class extends Vc{_limit;_ratio;constructor(t,r=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,r=ct.AsNew){return super.get(t,r)}peek(t){return super.get(t,ct.None)}set(t,r){return super.set(t,r,ct.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};un.LRUCache=Um});var D$=k(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Disposable=void 0;var M$;(function(e){function t(r){return{dispose:r}}e.create=t})(M$||(Hc.Disposable=M$={}))});var ln=k(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var Hm;function Bm(){if(Hm===void 0)throw new Error("No runtime abstraction layer installed");return Hm}(function(e){function t(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Hm=r}e.install=t})(Bm||(Bm={}));Wm.default=Bm});var Qo=k(dn=>{"use strict";var mD=dn&&dn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dn,"__esModule",{value:!0});dn.Emitter=dn.Event=void 0;var hD=mD(ln()),A$;(function(e){let t={dispose(){}};e.None=function(){return t}})(A$||(dn.Event=A$={}));var Jm=class{_callbacks;_contexts;add(t,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(t,r)})}remove(t,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,i=this._callbacks.length;o<i;o++)if(this._callbacks[o]===t)if(this._contexts[o]===r){this._callbacks.splice(o,1),this._contexts.splice(o,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),o=this._contexts.slice(0);for(let i=0,s=n.length;i<s;i++)try{r.push(n[i].apply(o[i],t))}catch(a){(0,hD.default)().console.error(a)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Gm=class e{_options;static _noop=function(){};_event;_callbacks;constructor(t){this._options=t}get event(){return this._event||(this._event=(t,r,n)=>{this._callbacks||(this._callbacks=new Jm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,r);let o={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,r),o.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(o),o}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};dn.Emitter=Gm});var Jc=k(Tt=>{"use strict";var gD=Tt&&Tt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),yD=Tt&&Tt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),_D=Tt&&Tt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&gD(r,t,n[o]);return yD(r,t),r}})(),vD=Tt&&Tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.CancellationTokenSource=Tt.CancellationToken=void 0;var bD=vD(ln()),wD=_D(Yo()),Km=Qo(),Bc;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Km.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Km.Event.None});function t(r){let n=r;return n&&(n===e.None||n===e.Cancelled||wD.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}e.is=t})(Bc||(Tt.CancellationToken=Bc={}));var xD=Object.freeze(function(e,t){let r=(0,bD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){r.dispose()}}}),Wc=class{_isCancelled=!1;_emitter;cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?xD:(this._emitter||(this._emitter=new Km.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Xm=class{_token;get token(){return this._token||(this._token=new Wc),this._token}cancel(){this._token?this._token.cancel():this._token=Bc.Cancelled}dispose(){this._token?this._token instanceof Wc&&this._token.dispose():this._token=Bc.None}};Tt.CancellationTokenSource=Xm});var q$=k(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.SharedArrayReceiverStrategy=ei.SharedArraySenderStrategy=void 0;var $D=Jc(),Cs;(function(e){e.Continue=0,e.Cancelled=1})(Cs||(Cs={}));var Ym=class{buffers;constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=Cs.Continue,this.buffers.set(t.id,r),t.$cancellationData=r}async sendCancellation(t,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,Cs.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};ei.SharedArraySenderStrategy=Ym;var Qm=class{data;constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Cs.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},eh=class{token;constructor(t){this.token=new Qm(t)}cancel(){}dispose(){}},th=class{kind="request";createCancellationTokenSource(t){let r=t.$cancellationData;return r===void 0?new $D.CancellationTokenSource:new eh(r)}};ei.SharedArrayReceiverStrategy=th});var nh=k(ti=>{"use strict";var SD=ti&&ti.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ti,"__esModule",{value:!0});ti.Semaphore=void 0;var kD=SD(ln()),rh=class{_capacity;_active;_waiting;constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((r,n)=>{this._waiting.push({thunk:t,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,kD.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{let r=t.thunk();r instanceof Promise?r.then(n=>{this._active--,t.resolve(n),this.runNext()},n=>{this._active--,t.reject(n),this.runNext()}):(this._active--,t.resolve(r),this.runNext())}catch(r){this._active--,t.reject(r),this.runNext()}}};ti.Semaphore=rh});var L$=k(ut=>{"use strict";var PD=ut&&ut.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),TD=ut&&ut.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),RD=ut&&ut.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&PD(r,t,n[o]);return TD(r,t),r}})(),zD=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ut,"__esModule",{value:!0});ut.ReadableStreamMessageReader=ut.AbstractMessageReader=ut.MessageReader=void 0;var ih=zD(ln()),ri=RD(Yo()),oh=Qo(),ED=nh(),Z$;(function(e){function t(r){let n=r;return n&&ri.func(n.listen)&&ri.func(n.dispose)&&ri.func(n.onError)&&ri.func(n.onClose)&&ri.func(n.onPartialMessage)}e.is=t})(Z$||(ut.MessageReader=Z$={}));var Gc=class{errorEmitter;closeEmitter;partialMessageEmitter;constructor(){this.errorEmitter=new oh.Emitter,this.closeEmitter=new oh.Emitter,this.partialMessageEmitter=new oh.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${ri.string(t.message)?t.message:"unknown"}`)}};ut.AbstractMessageReader=Gc;var sh;(function(e){function t(r){let n,o,i,s=new Map,a,c=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(i=r.contentDecoder,s.set(i.name,i)),r.contentDecoders!==void 0)for(let u of r.contentDecoders)s.set(u.name,u);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,c.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let u of r.contentTypeDecoders)c.set(u.name,u)}return a===void 0&&(a=(0,ih.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:i,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:c}}e.fromOptions=t})(sh||(sh={}));var ah=class extends Gc{readable;options;callback;nextMessageLength;messageToken;buffer;partialMessageTimer;_partialMessageTimeout;readSemaphore;constructor(t,r){super(),this.readable=t,this.options=sh.fromOptions(r),this.buffer=(0,ih.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new ED.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property.
11
+ ${JSON.stringify(Object.fromEntries(n))}`));return}let i=parseInt(o);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=i}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ih.default)().timer.setTimeout((t,r)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ut.ReadableStreamMessageReader=ah});var B$=k(lt=>{"use strict";var OD=lt&&lt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),CD=lt&&lt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),jD=lt&&lt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&OD(r,t,n[o]);return CD(r,t),r}})(),ND=lt&&lt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lt,"__esModule",{value:!0});lt.WriteableStreamMessageWriter=lt.AbstractMessageWriter=lt.MessageWriter=void 0;var F$=ND(ln()),js=jD(Yo()),ID=nh(),U$=Qo(),MD="Content-Length: ",V$=`\r
12
+ `,H$;(function(e){function t(r){let n=r;return n&&js.func(n.dispose)&&js.func(n.onClose)&&js.func(n.onError)&&js.func(n.write)}e.is=t})(H$||(lt.MessageWriter=H$={}));var Kc=class{errorEmitter;closeEmitter;constructor(){this.errorEmitter=new U$.Emitter,this.closeEmitter=new U$.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,r,n){this.errorEmitter.fire([this.asError(t),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${js.string(t.message)?t.message:"unknown"}`)}};lt.AbstractMessageWriter=Kc;var ch;(function(e){function t(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,F$.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,F$.default)().applicationJson.encoder}}e.fromOptions=t})(ch||(ch={}));var uh=class extends Kc{writable;options;errorCount;writeSemaphore;constructor(t,r){super(),this.writable=t,this.options=ch.fromOptions(r),this.errorCount=0,this.writeSemaphore=new ID.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(MD,n.byteLength.toString(),V$),o.push(V$),this.doWrite(t,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(t,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,t),Promise.reject(o)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){this.writable.end()}};lt.WriteableStreamMessageWriter=uh});var W$=k(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.AbstractMessageBuffer=void 0;var DD=13,AD=10,qD=`\r
13
+ `,lh=class{_encoding;_chunks;_totalLength;constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let r=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,i=0;e:for(;n<this._chunks.length;){let u=this._chunks[n];for(o=0;o<u.length;){switch(u[o]){case DD:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case AD:switch(r){case 1:r=2;break;case 3:r=4,o++;break e;default:r=0}break;default:r=0}o++}i+=u.byteLength,n++}if(r!==4)return;let s=this._read(i+o),a=new Map,c=this.toString(s,"ascii").split(qD);if(c.length<2)return a;for(let u=0;u<c.length-2;u++){let l=c[u],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
14
+ ${l}`);let h=l.substr(0,d),m=l.substr(d+1).trim();a.set(t?h.toLowerCase():h,m)}return a}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(i)}if(this._chunks[0].byteLength>t){let i=this._chunks[0],s=this.asNative(i,t);return this._chunks[0]=i.slice(t),this._totalLength-=t,s}let r=this.allocNative(t),n=0,o=0;for(;t>0;){let i=this._chunks[o];if(i.byteLength>t){let s=i.slice(0,t);r.set(s,n),n+=t,this._chunks[o]=i.slice(t),this._totalLength-=t,t-=t}else r.set(i,n),n+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,t-=i.byteLength}return r}};Xc.AbstractMessageBuffer=lh});var X$=k(V=>{"use strict";var ZD=V&&V.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),LD=V&&V.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),FD=V&&V.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&ZD(r,t,n[o]);return LD(r,t),r}})(),UD=V&&V.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V,"__esModule",{value:!0});V.ConnectionOptions=V.MessageStrategy=V.CancellationStrategy=V.CancellationSenderStrategy=V.CancellationReceiverStrategy=V.RequestCancellationReceiverStrategy=V.IdCancellationReceiverStrategy=V.ConnectionStrategy=V.ConnectionError=V.ConnectionErrors=V.LogTraceNotification=V.SetTraceNotification=V.TraceFormat=V.TraceValues=V.TraceValue=V.Trace=V.NullLogger=V.ProgressType=V.ProgressToken=void 0;V.createMessageConnection=VD;var J$=UD(ln()),De=FD(Yo()),G=Fm(),G$=Vm(),Ns=Qo(),dh=Jc(),Ds;(function(e){e.type=new G.NotificationType("$/cancelRequest")})(Ds||(Ds={}));var fh;(function(e){function t(r){return typeof r=="string"||typeof r=="number"}e.is=t})(fh||(V.ProgressToken=fh={}));var Is;(function(e){e.type=new G.NotificationType("$/progress")})(Is||(Is={}));var ph=class{__;_pr;constructor(){}};V.ProgressType=ph;var mh;(function(e){function t(r){return De.func(r)}e.is=t})(mh||(mh={}));V.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var pe;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(pe||(V.Trace=pe={}));var hh;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(hh||(V.TraceValue=hh={}));V.TraceValues=hh;(function(e){function t(n){if(!De.string(n))return e.Off;switch(n=n.toLowerCase(),n){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function r(n){switch(n){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=r})(pe||(V.Trace=pe={}));var jt;(function(e){e.Text="text",e.JSON="json"})(jt||(V.TraceFormat=jt={}));(function(e){function t(r){return De.string(r)?(r=r.toLowerCase(),r==="json"?e.JSON:e.Text):e.Text}e.fromString=t})(jt||(V.TraceFormat=jt={}));var gh;(function(e){e.type=new G.NotificationType("$/setTrace")})(gh||(V.SetTraceNotification=gh={}));var Yc;(function(e){e.type=new G.NotificationType("$/logTrace")})(Yc||(V.LogTraceNotification=Yc={}));var Ms;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(Ms||(V.ConnectionErrors=Ms={}));var ni=class e extends Error{code;constructor(t,r){super(r),this.code=t,Object.setPrototypeOf(this,e.prototype)}};V.ConnectionError=ni;var yh;(function(e){function t(r){let n=r;return n&&De.func(n.cancelUndispatched)}e.is=t})(yh||(V.ConnectionStrategy=yh={}));var Qc;(function(e){function t(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}e.is=t})(Qc||(V.IdCancellationReceiverStrategy=Qc={}));var _h;(function(e){function t(r){let n=r;return n&&n.kind==="request"&&De.func(n.createCancellationTokenSource)&&(n.dispose===void 0||De.func(n.dispose))}e.is=t})(_h||(V.RequestCancellationReceiverStrategy=_h={}));var eu;(function(e){e.Message=Object.freeze({createCancellationTokenSource(r){return new dh.CancellationTokenSource}});function t(r){return Qc.is(r)||_h.is(r)}e.is=t})(eu||(V.CancellationReceiverStrategy=eu={}));var tu;(function(e){e.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Ds.type,{id:n})},cleanup(r){}});function t(r){let n=r;return n&&De.func(n.sendCancellation)&&De.func(n.cleanup)}e.is=t})(tu||(V.CancellationSenderStrategy=tu={}));var ru;(function(e){e.Message=Object.freeze({receiver:eu.Message,sender:tu.Message});function t(r){let n=r;return n&&eu.is(n.receiver)&&tu.is(n.sender)}e.is=t})(ru||(V.CancellationStrategy=ru={}));var nu;(function(e){function t(r){let n=r;return n&&De.func(n.handleMessage)}e.is=t})(nu||(V.MessageStrategy=nu={}));var K$;(function(e){function t(r){let n=r;return n&&(ru.is(n.cancellationStrategy)||yh.is(n.connectionStrategy)||nu.is(n.messageStrategy)||De.number(n.maxParallelism))}e.is=t})(K$||(V.ConnectionOptions=K$={}));var rr;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"})(rr||(rr={}));function VD(e,t,r,n){let o=r!==void 0?r:V.NullLogger,i=0,s=0,a=0,c="2.0",u=n?.maxParallelism??-1,l=0,d,h=new Map,m,p=new Map,y=new Map,v,P=new G$.LinkedMap,T=new Map,z=new Set,M=new Map,C=pe.Off,Ne=jt.Text,de,mt=rr.New,bn=new Ns.Emitter,Ar=new Ns.Emitter,fo=new Ns.Emitter,wi=new Ns.Emitter,xi=new Ns.Emitter,ir=n&&n.cancellationStrategy?n.cancellationStrategy:ru.Message;function iP(g){}function my(){return mt===rr.Listening}function hy(){return mt===rr.Closed}function po(){return mt===rr.Disposed}function gy(){(mt===rr.New||mt===rr.Listening)&&(mt=rr.Closed,Ar.fire(void 0))}function sP(g){bn.fire([g,void 0,void 0])}function aP(g){bn.fire(g)}e.onClose(gy),e.onError(sP),t.onClose(gy),t.onError(aP);function yy(g){if(g===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+g.toString()}function cP(g){return g===null?"res-unknown-"+(++a).toString():"res-"+g.toString()}function uP(){return"not-"+(++s).toString()}function lP(g,S){G.Message.isRequest(S)?g.set(yy(S.id),S):G.Message.isResponse(S)?u===-1?g.set(cP(S.id),S):vy(S):g.set(uP(),S)}function Cu(){v||P.size===0||u!==-1&&l>=u||(v=(0,J$.default)().timer.setImmediate(async()=>{if(v=void 0,P.size===0||u!==-1&&l>=u)return;let g=P.shift(),S;try{l++;let O=n?.messageStrategy;nu.is(O)?S=O.handleMessage(g,_y):S=_y(g)}catch(O){o.error(`Processing message queue failed: ${O.toString()}`)}finally{S instanceof Promise?S.then(()=>{l--,Cu()}).catch(O=>{o.error(`Processing message queue failed: ${O.toString()}`)}):l--,Cu()}}))}async function _y(g){return G.Message.isRequest(g)?fP(g):G.Message.isNotification(g)?pP(g):G.Message.isResponse(g)?vy(g):mP(g)}let dP=g=>{try{if(G.Message.isNotification(g)&&g.method===Ds.type.method){let S=g.params.id,O=yy(S),A=P.get(O);if(G.Message.isRequest(A)){let Ie=n?.connectionStrategy,he=Ie&&Ie.cancelUndispatched?Ie.cancelUndispatched(A,iP):void 0;if(he&&(he.error!==void 0||he.result!==void 0)){P.delete(O),M.delete(S),he.id=A.id,ju(he,g.method,Date.now()),t.write(he).catch(()=>o.error("Sending response for canceled message failed."));return}}let fe=M.get(S);if(fe!==void 0){fe.cancel(),Nu(g);return}else z.add(S)}lP(P,g)}finally{Cu()}};async function fP(g){if(po())return Promise.resolve();function S(He,nt,qe){let Ze={jsonrpc:c,id:g.id};return He instanceof G.ResponseError?Ze.error=He.toJson():Ze.result=He===void 0?null:He,ju(Ze,nt,qe),t.write(Ze)}function O(He,nt,qe){let Ze={jsonrpc:c,id:g.id,error:He.toJson()};return ju(Ze,nt,qe),t.write(Ze)}yP(g);let A=h.get(g.method),fe,Ie;A&&(fe=A.type,Ie=A.handler);let he=Date.now();if(Ie||d){let He=g.id??String(Date.now()),nt=Qc.is(ir.receiver)?ir.receiver.createCancellationTokenSource(He):ir.receiver.createCancellationTokenSource(g);g.id!==null&&z.has(g.id)&&nt.cancel(),g.id!==null&&M.set(He,nt);try{let qe;if(Ie)if(g.params===void 0){if(fe!==void 0&&fe.numberOfParams!==0)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines ${fe.numberOfParams} params but received none.`),g.method,he);qe=Ie(nt.token)}else if(Array.isArray(g.params)){if(fe!==void 0&&fe.parameterStructures===G.ParameterStructures.byName)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by name but received parameters by position`),g.method,he);qe=Ie(...g.params,nt.token)}else{if(fe!==void 0&&fe.parameterStructures===G.ParameterStructures.byPosition)return O(new G.ResponseError(G.ErrorCodes.InvalidParams,`Request ${g.method} defines parameters by position but received parameters by name`),g.method,he);qe=Ie(g.params,nt.token)}else d&&(qe=d(g.method,g.params,nt.token));let Ze=await qe;await S(Ze,g.method,he)}catch(qe){qe instanceof G.ResponseError?await S(qe,g.method,he):qe&&De.string(qe.message)?await O(new G.ResponseError(G.ErrorCodes.InternalError,`Request ${g.method} failed with message: ${qe.message}`),g.method,he):await O(new G.ResponseError(G.ErrorCodes.InternalError,`Request ${g.method} failed unexpectedly without providing any details.`),g.method,he)}finally{M.delete(He)}}else await O(new G.ResponseError(G.ErrorCodes.MethodNotFound,`Unhandled method ${g.method}`),g.method,he)}function vy(g){if(!po())if(g.id===null)g.error?o.error(`Received response message without id: Error is:
15
+ ${JSON.stringify(g.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let S=g.id,O=T.get(S);if(_P(g,O),O!==void 0){T.delete(S);try{if(g.error){let A=g.error;O.reject(new G.ResponseError(A.code,A.message,A.data))}else if(g.result!==void 0)O.resolve(g.result);else throw new Error("Should never happen.")}catch(A){A.message?o.error(`Response handler '${O.method}' failed with message: ${A.message}`):o.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}async function pP(g){if(po())return;let S,O;if(g.method===Ds.type.method){let A=g.params.id;z.delete(A),Nu(g);return}else{let A=p.get(g.method);A&&(O=A.handler,S=A.type)}if(O||m)try{if(Nu(g),O)if(g.params===void 0)S!==void 0&&S.numberOfParams!==0&&S.parameterStructures!==G.ParameterStructures.byName&&o.error(`Notification ${g.method} defines ${S.numberOfParams} params but received none.`),await O();else if(Array.isArray(g.params)){let A=g.params;g.method===Is.type.method&&A.length===2&&fh.is(A[0])?await O({token:A[0],value:A[1]}):(S!==void 0&&(S.parameterStructures===G.ParameterStructures.byName&&o.error(`Notification ${g.method} defines parameters by name but received parameters by position`),S.numberOfParams!==g.params.length&&o.error(`Notification ${g.method} defines ${S.numberOfParams} params but received ${A.length} arguments`)),await O(...A))}else S!==void 0&&S.parameterStructures===G.ParameterStructures.byPosition&&o.error(`Notification ${g.method} defines parameters by position but received parameters by name`),await O(g.params);else m&&await m(g.method,g.params)}catch(A){A.message?o.error(`Notification handler '${g.method}' failed with message: ${A.message}`):o.error(`Notification handler '${g.method}' failed unexpectedly.`)}else fo.fire(g)}function mP(g){if(!g){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message:
16
+ ${JSON.stringify(g,null,4)}`);let S=g;if(De.string(S.id)||De.number(S.id)){let O=S.id,A=T.get(O);A&&A.reject(new Error("The received response has neither a result nor an error property."))}}function qr(g){if(g!=null)switch(C){case pe.Verbose:return JSON.stringify(g,null,4);case pe.Compact:return JSON.stringify(g);default:return}}function hP(g){if(!(C===pe.Off||!de))if(Ne===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&g.params&&(S=`Params: ${qr(g.params)}`),de.log(`Sending request '${g.method} - (${g.id})'.`,S)}else mo("send-request",g)}function gP(g){if(!(C===pe.Off||!de))if(Ne===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&(g.params?S=`Params: ${qr(g.params)}`:S="No parameters provided."),de.log(`Sending notification '${g.method}'.`,S)}else mo("send-notification",g)}function ju(g,S,O){if(!(C===pe.Off||!de))if(Ne===jt.Text){let A;(C===pe.Verbose||C===pe.Compact)&&(g.error&&g.error.data?A=`Error data: ${qr(g.error.data)}`:g.result?A=`Result: ${qr(g.result)}`:g.error===void 0&&(A="No result returned.")),de.log(`Sending response '${S} - (${g.id})'. Processing request took ${Date.now()-O}ms`,A)}else mo("send-response",g)}function yP(g){if(!(C===pe.Off||!de))if(Ne===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&g.params&&(S=`Params: ${qr(g.params)}`),de.log(`Received request '${g.method} - (${g.id})'.`,S)}else mo("receive-request",g)}function Nu(g){if(!(C===pe.Off||!de||g.method===Yc.type.method))if(Ne===jt.Text){let S;(C===pe.Verbose||C===pe.Compact)&&(g.params?S=`Params: ${qr(g.params)}`:S="No parameters provided."),de.log(`Received notification '${g.method}'.`,S)}else mo("receive-notification",g)}function _P(g,S){if(!(C===pe.Off||!de))if(Ne===jt.Text){let O;if((C===pe.Verbose||C===pe.Compact)&&(g.error&&g.error.data?O=`Error data: ${qr(g.error.data)}`:g.result?O=`Result: ${qr(g.result)}`:g.error===void 0&&(O="No result returned.")),S){let A=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:"";de.log(`Received response '${S.method} - (${g.id})' in ${Date.now()-S.timerStart}ms.${A}`,O)}else de.log(`Received response ${g.id} without active response promise.`,O)}else mo("receive-response",g)}function mo(g,S){if(!de||C===pe.Off)return;let O={isLSPMessage:!0,type:g,message:S,timestamp:Date.now()};de.log(O)}function $i(){if(hy())throw new ni(Ms.Closed,"Connection is closed.");if(po())throw new ni(Ms.Disposed,"Connection is disposed.")}function vP(){if(my())throw new ni(Ms.AlreadyListening,"Connection is already listening")}function bP(){if(!my())throw new Error("Call listen() first.")}function Si(g){return g===void 0?null:g}function by(g){if(g!==null)return g}function wy(g){return g!=null&&!Array.isArray(g)&&typeof g=="object"}function Iu(g,S){switch(g){case G.ParameterStructures.auto:return wy(S)?by(S):[Si(S)];case G.ParameterStructures.byName:if(!wy(S))throw new Error("Received parameters by name but param is not an object literal.");return by(S);case G.ParameterStructures.byPosition:return[Si(S)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}function xy(g,S){let O,A=g.numberOfParams;switch(A){case 0:O=void 0;break;case 1:O=Iu(g.parameterStructures,S[0]);break;default:O=[];for(let fe=0;fe<S.length&&fe<A;fe++)O.push(Si(S[fe]));if(S.length<A)for(let fe=S.length;fe<A;fe++)O.push(null);break}return O}let wn={sendNotification:(g,...S)=>{$i();let O,A;if(De.string(g)){O=g;let Ie=S[0],he=0,He=G.ParameterStructures.auto;G.ParameterStructures.is(Ie)&&(he=1,He=Ie);let nt=S.length,qe=nt-he;switch(qe){case 0:A=void 0;break;case 1:A=Iu(He,S[he]);break;default:if(He===G.ParameterStructures.byName)throw new Error(`Received ${qe} parameters for 'by Name' notification parameter structure.`);A=S.slice(he,nt).map(Ze=>Si(Ze));break}}else{let Ie=S;O=g.method,A=xy(g,Ie)}let fe={jsonrpc:c,method:O,params:A};return gP(fe),t.write(fe).catch(Ie=>{throw o.error("Sending notification failed."),Ie})},onNotification:(g,S)=>{$i();let O;return De.func(g)?m=g:S&&(De.string(g)?(O=g,p.set(g,{type:void 0,handler:S})):(O=g.method,p.set(g.method,{type:g,handler:S}))),{dispose:()=>{O!==void 0?p.get(O)?.handler===S&&p.delete(O):m===g&&(m=void 0)}}},onProgress:(g,S,O)=>{if(y.has(S))throw new Error(`Progress handler for token ${S} already registered`);return y.set(S,O),{dispose:()=>{y.get(S)===O&&y.delete(S)}}},sendProgress:(g,S,O)=>wn.sendNotification(Is.type,{token:S,value:O}),onUnhandledProgress:wi.event,sendRequest:(g,...S)=>{$i(),bP();function O(Ze,Bt){let br=ir.sender.sendCancellation(Ze,Bt);br===void 0?o.log(`Received no promise from cancellation strategy when cancelling id ${Bt}`):br.catch(()=>{o.log(`Sending cancellation messages for id ${Bt} failed.`)})}let A,fe,Ie;if(De.string(g)){A=g;let Ze=S[0],Bt=S[S.length-1],br=0,ki=G.ParameterStructures.auto;G.ParameterStructures.is(Ze)&&(br=1,ki=Ze);let xn=S.length;dh.CancellationToken.is(Bt)&&(xn=xn-1,Ie=Bt);let sr=xn-br;switch(sr){case 0:fe=void 0;break;case 1:fe=Iu(ki,S[br]);break;default:if(ki===G.ParameterStructures.byName)throw new Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);fe=S.slice(br,xn).map(wP=>Si(wP));break}}else{let Ze=S;A=g.method,fe=xy(g,Ze);let Bt=g.numberOfParams;Ie=dh.CancellationToken.is(Ze[Bt])?Ze[Bt]:void 0}let he=i++,He,nt=!1;Ie!==void 0&&(Ie.isCancellationRequested?nt=!0:He=Ie.onCancellationRequested(()=>{O(wn,he)}));let qe={jsonrpc:c,id:he,method:A,params:fe};return hP(qe),typeof ir.sender.enableCancellation=="function"&&ir.sender.enableCancellation(qe),new Promise(async(Ze,Bt)=>{let br=sr=>{Ze(sr),ir.sender.cleanup(he),He?.dispose()},ki=sr=>{Bt(sr),ir.sender.cleanup(he),He?.dispose()},xn={method:A,timerStart:Date.now(),resolve:br,reject:ki};try{T.set(he,xn),await t.write(qe),nt&&O(wn,he)}catch(sr){throw T.delete(he),xn.reject(new G.ResponseError(G.ErrorCodes.MessageWriteError,sr.message?sr.message:"Unknown reason")),o.error("Sending request failed."),sr}})},onRequest:(g,S)=>{$i();let O=null;return mh.is(g)?(O=void 0,d=g):De.string(g)?(O=null,S!==void 0&&(O=g,h.set(g,{handler:S,type:void 0}))):S!==void 0&&(O=g.method,h.set(g.method,{type:g,handler:S})),{dispose:()=>{O!==null&&(O!==void 0?h.get(O)?.handler===S&&h.delete(O):d===g&&(d=void 0))}}},hasPendingResponse:()=>T.size>0,trace:async(g,S,O)=>{let A=!1,fe=jt.Text;O!==void 0&&(De.boolean(O)?A=O:(A=O.sendNotification||!1,fe=O.traceFormat||jt.Text)),C=g,Ne=fe,C===pe.Off?de=void 0:de=S,A&&!hy()&&!po()&&await wn.sendNotification(gh.type,{value:pe.toString(g)})},onError:bn.event,onClose:Ar.event,onUnhandledNotification:fo.event,onDispose:xi.event,end:()=>{t.end()},dispose:()=>{if(po())return;mt=rr.Disposed,xi.fire(void 0);let g=new G.ResponseError(G.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let S of T.values())S.reject(g);T=new Map,M=new Map,z=new Set,P=new G$.LinkedMap,De.func(t.dispose)&&t.dispose(),De.func(e.dispose)&&e.dispose()},listen:()=>{$i(),vP(),mt=rr.Listening,e.listen(dP)},inspect:()=>{(0,J$.default)().console.log("inspect")}};return wn.onNotification(Yc.type,g=>{if(C===pe.Off||!de)return;let S=C===pe.Verbose||C===pe.Compact;de.log(g.message,S?g.verbose:void 0)}),wn.onNotification(Is.type,async g=>{let S=y.get(g.token);S?await S(g.value):wi.fire(g)}),wn}});var Or=k(w=>{"use strict";var HD=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.RequestCancellationReceiverStrategy=w.IdCancellationReceiverStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.TraceValue=w.Trace=void 0;var Se=Fm();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return Se.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return Se.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return Se.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return Se.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return Se.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return Se.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return Se.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return Se.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return Se.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return Se.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return Se.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return Se.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return Se.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return Se.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return Se.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return Se.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return Se.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return Se.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return Se.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return Se.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return Se.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return Se.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return Se.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return Se.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return Se.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return Se.ParameterStructures}});var vh=Vm();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return vh.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return vh.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return vh.Touch}});var BD=D$();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return BD.Disposable}});var Y$=Qo();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return Y$.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return Y$.Emitter}});var Q$=Jc();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return Q$.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return Q$.CancellationToken}});var e0=q$();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return e0.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return e0.SharedArrayReceiverStrategy}});var bh=L$();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return bh.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return bh.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return bh.ReadableStreamMessageReader}});var wh=B$();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return wh.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return wh.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return wh.WriteableStreamMessageWriter}});var WD=W$();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return WD.AbstractMessageBuffer}});var Fe=X$();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Fe.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Fe.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Fe.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Fe.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Fe.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Fe.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Fe.Trace}});Object.defineProperty(w,"TraceValue",{enumerable:!0,get:function(){return Fe.TraceValue}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Fe.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Fe.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Fe.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Fe.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Fe.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.CancellationReceiverStrategy}});Object.defineProperty(w,"IdCancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.IdCancellationReceiverStrategy}});Object.defineProperty(w,"RequestCancellationReceiverStrategy",{enumerable:!0,get:function(){return Fe.RequestCancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Fe.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Fe.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Fe.MessageStrategy}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Fe.TraceValues}});var JD=HD(ln());w.RAL=JD.default});var n0=k(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});var t0=ho("util"),Cr=Or(),xh=class e extends Cr.AbstractMessageBuffer{static emptyBuffer=Buffer.allocUnsafe(0);constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,r){return Buffer.from(t,r)}toString(t,r){return t instanceof Buffer?t.toString(r):new t0.TextDecoder(r).decode(t)}asNative(t,r){return r===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,r):Buffer.from(t,0,r)}allocNative(t){return Buffer.allocUnsafe(t)}},$h=class{stream;constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Cr.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Cr.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Cr.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),Cr.Disposable.create(()=>this.stream.off("data",t))}},Sh=class{stream;constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),Cr.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),Cr.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),Cr.Disposable.create(()=>this.stream.off("end",t))}write(t,r){return new Promise((n,o)=>{let i=s=>{s==null?n():o(s)};typeof t=="string"?this.stream.write(t,r,i):this.stream.write(t,i)})}end(){this.stream.end()}},r0=Object.freeze({messageBuffer:Object.freeze({create:e=>new xh(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new t0.TextDecoder(t.charset).decode(e)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:e=>new $h(e),asWritableStream:e=>new Sh(e)}),console,timer:Object.freeze({setTimeout(e,t,...r){let n=setTimeout(e,t,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(e,...t){let r=setImmediate(e,...t);return{dispose:()=>clearImmediate(r)}},setInterval(e,t,...r){let n=setInterval(e,t,...r);return{dispose:()=>clearInterval(n)}}})});function kh(){return r0}(function(e){function t(){Cr.RAL.install(r0)}e.install=t})(kh||(kh={}));Ph.default=kh});var Ch=k(ae=>{"use strict";var i0=ae&&ae.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),GD=ae&&ae.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Oh=ae&&ae.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&i0(r,t,n[o]);return GD(r,t),r}})(),KD=ae&&ae.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&i0(t,e,r)},XD=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ae,"__esModule",{value:!0});ae.StreamMessageWriter=ae.StreamMessageReader=ae.SocketMessageWriter=ae.SocketMessageReader=ae.PortMessageWriter=ae.PortMessageReader=ae.IPCMessageWriter=ae.IPCMessageReader=void 0;ae.generateRandomPipeName=nA;ae.createClientPipeTransport=oA;ae.createServerPipeTransport=iA;ae.createClientSocketTransport=sA;ae.createServerSocketTransport=aA;ae.createMessageConnection=lA;var As=XD(n0());As.default.install();var YD=Oh(ho("path")),QD=Oh(ho("os")),eA=Oh(ho("fs")),o0=ho("crypto"),su=ho("net"),Nt=Or();KD(Or(),ae);var Th=class extends Nt.AbstractMessageReader{process;constructor(t){super(),this.process=t;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Nt.Disposable.create(()=>this.process.off("message",t))}};ae.IPCMessageReader=Th;var Rh=class extends Nt.AbstractMessageWriter{process;errorCount;constructor(t){super(),this.process=t,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,t)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){}};ae.IPCMessageWriter=Rh;var zh=class extends Nt.AbstractMessageReader{onData;constructor(t){super(),this.onData=new Nt.Emitter,t.on("close",()=>this.fireClose),t.on("error",r=>this.fireError(r)),t.on("message",r=>{this.onData.fire(r)})}listen(t){return this.onData.event(t)}};ae.PortMessageReader=zh;var Eh=class extends Nt.AbstractMessageWriter{port;errorCount;constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",r=>this.fireError(r))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(r){return this.handleError(r,t),Promise.reject(r)}}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}end(){}};ae.PortMessageWriter=Eh;var so=class extends Nt.ReadableStreamMessageReader{constructor(t,r="utf-8"){super((0,As.default)().stream.asReadableStream(t),r)}};ae.SocketMessageReader=so;var ao=class extends Nt.WriteableStreamMessageWriter{socket;constructor(t,r){super((0,As.default)().stream.asWritableStream(t),r),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};ae.SocketMessageWriter=ao;var ou=class extends Nt.ReadableStreamMessageReader{constructor(t,r){super((0,As.default)().stream.asReadableStream(t),r)}};ae.StreamMessageReader=ou;var iu=class extends Nt.WriteableStreamMessageWriter{constructor(t,r){super((0,As.default)().stream.asWritableStream(t),r)}};ae.StreamMessageWriter=iu;var tA=process.env.XDG_RUNTIME_DIR,rA=new Map([["linux",107],["darwin",102]]);function nA(){if(process.platform==="win32")return`\\\\.\\pipe\\lsp-${(0,o0.randomBytes)(16).toString("hex")}-sock`;let e=32,t=10,r=eA.realpathSync(tA??QD.tmpdir()),n=rA.get(process.platform);if(n!==void 0&&(e=Math.min(n-r.length-t,e)),e<16)throw new Error(`Unable to generate a random pipe name with ${e} characters.`);let o=(0,o0.randomBytes)(Math.floor(e/2)).toString("hex");return YD.join(r,`lsp-${o}.sock`)}function oA(e,t="utf-8"){let r,n=new Promise((o,i)=>{r=o});return new Promise((o,i)=>{let s=(0,su.createServer)(a=>{s.close(),r([new so(a,t),new ao(a,t)])});s.on("error",i),s.listen(e,()=>{s.removeListener("error",i),o({onConnected:()=>n})})})}function iA(e,t="utf-8"){let r=(0,su.createConnection)(e);return[new so(r,t),new ao(r,t)]}function sA(e,t="utf-8"){let r,n=new Promise((o,i)=>{r=o});return new Promise((o,i)=>{let s=(0,su.createServer)(a=>{s.close(),r([new so(a,t),new ao(a,t)])});s.on("error",i),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",i),o({onConnected:()=>n})})})}function aA(e,t="utf-8"){let r=(0,su.createConnection)(e,"127.0.0.1");return[new so(r,t),new ao(r,t)]}function cA(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function uA(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function lA(e,t,r,n){r||(r=Nt.NullLogger);let o=cA(e)?new ou(e):e,i=uA(t)?new iu(t):t;return Nt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Nt.createMessageConnection)(o,i,r,n)}});var yu={};Qs(yu,{AnnotatedTextEdit:()=>jr,ApplyKind:()=>eg,ChangeAnnotation:()=>fn,ChangeAnnotationIdentifier:()=>We,CodeAction:()=>gg,CodeActionContext:()=>hg,CodeActionKind:()=>mg,CodeActionTag:()=>pu,CodeActionTriggerKind:()=>Hs,CodeDescription:()=>Fh,CodeLens:()=>yg,Color:()=>cu,ColorInformation:()=>Mh,ColorPresentation:()=>Dh,Command:()=>co,CompletionItem:()=>rg,CompletionItemKind:()=>Gh,CompletionItemLabelDetails:()=>tg,CompletionItemTag:()=>Xh,CompletionList:()=>ng,CreateFile:()=>ii,DeleteFile:()=>ai,Diagnostic:()=>Ls,DiagnosticRelatedInformation:()=>uu,DiagnosticSeverity:()=>Zh,DiagnosticTag:()=>Lh,DocumentHighlight:()=>cg,DocumentHighlightKind:()=>ag,DocumentLink:()=>vg,DocumentSymbol:()=>pg,DocumentUri:()=>jh,EOL:()=>dA,FoldingRange:()=>qh,FoldingRangeKind:()=>Ah,FormattingOptions:()=>_g,Hover:()=>og,InlayHint:()=>Rg,InlayHintKind:()=>mu,InlayHintLabelPart:()=>hu,InlineCompletionContext:()=>jg,InlineCompletionItem:()=>zg,InlineCompletionList:()=>Eg,InlineCompletionTriggerKind:()=>Og,InlineValueContext:()=>Tg,InlineValueEvaluatableExpression:()=>Pg,InlineValueText:()=>Sg,InlineValueVariableLookup:()=>kg,InsertReplaceEdit:()=>Yh,InsertTextFormat:()=>Kh,InsertTextMode:()=>Qh,LanguageKind:()=>Wh,Location:()=>Zs,LocationLink:()=>Ih,MarkedString:()=>Vs,MarkupContent:()=>pn,MarkupKind:()=>fu,OptionalVersionedTextDocumentIdentifier:()=>Us,ParameterInformation:()=>ig,Position:()=>Ht,Range:()=>Ae,RenameFile:()=>si,SelectedCompletionInfo:()=>Cg,SelectionRange:()=>bg,SemanticTokenModifiers:()=>xg,SemanticTokenTypes:()=>wg,SemanticTokens:()=>$g,SignatureInformation:()=>sg,SnippetTextEdit:()=>Uh,StringValue:()=>gu,SymbolInformation:()=>dg,SymbolKind:()=>ug,SymbolTag:()=>lg,TextDocument:()=>Ig,TextDocumentEdit:()=>Fs,TextDocumentIdentifier:()=>Hh,TextDocumentItem:()=>Jh,TextEdit:()=>gr,URI:()=>au,VersionedTextDocumentIdentifier:()=>Bh,WorkspaceChange:()=>Vh,WorkspaceEdit:()=>lu,WorkspaceFolder:()=>Ng,WorkspaceSymbol:()=>fg,integer:()=>Nh,uinteger:()=>qs});var jh,au,Nh,qs,Ht,Ae,Zs,Ih,cu,Mh,Dh,Ah,qh,uu,Zh,Lh,Fh,Ls,co,gr,fn,We,jr,Fs,ii,si,ai,lu,oi,Uh,du,Vh,Hh,Bh,Us,Wh,Jh,fu,pn,Gh,Kh,Xh,Yh,Qh,eg,tg,rg,ng,Vs,og,ig,sg,ag,cg,ug,lg,dg,fg,pg,mg,Hs,hg,pu,gg,yg,_g,vg,bg,wg,xg,$g,Sg,kg,Pg,Tg,mu,hu,Rg,gu,zg,Eg,Og,Cg,jg,Ng,dA,Ig,Mg,_,_u=TP(()=>{"use strict";(function(e){function t(r){return typeof r=="string"}e.is=t})(jh||(jh={}));(function(e){function t(r){return typeof r=="string"}e.is=t})(au||(au={}));(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}e.is=t})(Nh||(Nh={}));(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}e.is=t})(qs||(qs={}));(function(e){function t(n,o){return n===Number.MAX_VALUE&&(n=qs.MAX_VALUE),o===Number.MAX_VALUE&&(o=qs.MAX_VALUE),{line:n,character:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.uinteger(o.line)&&_.uinteger(o.character)}e.is=r})(Ht||(Ht={}));(function(e){function t(n,o,i,s){if(_.uinteger(n)&&_.uinteger(o)&&_.uinteger(i)&&_.uinteger(s))return{start:Ht.create(n,o),end:Ht.create(i,s)};if(Ht.is(n)&&Ht.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${i}, ${s}]`)}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ht.is(o.start)&&Ht.is(o.end)}e.is=r})(Ae||(Ae={}));(function(e){function t(n,o){return{uri:n,range:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&(_.string(o.uri)||_.undefined(o.uri))}e.is=r})(Zs||(Zs={}));(function(e){function t(n,o,i,s){return{targetUri:n,targetRange:o,targetSelectionRange:i,originSelectionRange:s}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.targetRange)&&_.string(o.targetUri)&&Ae.is(o.targetSelectionRange)&&(Ae.is(o.originSelectionRange)||_.undefined(o.originSelectionRange))}e.is=r})(Ih||(Ih={}));(function(e){function t(n,o,i,s){return{red:n,green:o,blue:i,alpha:s}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.numberRange(o.red,0,1)&&_.numberRange(o.green,0,1)&&_.numberRange(o.blue,0,1)&&_.numberRange(o.alpha,0,1)}e.is=r})(cu||(cu={}));(function(e){function t(n,o){return{range:n,color:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&cu.is(o.color)}e.is=r})(Mh||(Mh={}));(function(e){function t(n,o,i){return{label:n,textEdit:o,additionalTextEdits:i}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.string(o.label)&&(_.undefined(o.textEdit)||gr.is(o))&&(_.undefined(o.additionalTextEdits)||_.typedArray(o.additionalTextEdits,gr.is))}e.is=r})(Dh||(Dh={}));(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Ah||(Ah={}));(function(e){function t(n,o,i,s,a,c){let u={startLine:n,endLine:o};return _.defined(i)&&(u.startCharacter=i),_.defined(s)&&(u.endCharacter=s),_.defined(a)&&(u.kind=a),_.defined(c)&&(u.collapsedText=c),u}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.uinteger(o.startLine)&&_.uinteger(o.startLine)&&(_.undefined(o.startCharacter)||_.uinteger(o.startCharacter))&&(_.undefined(o.endCharacter)||_.uinteger(o.endCharacter))&&(_.undefined(o.kind)||_.string(o.kind))}e.is=r})(qh||(qh={}));(function(e){function t(n,o){return{location:n,message:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&Zs.is(o.location)&&_.string(o.message)}e.is=r})(uu||(uu={}));(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Zh||(Zh={}));(function(e){e.Unnecessary=1,e.Deprecated=2})(Lh||(Lh={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&_.string(n.href)}e.is=t})(Fh||(Fh={}));(function(e){function t(i,s,a,c,u,l){let d={range:i,message:s};return _.defined(a)&&(d.severity=a),_.defined(c)&&(d.code=c),_.defined(u)&&(d.source=u),_.defined(l)&&(d.relatedInformation=l),d}e.create=t;function r(i){var s;let a=i;return _.defined(a)&&Ae.is(a.range)&&(_.string(a.message)||pn.is(a.message))&&(_.number(a.severity)||_.undefined(a.severity))&&(_.integer(a.code)||_.string(a.code)||_.undefined(a.code))&&(_.undefined(a.codeDescription)||_.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(_.string(a.source)||_.undefined(a.source))&&(_.undefined(a.relatedInformation)||_.typedArray(a.relatedInformation,uu.is))}e.is=r;function n(i){return _.string(i.message)}e.is3_17=n;function o(i){if(_.string(i.message))return i.message;if(pn.is(i.message))return i.message.value;throw new Error(`Unknown message type ${typeof i.message}`)}e.getMessageString=o})(Ls||(Ls={}));(function(e){function t(n,o,...i){let s={title:n,command:o};return _.defined(i)&&i.length>0&&(s.arguments=i),s}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.title)&&(o.tooltip===void 0||_.string(o.tooltip))&&_.string(o.command)}e.is=r})(co||(co={}));(function(e){function t(i,s){return{range:i,newText:s}}e.replace=t;function r(i,s){return{range:{start:i,end:i},newText:s}}e.insert=r;function n(i){return{range:i,newText:""}}e.del=n;function o(i){let s=i;return _.objectLiteral(s)&&_.string(s.newText)&&Ae.is(s.range)}e.is=o})(gr||(gr={}));(function(e){function t(n,o,i){let s={label:n};return o!==void 0&&(s.needsConfirmation=o),i!==void 0&&(s.description=i),s}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&_.string(o.label)&&(_.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(_.string(o.description)||o.description===void 0)}e.is=r})(fn||(fn={}));(function(e){function t(r){let n=r;return _.string(n)}e.is=t})(We||(We={}));(function(e){function t(i,s,a){return{range:i,newText:s,annotationId:a}}e.replace=t;function r(i,s,a){return{range:{start:i,end:i},newText:s,annotationId:a}}e.insert=r;function n(i,s){return{range:i,newText:"",annotationId:s}}e.del=n;function o(i){let s=i;return gr.is(s)&&(fn.is(s.annotationId)||We.is(s.annotationId))}e.is=o})(jr||(jr={}));(function(e){function t(n,o){return{textDocument:n,edits:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&Us.is(o.textDocument)&&Array.isArray(o.edits)}e.is=r})(Fs||(Fs={}));(function(e){function t(n,o,i){let s={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(s.options=o),i!==void 0&&(s.annotationId=i),s}e.create=t;function r(n){let o=n;return o&&o.kind==="create"&&_.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||_.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||_.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(ii||(ii={}));(function(e){function t(n,o,i,s){let a={kind:"rename",oldUri:n,newUri:o};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}e.create=t;function r(n){let o=n;return o&&o.kind==="rename"&&_.string(o.oldUri)&&_.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||_.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||_.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(si||(si={}));(function(e){function t(n,o,i){let s={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(s.options=o),i!==void 0&&(s.annotationId=i),s}e.create=t;function r(n){let o=n;return o&&o.kind==="delete"&&_.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||_.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||_.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||We.is(o.annotationId))}e.is=r})(ai||(ai={}));(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>_.string(o.kind)?ii.is(o)||si.is(o)||ai.is(o):Fs.is(o)))}e.is=t})(lu||(lu={}));oi=class{constructor(t,r){this.edits=t,this.changeAnnotations=r}insert(t,r,n){let o,i;if(n===void 0?o=gr.insert(t,r):We.is(n)?(i=n,o=jr.insert(t,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),o=jr.insert(t,r,i)),this.edits.push(o),i!==void 0)return i}replace(t,r,n){let o,i;if(n===void 0?o=gr.replace(t,r):We.is(n)?(i=n,o=jr.replace(t,r,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),o=jr.replace(t,r,i)),this.edits.push(o),i!==void 0)return i}delete(t,r){let n,o;if(r===void 0?n=gr.del(t):We.is(r)?(o=r,n=jr.del(t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=jr.del(t,o)),this.edits.push(n),o!==void 0)return o}add(t){this.edits.push(t)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(t){if(t===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}};(function(e){function t(r){let n=r;return _.objectLiteral(n)&&Ae.is(n.range)&&gu.isSnippet(n.snippet)&&(n.annotationId===void 0||fn.is(n.annotationId)||We.is(n.annotationId))}e.is=t})(Uh||(Uh={}));du=class{constructor(t){this._annotations=t===void 0?Object.create(null):t,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(t,r){let n;if(We.is(t)?n=t:(n=this.nextId(),r=t),this._annotations[n]!==void 0)throw new Error(`Id ${n} is already in use.`);if(r===void 0)throw new Error(`No annotation provided for id ${n}`);return this._annotations[n]=r,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},Vh=class{constructor(t){this._textEditChanges=Object.create(null),t!==void 0?(this._workspaceEdit=t,t.documentChanges?(this._changeAnnotations=new du(t.changeAnnotations),t.changeAnnotations=this._changeAnnotations.all(),t.documentChanges.forEach(r=>{if(Fs.is(r)){let n=new oi(r.edits,this._changeAnnotations);this._textEditChanges[r.textDocument.uri]=n}})):t.changes&&Object.keys(t.changes).forEach(r=>{let n=new oi(t.changes[r]);this._textEditChanges[r]=n})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(t){if(Us.is(t)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r={uri:t.uri,version:t.version},n=this._textEditChanges[r.uri];if(!n){let o=[],i={textDocument:r,edits:o};this._workspaceEdit.documentChanges.push(i),n=new oi(o,this._changeAnnotations),this._textEditChanges[r.uri]=n}return n}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let r=this._textEditChanges[t];if(!r){let n=[];this._workspaceEdit.changes[t]=n,r=new oi(n),this._textEditChanges[t]=r}return r}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new du,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;fn.is(r)||We.is(r)?o=r:n=r;let i,s;if(o===void 0?i=ii.create(t,n):(s=We.is(o)?o:this._changeAnnotations.manage(o),i=ii.create(t,n,s)),this._workspaceEdit.documentChanges.push(i),s!==void 0)return s}renameFile(t,r,n,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;fn.is(n)||We.is(n)?i=n:o=n;let s,a;if(i===void 0?s=si.create(t,r,o):(a=We.is(i)?i:this._changeAnnotations.manage(i),s=si.create(t,r,o,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;fn.is(r)||We.is(r)?o=r:n=r;let i,s;if(o===void 0?i=ai.create(t,n):(s=We.is(o)?o:this._changeAnnotations.manage(o),i=ai.create(t,n,s)),this._workspaceEdit.documentChanges.push(i),s!==void 0)return s}};(function(e){function t(n){return{uri:n}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)}e.is=r})(Hh||(Hh={}));(function(e){function t(n,o){return{uri:n,version:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&_.integer(o.version)}e.is=r})(Bh||(Bh={}));(function(e){function t(n,o){return{uri:n,version:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&(o.version===null||_.integer(o.version))}e.is=r})(Us||(Us={}));(function(e){e.ABAP="abap",e.WindowsBat="bat",e.BibTeX="bibtex",e.Clojure="clojure",e.Coffeescript="coffeescript",e.C="c",e.CPP="cpp",e.CSharp="csharp",e.CSS="css",e.D="d",e.Delphi="pascal",e.Diff="diff",e.Dart="dart",e.Dockerfile="dockerfile",e.Elixir="elixir",e.Erlang="erlang",e.FSharp="fsharp",e.GitCommit="git-commit",e.GitRebase="git-rebase",e.Go="go",e.Groovy="groovy",e.Handlebars="handlebars",e.Haskell="haskell",e.HTML="html",e.Ini="ini",e.Java="java",e.JavaScript="javascript",e.JavaScriptReact="javascriptreact",e.JSON="json",e.LaTeX="latex",e.Less="less",e.Lua="lua",e.Makefile="makefile",e.Markdown="markdown",e.ObjectiveC="objective-c",e.ObjectiveCPP="objective-cpp",e.Pascal="pascal",e.Perl="perl",e.Perl6="perl6",e.PHP="php",e.Plaintext="plaintext",e.Powershell="powershell",e.Pug="jade",e.Python="python",e.R="r",e.Razor="razor",e.Ruby="ruby",e.Rust="rust",e.SCSS="scss",e.SASS="sass",e.Scala="scala",e.ShaderLab="shaderlab",e.ShellScript="shellscript",e.SQL="sql",e.Swift="swift",e.TypeScript="typescript",e.TypeScriptReact="typescriptreact",e.TeX="tex",e.VisualBasic="vb",e.XML="xml",e.XSL="xsl",e.YAML="yaml"})(Wh||(Wh={}));(function(e){function t(n,o,i,s){return{uri:n,languageId:o,version:i,text:s}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.string(o.uri)&&_.string(o.languageId)&&_.integer(o.version)&&_.string(o.text)}e.is=r})(Jh||(Jh={}));(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){let n=r;return n===e.PlainText||n===e.Markdown}e.is=t})(fu||(fu={}));(function(e){function t(r){let n=r;return _.objectLiteral(r)&&fu.is(n.kind)&&_.string(n.value)}e.is=t})(pn||(pn={}));(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Gh||(Gh={}));(function(e){e.PlainText=1,e.Snippet=2})(Kh||(Kh={}));(function(e){e.Deprecated=1})(Xh||(Xh={}));(function(e){function t(n,o,i){return{newText:n,insert:o,replace:i}}e.create=t;function r(n){let o=n;return o&&_.string(o.newText)&&Ae.is(o.insert)&&Ae.is(o.replace)}e.is=r})(Yh||(Yh={}));(function(e){e.asIs=1,e.adjustIndentation=2})(Qh||(Qh={}));(function(e){e.Replace=1,e.Merge=2})(eg||(eg={}));(function(e){function t(r){let n=r;return n&&(_.string(n.detail)||n.detail===void 0)&&(_.string(n.description)||n.description===void 0)}e.is=t})(tg||(tg={}));(function(e){function t(r){return{label:r}}e.create=t})(rg||(rg={}));(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}e.create=t})(ng||(ng={}));(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function r(n){let o=n;return _.string(o)||_.objectLiteral(o)&&_.string(o.language)&&_.string(o.value)}e.is=r})(Vs||(Vs={}));(function(e){function t(r){let n=r;return!!n&&_.objectLiteral(n)&&(pn.is(n.contents)||Vs.is(n.contents)||_.typedArray(n.contents,Vs.is))&&(r.range===void 0||Ae.is(r.range))}e.is=t})(og||(og={}));(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}e.create=t})(ig||(ig={}));(function(e){function t(r,n,...o){let i={label:r};return _.defined(n)&&(i.documentation=n),_.defined(o)?i.parameters=o:i.parameters=[],i}e.create=t})(sg||(sg={}));(function(e){e.Text=1,e.Read=2,e.Write=3})(ag||(ag={}));(function(e){function t(r,n){let o={range:r};return _.number(n)&&(o.kind=n),o}e.create=t})(cg||(cg={}));(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(ug||(ug={}));(function(e){e.Deprecated=1})(lg||(lg={}));(function(e){function t(r,n,o,i,s){let a={name:r,kind:n,location:{uri:i,range:o}};return s&&(a.containerName=s),a}e.create=t})(dg||(dg={}));(function(e){function t(r,n,o,i){return i!==void 0?{name:r,kind:n,location:{uri:o,range:i}}:{name:r,kind:n,location:{uri:o}}}e.create=t})(fg||(fg={}));(function(e){function t(n,o,i,s,a,c){let u={name:n,detail:o,kind:i,range:s,selectionRange:a};return c!==void 0&&(u.children=c),u}e.create=t;function r(n){let o=n;return o&&_.string(o.name)&&_.number(o.kind)&&Ae.is(o.range)&&Ae.is(o.selectionRange)&&(o.detail===void 0||_.string(o.detail))&&(o.deprecated===void 0||_.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}e.is=r})(pg||(pg={}));(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorMove="refactor.move",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll",e.Notebook="notebook"})(mg||(mg={}));(function(e){e.Invoked=1,e.Automatic=2})(Hs||(Hs={}));(function(e){function t(n,o,i){let s={diagnostics:n};return o!=null&&(s.only=o),i!=null&&(s.triggerKind=i),s}e.create=t;function r(n){let o=n;return _.defined(o)&&_.typedArray(o.diagnostics,Ls.is)&&(o.only===void 0||_.typedArray(o.only,_.string))&&(o.triggerKind===void 0||o.triggerKind===Hs.Invoked||o.triggerKind===Hs.Automatic)}e.is=r})(hg||(hg={}));(function(e){e.LLMGenerated=1;function t(r){return _.defined(r)&&r===e.LLMGenerated}e.is=t})(pu||(pu={}));(function(e){function t(n,o,i){let s={title:n},a=!0;return typeof o=="string"?(a=!1,s.kind=o):co.is(o)?s.command=o:s.edit=o,a&&i!==void 0&&(s.kind=i),s}e.create=t;function r(n){let o=n;return o&&_.string(o.title)&&(o.diagnostics===void 0||_.typedArray(o.diagnostics,Ls.is))&&(o.kind===void 0||_.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||co.is(o.command))&&(o.isPreferred===void 0||_.boolean(o.isPreferred))&&(o.edit===void 0||lu.is(o.edit))&&(o.tags===void 0||_.typedArray(o.tags,pu.is))}e.is=r})(gg||(gg={}));(function(e){function t(n,o){let i={range:n};return _.defined(o)&&(i.data=o),i}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(o.range)&&(_.undefined(o.command)||co.is(o.command))}e.is=r})(yg||(yg={}));(function(e){function t(n,o){return{tabSize:n,insertSpaces:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&_.uinteger(o.tabSize)&&_.boolean(o.insertSpaces)}e.is=r})(_g||(_g={}));(function(e){function t(n,o,i){return{range:n,target:o,data:i}}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(o.range)&&(_.undefined(o.target)||_.string(o.target))}e.is=r})(vg||(vg={}));(function(e){function t(n,o){return{range:n,parent:o}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ae.is(o.range)&&(o.parent===void 0||e.is(o.parent))}e.is=r})(bg||(bg={}));(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator",e.label="label"})(wg||(wg={}));(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(xg||(xg={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}e.is=t})($g||($g={}));(function(e){function t(n,o){return{range:n,text:o}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&_.string(o.text)}e.is=r})(Sg||(Sg={}));(function(e){function t(n,o,i){return{range:n,variableName:o,caseSensitiveLookup:i}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&_.boolean(o.caseSensitiveLookup)&&(_.string(o.variableName)||o.variableName===void 0)}e.is=r})(kg||(kg={}));(function(e){function t(n,o){return{range:n,expression:o}}e.create=t;function r(n){let o=n;return o!=null&&Ae.is(o.range)&&(_.string(o.expression)||o.expression===void 0)}e.is=r})(Pg||(Pg={}));(function(e){function t(n,o){return{frameId:n,stoppedLocation:o}}e.create=t;function r(n){let o=n;return _.defined(o)&&Ae.is(n.stoppedLocation)}e.is=r})(Tg||(Tg={}));(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}e.is=t})(mu||(mu={}));(function(e){function t(n){return{value:n}}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&(o.tooltip===void 0||_.string(o.tooltip)||pn.is(o.tooltip))&&(o.location===void 0||Zs.is(o.location))&&(o.command===void 0||co.is(o.command))}e.is=r})(hu||(hu={}));(function(e){function t(n,o,i){let s={position:n,label:o};return i!==void 0&&(s.kind=i),s}e.create=t;function r(n){let o=n;return _.objectLiteral(o)&&Ht.is(o.position)&&(_.string(o.label)||_.typedArray(o.label,hu.is))&&(o.kind===void 0||mu.is(o.kind))&&o.textEdits===void 0||_.typedArray(o.textEdits,gr.is)&&(o.tooltip===void 0||_.string(o.tooltip)||pn.is(o.tooltip))&&(o.paddingLeft===void 0||_.boolean(o.paddingLeft))&&(o.paddingRight===void 0||_.boolean(o.paddingRight))}e.is=r})(Rg||(Rg={}));(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t;function r(n){let o=n;return _.objectLiteral(o)&&o.kind==="snippet"&&_.string(o.value)}e.isSnippet=r})(gu||(gu={}));(function(e){function t(r,n,o,i){return{insertText:r,filterText:n,range:o,command:i}}e.create=t})(zg||(zg={}));(function(e){function t(r){return{items:r}}e.create=t})(Eg||(Eg={}));(function(e){e.Invoked=1,e.Automatic=2})(Og||(Og={}));(function(e){function t(r,n){return{range:r,text:n}}e.create=t})(Cg||(Cg={}));(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}e.create=t})(jg||(jg={}));(function(e){function t(r){let n=r;return _.objectLiteral(n)&&au.is(n.uri)&&_.string(n.name)}e.is=t})(Ng||(Ng={}));dA=[`
17
17
  `,`\r
18
- `,"\r"];(function(e){function t(i,s,a,c){return new Mg(i,s,a,c)}e.create=t;function r(i){let s=i;return!!(_.defined(s)&&_.string(s.uri)&&(_.undefined(s.languageId)||_.string(s.languageId))&&_.uinteger(s.lineCount)&&_.func(s.getText)&&_.func(s.positionAt)&&_.func(s.offsetAt))}e.is=r;function n(i,s){let a=i.getText(),c=o(s,(l,d)=>{let h=l.range.start.line-d.range.start.line;return h===0?l.range.start.character-d.range.start.character:h}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],h=i.offsetAt(d.range.start),m=i.offsetAt(d.range.end);if(m<=u)a=a.substring(0,h)+d.newText+a.substring(m,a.length);else throw new Error("Overlapping edit");u=h}return a}e.applyEdits=n;function o(i,s){if(i.length<=1)return i;let a=i.length/2|0,c=i.slice(0,a),u=i.slice(a);o(c,s),o(u,s);let l=0,d=0,h=0;for(;l<c.length&&d<u.length;)s(c[l],u[d])<=0?i[h++]=c[l++]:i[h++]=u[d++];for(;l<c.length;)i[h++]=c[l++];for(;d<u.length;)i[h++]=u[d++];return i}})(jg||(jg={}));Mg=class{constructor(t,r,n,o){this._uri=t,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){this._content=t.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],r=this._content,n=!0;for(let o=0;o<r.length;o++){n&&(t.push(o),n=!1);let i=r.charAt(o);n=i==="\r"||i===`
18
+ `,"\r"];(function(e){function t(i,s,a,c){return new Mg(i,s,a,c)}e.create=t;function r(i){let s=i;return!!(_.defined(s)&&_.string(s.uri)&&(_.undefined(s.languageId)||_.string(s.languageId))&&_.uinteger(s.lineCount)&&_.func(s.getText)&&_.func(s.positionAt)&&_.func(s.offsetAt))}e.is=r;function n(i,s){let a=i.getText(),c=o(s,(l,d)=>{let h=l.range.start.line-d.range.start.line;return h===0?l.range.start.character-d.range.start.character:h}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],h=i.offsetAt(d.range.start),m=i.offsetAt(d.range.end);if(m<=u)a=a.substring(0,h)+d.newText+a.substring(m,a.length);else throw new Error("Overlapping edit");u=h}return a}e.applyEdits=n;function o(i,s){if(i.length<=1)return i;let a=i.length/2|0,c=i.slice(0,a),u=i.slice(a);o(c,s),o(u,s);let l=0,d=0,h=0;for(;l<c.length&&d<u.length;)s(c[l],u[d])<=0?i[h++]=c[l++]:i[h++]=u[d++];for(;l<c.length;)i[h++]=c[l++];for(;d<u.length;)i[h++]=u[d++];return i}})(Ig||(Ig={}));Mg=class{constructor(t,r,n,o){this._uri=t,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){this._content=t.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],r=this._content,n=!0;for(let o=0;o<r.length;o++){n&&(t.push(o),n=!1);let i=r.charAt(o);n=i==="\r"||i===`
19
19
  `,i==="\r"&&o+1<r.length&&r.charAt(o+1)===`
20
- `&&o++}n&&r.length>0&&t.push(r.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return Ht.create(0,t);for(;n<o;){let s=Math.floor((n+o)/2);r[s]>t?o=s:n=s+1}let i=n-1;return Ht.create(i,t-r[i])}offsetAt(t){let r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;let n=r[t.line],o=t.line+1<r.length?r[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,o),n)}get lineCount(){return this.getLineOffsets().length}};(function(e){let t=Object.prototype.toString;function r(m){return typeof m<"u"}e.defined=r;function n(m){return typeof m>"u"}e.undefined=n;function o(m){return m===!0||m===!1}e.boolean=o;function i(m){return t.call(m)==="[object String]"}e.string=i;function s(m){return t.call(m)==="[object Number]"}e.number=s;function a(m,p,y){return t.call(m)==="[object Number]"&&p<=m&&m<=y}e.numberRange=a;function c(m){return t.call(m)==="[object Number]"&&-2147483648<=m&&m<=2147483647}e.integer=c;function u(m){return t.call(m)==="[object Number]"&&0<=m&&m<=2147483647}e.uinteger=u;function l(m){return t.call(m)==="[object Function]"}e.func=l;function d(m){return m!==null&&typeof m=="object"}e.objectLiteral=d;function h(m,p){return Array.isArray(m)&&m.every(p)}e.typedArray=h})(_||(_={}))});var Re=k(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CM=dt.ProtocolNotificationType=dt.ProtocolNotificationType0=dt.ProtocolRequestType=dt.ProtocolRequestType0=dt.RegistrationType=dt.MessageDirection=void 0;var ai=Or(),n0;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(n0||(dt.MessageDirection=n0={}));var Ng=class{____;method;constructor(t){this.method=t}};dt.RegistrationType=Ng;var Ig=class extends ai.RequestType0{__;___;____;_pr;constructor(t){super(t)}};dt.ProtocolRequestType0=Ig;var Dg=class extends ai.RequestType{__;___;____;_pr;constructor(t){super(t,ai.ParameterStructures.byName)}};dt.ProtocolRequestType=Dg;var Ag=class extends ai.NotificationType0{___;____;constructor(t){super(t)}};dt.ProtocolNotificationType0=Ag;var qg=class extends ai.NotificationType{___;____;constructor(t){super(t,ai.ParameterStructures.byName)}};dt.ProtocolNotificationType=qg;var o0;(function(e){function t(r,n){return{client:r,server:n}}e.create=t})(o0||(dt.CM=o0={}))});var _u=k(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.boolean=aA;nr.string=i0;nr.number=cA;nr.error=uA;nr.func=lA;nr.array=s0;nr.stringArray=dA;nr.typedArray=fA;nr.objectLiteral=pA;function aA(e){return e===!0||e===!1}function i0(e){return typeof e=="string"||e instanceof String}function cA(e){return typeof e=="number"||e instanceof Number}function uA(e){return e instanceof Error}function lA(e){return typeof e=="function"}function s0(e){return Array.isArray(e)}function dA(e){return s0(e)&&e.every(t=>i0(t))}function fA(e,t){return Array.isArray(e)&&e.every(t)}function pA(e){return e!==null&&typeof e=="object"}});var c0=k(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.ImplementationRequest=void 0;var Zg=Re(),a0;(function(e){e.method="textDocument/implementation",e.messageDirection=Zg.MessageDirection.clientToServer,e.type=new Zg.ProtocolRequestType(e.method),e.capabilities=Zg.CM.create("textDocument.implementation","implementationProvider")})(a0||(vu.ImplementationRequest=a0={}))});var l0=k(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.TypeDefinitionRequest=void 0;var Lg=Re(),u0;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=Lg.MessageDirection.clientToServer,e.type=new Lg.ProtocolRequestType(e.method),e.capabilities=Lg.CM.create("textDocument.typeDefinition","typeDefinitionProvider")})(u0||(bu.TypeDefinitionRequest=u0={}))});var p0=k(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.DidChangeWorkspaceFoldersNotification=ui.WorkspaceFoldersRequest=void 0;var ci=Re(),d0;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=ci.MessageDirection.serverToClient,e.type=new ci.ProtocolRequestType0(e.method),e.capabilities=ci.CM.create("workspace.workspaceFolders","workspace.workspaceFolders")})(d0||(ui.WorkspaceFoldersRequest=d0={}));var f0;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=ci.MessageDirection.clientToServer,e.type=new ci.ProtocolNotificationType(e.method),e.capabilities=ci.CM.create(void 0,"workspace.workspaceFolders.changeNotifications")})(f0||(ui.DidChangeWorkspaceFoldersNotification=f0={}))});var h0=k(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.ConfigurationRequest=void 0;var Fg=Re(),m0;(function(e){e.method="workspace/configuration",e.messageDirection=Fg.MessageDirection.serverToClient,e.type=new Fg.ProtocolRequestType(e.method),e.capabilities=Fg.CM.create("workspace.configuration",void 0)})(m0||(wu.ConfigurationRequest=m0={}))});var _0=k(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.ColorPresentationRequest=di.DocumentColorRequest=void 0;var li=Re(),g0;(function(e){e.method="textDocument/documentColor",e.messageDirection=li.MessageDirection.clientToServer,e.type=new li.ProtocolRequestType(e.method),e.capabilities=li.CM.create("textDocument.colorProvider","colorProvider")})(g0||(di.DocumentColorRequest=g0={}));var y0;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=li.MessageDirection.clientToServer,e.type=new li.ProtocolRequestType(e.method),e.capabilities=li.CM.create("textDocument.colorProvider","colorProvider")})(y0||(di.ColorPresentationRequest=y0={}))});var w0=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.FoldingRangeRefreshRequest=pi.FoldingRangeRequest=void 0;var fi=Re(),v0;(function(e){e.method="textDocument/foldingRange",e.messageDirection=fi.MessageDirection.clientToServer,e.type=new fi.ProtocolRequestType(e.method),e.capabilities=fi.CM.create("textDocument.foldingRange","foldingRangeProvider")})(v0||(pi.FoldingRangeRequest=v0={}));var b0;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=fi.MessageDirection.serverToClient,e.type=new fi.ProtocolRequestType0(e.method),e.capabilities=fi.CM.create("workspace.foldingRange.refreshSupport",void 0)})(b0||(pi.FoldingRangeRefreshRequest=b0={}))});var $0=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.DeclarationRequest=void 0;var Ug=Re(),x0;(function(e){e.method="textDocument/declaration",e.messageDirection=Ug.MessageDirection.clientToServer,e.type=new Ug.ProtocolRequestType(e.method),e.capabilities=Ug.CM.create("textDocument.declaration","declarationProvider")})(x0||(xu.DeclarationRequest=x0={}))});var k0=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.SelectionRangeRequest=void 0;var Vg=Re(),S0;(function(e){e.method="textDocument/selectionRange",e.messageDirection=Vg.MessageDirection.clientToServer,e.type=new Vg.ProtocolRequestType(e.method),e.capabilities=Vg.CM.create("textDocument.selectionRange","selectionRangeProvider")})(S0||($u.SelectionRangeRequest=S0={}))});var R0=k(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.WorkDoneProgressCancelNotification=mn.WorkDoneProgressCreateRequest=mn.WorkDoneProgress=void 0;var mA=Or(),Hs=Re(),P0;(function(e){e.type=new mA.ProgressType;function t(r){return r===e.type}e.is=t})(P0||(mn.WorkDoneProgress=P0={}));var T0;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Hs.MessageDirection.serverToClient,e.type=new Hs.ProtocolRequestType(e.method),e.capabilities=Hs.CM.create("window.workDoneProgress",void 0)})(T0||(mn.WorkDoneProgressCreateRequest=T0={}));var z0;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Hs.MessageDirection.clientToServer,e.type=new Hs.ProtocolNotificationType(e.method)})(z0||(mn.WorkDoneProgressCancelNotification=z0={}))});var j0=k(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.CallHierarchyOutgoingCallsRequest=hn.CallHierarchyIncomingCallsRequest=hn.CallHierarchyPrepareRequest=void 0;var Mr=Re(),E0;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Mr.MessageDirection.clientToServer,e.type=new Mr.ProtocolRequestType(e.method),e.capabilities=Mr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(E0||(hn.CallHierarchyPrepareRequest=E0={}));var O0;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Mr.MessageDirection.clientToServer,e.type=new Mr.ProtocolRequestType(e.method),e.capabilities=Mr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(O0||(hn.CallHierarchyIncomingCallsRequest=O0={}));var C0;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Mr.MessageDirection.clientToServer,e.type=new Mr.ProtocolRequestType(e.method),e.capabilities=Mr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(C0||(hn.CallHierarchyOutgoingCallsRequest=C0={}))});var q0=k(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.SemanticTokensRefreshRequest=zt.SemanticTokensRangeRequest=zt.SemanticTokensDeltaRequest=zt.SemanticTokensRequest=zt.SemanticTokensRegistrationType=zt.TokenFormat=void 0;var Nt=Re(),M0;(function(e){e.Relative="relative"})(M0||(zt.TokenFormat=M0={}));var Bs;(function(e){e.method="textDocument/semanticTokens",e.type=new Nt.RegistrationType(e.method)})(Bs||(zt.SemanticTokensRegistrationType=Bs={}));var N0;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=Nt.MessageDirection.clientToServer,e.type=new Nt.ProtocolRequestType(e.method),e.registrationMethod=Bs.method,e.capabilities=Nt.CM.create("textDocument.semanticTokens","semanticTokensProvider")})(N0||(zt.SemanticTokensRequest=N0={}));var I0;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=Nt.MessageDirection.clientToServer,e.type=new Nt.ProtocolRequestType(e.method),e.registrationMethod=Bs.method,e.capabilities=Nt.CM.create("textDocument.semanticTokens.requests.full.delta","semanticTokensProvider.full.delta")})(I0||(zt.SemanticTokensDeltaRequest=I0={}));var D0;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=Nt.MessageDirection.clientToServer,e.type=new Nt.ProtocolRequestType(e.method),e.registrationMethod=Bs.method,e.capabilities=Nt.CM.create("textDocument.semanticTokens.requests.range","semanticTokensProvider.range")})(D0||(zt.SemanticTokensRangeRequest=D0={}));var A0;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=Nt.MessageDirection.serverToClient,e.type=new Nt.ProtocolRequestType0(e.method),e.capabilities=Nt.CM.create("workspace.semanticTokens.refreshSupport",void 0)})(A0||(zt.SemanticTokensRefreshRequest=A0={}))});var L0=k(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.ShowDocumentRequest=void 0;var Hg=Re(),Z0;(function(e){e.method="window/showDocument",e.messageDirection=Hg.MessageDirection.serverToClient,e.type=new Hg.ProtocolRequestType(e.method),e.capabilities=Hg.CM.create("window.showDocument.support",void 0)})(Z0||(Su.ShowDocumentRequest=Z0={}))});var U0=k(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.LinkedEditingRangeRequest=void 0;var Bg=Re(),F0;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=Bg.MessageDirection.clientToServer,e.type=new Bg.ProtocolRequestType(e.method),e.capabilities=Bg.CM.create("textDocument.linkedEditingRange","linkedEditingRangeProvider")})(F0||(ku.LinkedEditingRangeRequest=F0={}))});var X0=k(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.WillDeleteFilesRequest=ft.DidDeleteFilesNotification=ft.DidRenameFilesNotification=ft.WillRenameFilesRequest=ft.DidCreateFilesNotification=ft.WillCreateFilesRequest=ft.FileOperationPatternKind=void 0;var Je=Re(),V0;(function(e){e.file="file",e.folder="folder"})(V0||(ft.FileOperationPatternKind=V0={}));var H0;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willCreate","workspace.fileOperations.willCreate")})(H0||(ft.WillCreateFilesRequest=H0={}));var B0;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didCreate","workspace.fileOperations.didCreate")})(B0||(ft.DidCreateFilesNotification=B0={}));var W0;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willRename","workspace.fileOperations.willRename")})(W0||(ft.WillRenameFilesRequest=W0={}));var J0;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didRename","workspace.fileOperations.didRename")})(J0||(ft.DidRenameFilesNotification=J0={}));var G0;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didDelete","workspace.fileOperations.didDelete")})(G0||(ft.DidDeleteFilesNotification=G0={}));var K0;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willDelete","workspace.fileOperations.willDelete")})(K0||(ft.WillDeleteFilesRequest=K0={}))});var tS=k(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.MonikerRequest=gn.MonikerKind=gn.UniquenessLevel=void 0;var Wg=Re(),Y0;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(Y0||(gn.UniquenessLevel=Y0={}));var Q0;(function(e){e.$import="import",e.$export="export",e.local="local"})(Q0||(gn.MonikerKind=Q0={}));var eS;(function(e){e.method="textDocument/moniker",e.messageDirection=Wg.MessageDirection.clientToServer,e.type=new Wg.ProtocolRequestType(e.method),e.capabilities=Wg.CM.create("textDocument.moniker","monikerProvider")})(eS||(gn.MonikerRequest=eS={}))});var iS=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.TypeHierarchySubtypesRequest=yn.TypeHierarchySupertypesRequest=yn.TypeHierarchyPrepareRequest=void 0;var co=Re(),rS;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=co.MessageDirection.clientToServer,e.type=new co.ProtocolRequestType(e.method),e.capabilities=co.CM.create("textDocument.typeHierarchy","typeHierarchyProvider")})(rS||(yn.TypeHierarchyPrepareRequest=rS={}));var nS;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=co.MessageDirection.clientToServer,e.type=new co.ProtocolRequestType(e.method)})(nS||(yn.TypeHierarchySupertypesRequest=nS={}));var oS;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=co.MessageDirection.clientToServer,e.type=new co.ProtocolRequestType(e.method)})(oS||(yn.TypeHierarchySubtypesRequest=oS={}))});var cS=k(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InlineValueRefreshRequest=hi.InlineValueRequest=void 0;var mi=Re(),sS;(function(e){e.method="textDocument/inlineValue",e.messageDirection=mi.MessageDirection.clientToServer,e.type=new mi.ProtocolRequestType(e.method),e.capabilities=mi.CM.create("textDocument.inlineValue","inlineValueProvider")})(sS||(hi.InlineValueRequest=sS={}));var aS;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=mi.MessageDirection.serverToClient,e.type=new mi.ProtocolRequestType0(e.method),e.capabilities=mi.CM.create("workspace.inlineValue.refreshSupport",void 0)})(aS||(hi.InlineValueRefreshRequest=aS={}))});var fS=k(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.InlayHintRefreshRequest=_n.InlayHintResolveRequest=_n.InlayHintRequest=void 0;var Nr=Re(),uS;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method),e.capabilities=Nr.CM.create("textDocument.inlayHint","inlayHintProvider")})(uS||(_n.InlayHintRequest=uS={}));var lS;(function(e){e.method="inlayHint/resolve",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method),e.capabilities=Nr.CM.create("textDocument.inlayHint.resolveSupport","inlayHintProvider.resolveProvider")})(lS||(_n.InlayHintResolveRequest=lS={}));var dS;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Nr.MessageDirection.serverToClient,e.type=new Nr.ProtocolRequestType0(e.method),e.capabilities=Nr.CM.create("workspace.inlayHint.refreshSupport",void 0)})(dS||(_n.InlayHintRefreshRequest=dS={}))});var vS=k(Ge=>{"use strict";var hA=Ge&&Ge.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),gA=Ge&&Ge.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),yA=Ge&&Ge.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&hA(r,t,n[o]);return gA(r,t),r}})();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.DiagnosticRefreshRequest=Ge.WorkspaceDiagnosticRequest=Ge.DocumentDiagnosticRequest=Ge.DocumentDiagnosticReportKind=Ge.DiagnosticServerCancellationData=void 0;var _S=Or(),_A=yA(_u()),Ir=Re(),pS;(function(e){function t(r){let n=r;return n&&_A.boolean(n.retriggerRequest)}e.is=t})(pS||(Ge.DiagnosticServerCancellationData=pS={}));var mS;(function(e){e.Full="full",e.Unchanged="unchanged"})(mS||(Ge.DocumentDiagnosticReportKind=mS={}));var hS;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Ir.MessageDirection.clientToServer,e.type=new Ir.ProtocolRequestType(e.method),e.partialResult=new _S.ProgressType,e.capabilities=Ir.CM.create("textDocument.diagnostic","diagnosticProvider")})(hS||(Ge.DocumentDiagnosticRequest=hS={}));var gS;(function(e){e.method="workspace/diagnostic",e.messageDirection=Ir.MessageDirection.clientToServer,e.type=new Ir.ProtocolRequestType(e.method),e.partialResult=new _S.ProgressType,e.capabilities=Ir.CM.create("workspace.diagnostics","diagnosticProvider.workspaceDiagnostics")})(gS||(Ge.WorkspaceDiagnosticRequest=gS={}));var yS;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Ir.MessageDirection.serverToClient,e.type=new Ir.ProtocolRequestType0(e.method),e.capabilities=Ir.CM.create("workspace.diagnostics.refreshSupport",void 0)})(yS||(Ge.DiagnosticRefreshRequest=yS={}))});var PS=k(_e=>{"use strict";var vA=_e&&_e.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),bA=_e&&_e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wA=_e&&_e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&vA(r,t,n[o]);return bA(r,t),r}})();Object.defineProperty(_e,"__esModule",{value:!0});_e.DidCloseNotebookDocumentNotification=_e.DidSaveNotebookDocumentNotification=_e.DidChangeNotebookDocumentNotification=_e.NotebookCellArrayChange=_e.DidOpenNotebookDocumentNotification=_e.NotebookDocumentSyncRegistrationType=_e.NotebookDocument=_e.NotebookCell=_e.ExecutionSummary=_e.NotebookCellKind=void 0;var Ws=(yu(),Mu(gu)),or=wA(_u()),yr=Re(),Jg;(function(e){e.Markup=1,e.Code=2;function t(r){return r===1||r===2}e.is=t})(Jg||(_e.NotebookCellKind=Jg={}));var Gg;(function(e){function t(o,i){let s={executionOrder:o};return(i===!0||i===!1)&&(s.success=i),s}e.create=t;function r(o){let i=o;return or.objectLiteral(i)&&Ws.uinteger.is(i.executionOrder)&&(i.success===void 0||or.boolean(i.success))}e.is=r;function n(o,i){return o===i?!0:o==null||i===null||i===void 0?!1:o.executionOrder===i.executionOrder&&o.success===i.success}e.equals=n})(Gg||(_e.ExecutionSummary=Gg={}));var Pu;(function(e){function t(i,s){return{kind:i,document:s}}e.create=t;function r(i){let s=i;return or.objectLiteral(s)&&Jg.is(s.kind)&&Ws.DocumentUri.is(s.document)&&(s.metadata===void 0||or.objectLiteral(s.metadata))}e.is=r;function n(i,s){let a=new Set;return i.document!==s.document&&a.add("document"),i.kind!==s.kind&&a.add("kind"),i.executionSummary!==s.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||s.metadata!==void 0)&&!o(i.metadata,s.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||s.executionSummary!==void 0)&&!Gg.equals(i.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}e.diff=n;function o(i,s){if(i===s)return!0;if(i==null||s===null||s===void 0||typeof i!=typeof s||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(i.length!==s.length)return!1;for(let u=0;u<i.length;u++)if(!o(i[u],s[u]))return!1}if(or.objectLiteral(i)&&or.objectLiteral(s)){let u=Object.keys(i),l=Object.keys(s);if(u.length!==l.length||(u.sort(),l.sort(),!o(u,l)))return!1;for(let d=0;d<u.length;d++){let h=u[d];if(!o(i[h],s[h]))return!1}}return!0}})(Pu||(_e.NotebookCell=Pu={}));var bS;(function(e){function t(n,o,i,s){return{uri:n,notebookType:o,version:i,cells:s}}e.create=t;function r(n){let o=n;return or.objectLiteral(o)&&or.string(o.uri)&&Ws.integer.is(o.version)&&or.typedArray(o.cells,Pu.is)}e.is=r})(bS||(_e.NotebookDocument=bS={}));var gi;(function(e){e.method="notebookDocument/sync",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.RegistrationType(e.method)})(gi||(_e.NotebookDocumentSyncRegistrationType=gi={}));var wS;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=gi.method})(wS||(_e.DidOpenNotebookDocumentNotification=wS={}));var xS;(function(e){function t(n){let o=n;return or.objectLiteral(o)&&Ws.uinteger.is(o.start)&&Ws.uinteger.is(o.deleteCount)&&(o.cells===void 0||or.typedArray(o.cells,Pu.is))}e.is=t;function r(n,o,i){let s={start:n,deleteCount:o};return i!==void 0&&(s.cells=i),s}e.create=r})(xS||(_e.NotebookCellArrayChange=xS={}));var $S;(function(e){e.method="notebookDocument/didChange",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=gi.method})($S||(_e.DidChangeNotebookDocumentNotification=$S={}));var SS;(function(e){e.method="notebookDocument/didSave",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=gi.method})(SS||(_e.DidSaveNotebookDocumentNotification=SS={}));var kS;(function(e){e.method="notebookDocument/didClose",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=gi.method})(kS||(_e.DidCloseNotebookDocumentNotification=kS={}))});var zS=k(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.InlineCompletionRequest=void 0;var Kg=Re(),TS;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=Kg.MessageDirection.clientToServer,e.type=new Kg.ProtocolRequestType(e.method),e.capabilities=Kg.CM.create("textDocument.inlineCompletion","inlineCompletionProvider")})(TS||(Tu.InlineCompletionRequest=TS={}))});var OS=k(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.TextDocumentContentRefreshRequest=yi.TextDocumentContentRequest=void 0;var Js=Re(),RS;(function(e){e.method="workspace/textDocumentContent",e.messageDirection=Js.MessageDirection.clientToServer,e.type=new Js.ProtocolRequestType(e.method),e.capabilities=Js.CM.create("workspace.textDocumentContent","workspace.textDocumentContent")})(RS||(yi.TextDocumentContentRequest=RS={}));var ES;(function(e){e.method="workspace/textDocumentContent/refresh",e.messageDirection=Js.MessageDirection.serverToClient,e.type=new Js.ProtocolRequestType(e.method)})(ES||(yi.TextDocumentContentRefreshRequest=ES={}))});var Hk=k(f=>{"use strict";var xA=f&&f.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),$A=f&&f.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),SA=f&&f.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&xA(r,t,n[o]);return $A(r,t),r}})();Object.defineProperty(f,"__esModule",{value:!0});f.CodeActionRequest=f.DocumentSymbolRequest=f.DocumentHighlightRequest=f.ReferencesRequest=f.DefinitionRequest=f.SignatureHelpRequest=f.SignatureHelpTriggerKind=f.HoverRequest=f.CompletionResolveRequest=f.CompletionRequest=f.CompletionTriggerKind=f.PublishDiagnosticsNotification=f.WatchKind=f.GlobPattern=f.RelativePattern=f.FileChangeType=f.DidChangeWatchedFilesNotification=f.WillSaveTextDocumentWaitUntilRequest=f.WillSaveTextDocumentNotification=f.TextDocumentSaveReason=f.DidSaveTextDocumentNotification=f.DidCloseTextDocumentNotification=f.DidChangeTextDocumentNotification=f.TextDocumentContentChangeEvent=f.DidOpenTextDocumentNotification=f.TextDocumentSyncKind=f.TelemetryEventNotification=f.LogMessageNotification=f.ShowMessageRequest=f.ShowMessageNotification=f.MessageType=f.DidChangeConfigurationNotification=f.ExitNotification=f.ShutdownRequest=f.InitializedNotification=f.InitializeErrorCodes=f.InitializeRequest=f.WorkDoneProgressOptions=f.TextDocumentRegistrationOptions=f.StaticRegistrationOptions=f.PositionEncodingKind=f.RegularExpressionEngineKind=f.FailureHandlingKind=f.ResourceOperationKind=f.UnregistrationRequest=f.RegistrationRequest=f.DocumentSelector=f.NotebookCellTextDocumentFilter=f.NotebookDocumentFilter=f.TextDocumentFilter=void 0;f.UniquenessLevel=f.WillDeleteFilesRequest=f.DidDeleteFilesNotification=f.WillRenameFilesRequest=f.DidRenameFilesNotification=f.WillCreateFilesRequest=f.DidCreateFilesNotification=f.FileOperationPatternKind=f.LinkedEditingRangeRequest=f.ShowDocumentRequest=f.SemanticTokensRegistrationType=f.SemanticTokensRefreshRequest=f.SemanticTokensRangeRequest=f.SemanticTokensDeltaRequest=f.SemanticTokensRequest=f.TokenFormat=f.CallHierarchyPrepareRequest=f.CallHierarchyOutgoingCallsRequest=f.CallHierarchyIncomingCallsRequest=f.WorkDoneProgressCancelNotification=f.WorkDoneProgressCreateRequest=f.WorkDoneProgress=f.SelectionRangeRequest=f.DeclarationRequest=f.FoldingRangeRefreshRequest=f.FoldingRangeRequest=f.ColorPresentationRequest=f.DocumentColorRequest=f.ConfigurationRequest=f.DidChangeWorkspaceFoldersNotification=f.WorkspaceFoldersRequest=f.TypeDefinitionRequest=f.ImplementationRequest=f.ApplyWorkspaceEditRequest=f.ExecuteCommandRequest=f.PrepareRenameRequest=f.RenameRequest=f.PrepareSupportDefaultBehavior=f.DocumentOnTypeFormattingRequest=f.DocumentRangesFormattingRequest=f.DocumentRangeFormattingRequest=f.DocumentFormattingRequest=f.DocumentLinkResolveRequest=f.DocumentLinkRequest=f.CodeLensRefreshRequest=f.CodeLensResolveRequest=f.CodeLensRequest=f.WorkspaceSymbolResolveRequest=f.WorkspaceSymbolRequest=f.CodeActionResolveRequest=void 0;f.TextDocumentContentRefreshRequest=f.TextDocumentContentRequest=f.InlineCompletionRequest=f.DidCloseNotebookDocumentNotification=f.DidSaveNotebookDocumentNotification=f.DidChangeNotebookDocumentNotification=f.NotebookCellArrayChange=f.DidOpenNotebookDocumentNotification=f.NotebookDocumentSyncRegistrationType=f.NotebookDocument=f.NotebookCell=f.ExecutionSummary=f.NotebookCellKind=f.DiagnosticRefreshRequest=f.WorkspaceDiagnosticRequest=f.DocumentDiagnosticRequest=f.DocumentDiagnosticReportKind=f.DiagnosticServerCancellationData=f.InlayHintRefreshRequest=f.InlayHintResolveRequest=f.InlayHintRequest=f.InlineValueRefreshRequest=f.InlineValueRequest=f.TypeHierarchySupertypesRequest=f.TypeHierarchySubtypesRequest=f.TypeHierarchyPrepareRequest=f.MonikerRequest=f.MonikerKind=void 0;var $=Re(),CS=(yu(),Mu(gu)),Ke=SA(_u()),kA=c0();Object.defineProperty(f,"ImplementationRequest",{enumerable:!0,get:function(){return kA.ImplementationRequest}});var PA=l0();Object.defineProperty(f,"TypeDefinitionRequest",{enumerable:!0,get:function(){return PA.TypeDefinitionRequest}});var Zk=p0();Object.defineProperty(f,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Zk.WorkspaceFoldersRequest}});Object.defineProperty(f,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Zk.DidChangeWorkspaceFoldersNotification}});var TA=h0();Object.defineProperty(f,"ConfigurationRequest",{enumerable:!0,get:function(){return TA.ConfigurationRequest}});var Lk=_0();Object.defineProperty(f,"DocumentColorRequest",{enumerable:!0,get:function(){return Lk.DocumentColorRequest}});Object.defineProperty(f,"ColorPresentationRequest",{enumerable:!0,get:function(){return Lk.ColorPresentationRequest}});var Fk=w0();Object.defineProperty(f,"FoldingRangeRequest",{enumerable:!0,get:function(){return Fk.FoldingRangeRequest}});Object.defineProperty(f,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Fk.FoldingRangeRefreshRequest}});var zA=$0();Object.defineProperty(f,"DeclarationRequest",{enumerable:!0,get:function(){return zA.DeclarationRequest}});var RA=k0();Object.defineProperty(f,"SelectionRangeRequest",{enumerable:!0,get:function(){return RA.SelectionRangeRequest}});var ny=R0();Object.defineProperty(f,"WorkDoneProgress",{enumerable:!0,get:function(){return ny.WorkDoneProgress}});Object.defineProperty(f,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return ny.WorkDoneProgressCreateRequest}});Object.defineProperty(f,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return ny.WorkDoneProgressCancelNotification}});var oy=j0();Object.defineProperty(f,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return oy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(f,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return oy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(f,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return oy.CallHierarchyPrepareRequest}});var _i=q0();Object.defineProperty(f,"TokenFormat",{enumerable:!0,get:function(){return _i.TokenFormat}});Object.defineProperty(f,"SemanticTokensRequest",{enumerable:!0,get:function(){return _i.SemanticTokensRequest}});Object.defineProperty(f,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return _i.SemanticTokensDeltaRequest}});Object.defineProperty(f,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return _i.SemanticTokensRangeRequest}});Object.defineProperty(f,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return _i.SemanticTokensRefreshRequest}});Object.defineProperty(f,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return _i.SemanticTokensRegistrationType}});var EA=L0();Object.defineProperty(f,"ShowDocumentRequest",{enumerable:!0,get:function(){return EA.ShowDocumentRequest}});var OA=U0();Object.defineProperty(f,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return OA.LinkedEditingRangeRequest}});var uo=X0();Object.defineProperty(f,"FileOperationPatternKind",{enumerable:!0,get:function(){return uo.FileOperationPatternKind}});Object.defineProperty(f,"DidCreateFilesNotification",{enumerable:!0,get:function(){return uo.DidCreateFilesNotification}});Object.defineProperty(f,"WillCreateFilesRequest",{enumerable:!0,get:function(){return uo.WillCreateFilesRequest}});Object.defineProperty(f,"DidRenameFilesNotification",{enumerable:!0,get:function(){return uo.DidRenameFilesNotification}});Object.defineProperty(f,"WillRenameFilesRequest",{enumerable:!0,get:function(){return uo.WillRenameFilesRequest}});Object.defineProperty(f,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return uo.DidDeleteFilesNotification}});Object.defineProperty(f,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return uo.WillDeleteFilesRequest}});var iy=tS();Object.defineProperty(f,"UniquenessLevel",{enumerable:!0,get:function(){return iy.UniquenessLevel}});Object.defineProperty(f,"MonikerKind",{enumerable:!0,get:function(){return iy.MonikerKind}});Object.defineProperty(f,"MonikerRequest",{enumerable:!0,get:function(){return iy.MonikerRequest}});var sy=iS();Object.defineProperty(f,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return sy.TypeHierarchyPrepareRequest}});Object.defineProperty(f,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return sy.TypeHierarchySubtypesRequest}});Object.defineProperty(f,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return sy.TypeHierarchySupertypesRequest}});var Uk=cS();Object.defineProperty(f,"InlineValueRequest",{enumerable:!0,get:function(){return Uk.InlineValueRequest}});Object.defineProperty(f,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Uk.InlineValueRefreshRequest}});var ay=fS();Object.defineProperty(f,"InlayHintRequest",{enumerable:!0,get:function(){return ay.InlayHintRequest}});Object.defineProperty(f,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ay.InlayHintResolveRequest}});Object.defineProperty(f,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ay.InlayHintRefreshRequest}});var Gs=vS();Object.defineProperty(f,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Gs.DiagnosticServerCancellationData}});Object.defineProperty(f,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Gs.DocumentDiagnosticReportKind}});Object.defineProperty(f,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Gs.DocumentDiagnosticRequest}});Object.defineProperty(f,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Gs.WorkspaceDiagnosticRequest}});Object.defineProperty(f,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Gs.DiagnosticRefreshRequest}});var _r=PS();Object.defineProperty(f,"NotebookCellKind",{enumerable:!0,get:function(){return _r.NotebookCellKind}});Object.defineProperty(f,"ExecutionSummary",{enumerable:!0,get:function(){return _r.ExecutionSummary}});Object.defineProperty(f,"NotebookCell",{enumerable:!0,get:function(){return _r.NotebookCell}});Object.defineProperty(f,"NotebookDocument",{enumerable:!0,get:function(){return _r.NotebookDocument}});Object.defineProperty(f,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _r.NotebookDocumentSyncRegistrationType}});Object.defineProperty(f,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidOpenNotebookDocumentNotification}});Object.defineProperty(f,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _r.NotebookCellArrayChange}});Object.defineProperty(f,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidChangeNotebookDocumentNotification}});Object.defineProperty(f,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidSaveNotebookDocumentNotification}});Object.defineProperty(f,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidCloseNotebookDocumentNotification}});var CA=zS();Object.defineProperty(f,"InlineCompletionRequest",{enumerable:!0,get:function(){return CA.InlineCompletionRequest}});var Vk=OS();Object.defineProperty(f,"TextDocumentContentRequest",{enumerable:!0,get:function(){return Vk.TextDocumentContentRequest}});Object.defineProperty(f,"TextDocumentContentRefreshRequest",{enumerable:!0,get:function(){return Vk.TextDocumentContentRefreshRequest}});var Xg;(function(e){function t(r){let n=r;return Ke.string(n)||Ke.string(n.language)||Ke.string(n.scheme)||ry.is(n.pattern)}e.is=t})(Xg||(f.TextDocumentFilter=Xg={}));var Yg;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(Ke.string(n.notebookType)||Ke.string(n.scheme)||Ke.string(n.pattern))}e.is=t})(Yg||(f.NotebookDocumentFilter=Yg={}));var Qg;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(Ke.string(n.notebook)||Yg.is(n.notebook))&&(n.language===void 0||Ke.string(n.language))}e.is=t})(Qg||(f.NotebookCellTextDocumentFilter=Qg={}));var ey;(function(e){function t(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ke.string(n)&&!Xg.is(n)&&!Qg.is(n))return!1;return!0}e.is=t})(ey||(f.DocumentSelector=ey={}));var jS;(function(e){e.method="client/registerCapability",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method)})(jS||(f.RegistrationRequest=jS={}));var MS;(function(e){e.method="client/unregisterCapability",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method)})(MS||(f.UnregistrationRequest=MS={}));var NS;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(NS||(f.ResourceOperationKind=NS={}));var IS;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(IS||(f.FailureHandlingKind=IS={}));var DS;(function(e){e.ES2020="ES2020"})(DS||(f.RegularExpressionEngineKind=DS={}));var AS;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(AS||(f.PositionEncodingKind=AS={}));var qS;(function(e){function t(r){let n=r;return n&&Ke.string(n.id)&&n.id.length>0}e.hasId=t})(qS||(f.StaticRegistrationOptions=qS={}));var ZS;(function(e){function t(r){let n=r;return n&&(n.documentSelector===null||ey.is(n.documentSelector))}e.is=t})(ZS||(f.TextDocumentRegistrationOptions=ZS={}));var LS;(function(e){function t(n){let o=n;return Ke.objectLiteral(o)&&(o.workDoneProgress===void 0||Ke.boolean(o.workDoneProgress))}e.is=t;function r(n){let o=n;return o&&Ke.boolean(o.workDoneProgress)}e.hasWorkDoneProgress=r})(LS||(f.WorkDoneProgressOptions=LS={}));var FS;(function(e){e.method="initialize",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method)})(FS||(f.InitializeRequest=FS={}));var US;(function(e){e.unknownProtocolVersion=1})(US||(f.InitializeErrorCodes=US={}));var VS;(function(e){e.method="initialized",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method)})(VS||(f.InitializedNotification=VS={}));var HS;(function(e){e.method="shutdown",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType0(e.method)})(HS||(f.ShutdownRequest=HS={}));var BS;(function(e){e.method="exit",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType0(e.method)})(BS||(f.ExitNotification=BS={}));var WS;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("workspace.didChangeConfiguration",void 0)})(WS||(f.DidChangeConfigurationNotification=WS={}));var JS;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(JS||(f.MessageType=JS={}));var GS;(function(e){e.method="window/showMessage",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("window.showMessage",void 0)})(GS||(f.ShowMessageNotification=GS={}));var KS;(function(e){e.method="window/showMessageRequest",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("window.showMessage",void 0)})(KS||(f.ShowMessageRequest=KS={}));var XS;(function(e){e.method="window/logMessage",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method)})(XS||(f.LogMessageNotification=XS={}));var YS;(function(e){e.method="telemetry/event",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method)})(YS||(f.TelemetryEventNotification=YS={}));var QS;(function(e){e.None=0,e.Full=1,e.Incremental=2})(QS||(f.TextDocumentSyncKind=QS={}));var ek;(function(e){e.method="textDocument/didOpen",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(ek||(f.DidOpenTextDocumentNotification=ek={}));var tk;(function(e){function t(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}e.isIncremental=t;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}e.isFull=r})(tk||(f.TextDocumentContentChangeEvent=tk={}));var rk;(function(e){e.method="textDocument/didChange",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync")})(rk||(f.DidChangeTextDocumentNotification=rk={}));var nk;(function(e){e.method="textDocument/didClose",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(nk||(f.DidCloseTextDocumentNotification=nk={}));var ok;(function(e){e.method="textDocument/didSave",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.didSave","textDocumentSync.save")})(ok||(f.DidSaveTextDocumentNotification=ok={}));var ik;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(ik||(f.TextDocumentSaveReason=ik={}));var sk;(function(e){e.method="textDocument/willSave",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.willSave","textDocumentSync.willSave")})(sk||(f.WillSaveTextDocumentNotification=sk={}));var ak;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.willSaveWaitUntil","textDocumentSync.willSaveWaitUntil")})(ak||(f.WillSaveTextDocumentWaitUntilRequest=ak={}));var ck;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("workspace.didChangeWatchedFiles",void 0)})(ck||(f.DidChangeWatchedFilesNotification=ck={}));var uk;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(uk||(f.FileChangeType=uk={}));var ty;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(CS.URI.is(n.baseUri)||CS.WorkspaceFolder.is(n.baseUri))&&Ke.string(n.pattern)}e.is=t})(ty||(f.RelativePattern=ty={}));var ry;(function(e){function t(r){let n=r;return Ke.string(n)||ty.is(n)}e.is=t})(ry||(f.GlobPattern=ry={}));var lk;(function(e){e.Create=1,e.Change=2,e.Delete=4})(lk||(f.WatchKind=lk={}));var dk;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.publishDiagnostics",void 0)})(dk||(f.PublishDiagnosticsNotification=dk={}));var fk;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(fk||(f.CompletionTriggerKind=fk={}));var pk;(function(e){e.method="textDocument/completion",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.completion","completionProvider")})(pk||(f.CompletionRequest=pk={}));var mk;(function(e){e.method="completionItem/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.completion.completionItem.resolveSupport","completionProvider.resolveProvider")})(mk||(f.CompletionResolveRequest=mk={}));var hk;(function(e){e.method="textDocument/hover",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.hover","hoverProvider")})(hk||(f.HoverRequest=hk={}));var gk;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(gk||(f.SignatureHelpTriggerKind=gk={}));var yk;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.signatureHelp","signatureHelpProvider")})(yk||(f.SignatureHelpRequest=yk={}));var _k;(function(e){e.method="textDocument/definition",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.definition","definitionProvider")})(_k||(f.DefinitionRequest=_k={}));var vk;(function(e){e.method="textDocument/references",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.references","referencesProvider")})(vk||(f.ReferencesRequest=vk={}));var bk;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentHighlight","documentHighlightProvider")})(bk||(f.DocumentHighlightRequest=bk={}));var wk;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentSymbol","documentSymbolProvider")})(wk||(f.DocumentSymbolRequest=wk={}));var xk;(function(e){e.method="textDocument/codeAction",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeAction","codeActionProvider")})(xk||(f.CodeActionRequest=xk={}));var $k;(function(e){e.method="codeAction/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeAction.resolveSupport","codeActionProvider.resolveProvider")})($k||(f.CodeActionResolveRequest=$k={}));var Sk;(function(e){e.method="workspace/symbol",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.symbol","workspaceSymbolProvider")})(Sk||(f.WorkspaceSymbolRequest=Sk={}));var kk;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.symbol.resolveSupport","workspaceSymbolProvider.resolveProvider")})(kk||(f.WorkspaceSymbolResolveRequest=kk={}));var Pk;(function(e){e.method="textDocument/codeLens",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeLens","codeLensProvider")})(Pk||(f.CodeLensRequest=Pk={}));var Tk;(function(e){e.method="codeLens/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeLens.resolveSupport","codeLensProvider.resolveProvider")})(Tk||(f.CodeLensResolveRequest=Tk={}));var zk;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType0(e.method),e.capabilities=$.CM.create("workspace.codeLens",void 0)})(zk||(f.CodeLensRefreshRequest=zk={}));var Rk;(function(e){e.method="textDocument/documentLink",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentLink","documentLinkProvider")})(Rk||(f.DocumentLinkRequest=Rk={}));var Ek;(function(e){e.method="documentLink/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentLink","documentLinkProvider.resolveProvider")})(Ek||(f.DocumentLinkResolveRequest=Ek={}));var Ok;(function(e){e.method="textDocument/formatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.formatting","documentFormattingProvider")})(Ok||(f.DocumentFormattingRequest=Ok={}));var Ck;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rangeFormatting","documentRangeFormattingProvider")})(Ck||(f.DocumentRangeFormattingRequest=Ck={}));var jk;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rangeFormatting.rangesSupport","documentRangeFormattingProvider.rangesSupport")})(jk||(f.DocumentRangesFormattingRequest=jk={}));var Mk;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.onTypeFormatting","documentOnTypeFormattingProvider")})(Mk||(f.DocumentOnTypeFormattingRequest=Mk={}));var Nk;(function(e){e.Identifier=1})(Nk||(f.PrepareSupportDefaultBehavior=Nk={}));var Ik;(function(e){e.method="textDocument/rename",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rename","renameProvider")})(Ik||(f.RenameRequest=Ik={}));var Dk;(function(e){e.method="textDocument/prepareRename",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rename.prepareSupport","renameProvider.prepareProvider")})(Dk||(f.PrepareRenameRequest=Dk={}));var Ak;(function(e){e.method="workspace/executeCommand",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.executeCommand","executeCommandProvider")})(Ak||(f.ExecuteCommandRequest=Ak={}));var qk;(function(e){e.method="workspace/applyEdit",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType("workspace/applyEdit"),e.capabilities=$.CM.create("workspace.applyEdit",void 0)})(qk||(f.ApplyWorkspaceEditRequest=qk={}))});var Wk=k(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.createProtocolConnection=jA;var Bk=Or();function jA(e,t,r,n){return Bk.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Bk.createMessageConnection)(e,t,r,n)}});var uy=k(Rt=>{"use strict";var MA=Rt&&Rt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),zu=Rt&&Rt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&MA(t,e,r)};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.LSPErrorCodes=Rt.createProtocolConnection=void 0;zu(Or(),Rt);zu((yu(),Mu(gu)),Rt);zu(Re(),Rt);zu(Hk(),Rt);var NA=Wk();Object.defineProperty(Rt,"createProtocolConnection",{enumerable:!0,get:function(){return NA.createProtocolConnection}});var Jk;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(Jk||(Rt.LSPErrorCodes=Jk={}))});var Kk=k(Dr=>{"use strict";var IA=Dr&&Dr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Gk=Dr&&Dr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&IA(t,e,r)};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createProtocolConnection=AA;var DA=Eh();Gk(Eh(),Dr);Gk(uy(),Dr);function AA(e,t,r,n){return(0,DA.createMessageConnection)(e,t,r,n)}});import{extname as VA}from"node:path";var Vr={};Ys(Vr,{BRAND:()=>JP,DIRTY:()=>xn,EMPTY_PATH:()=>PP,INVALID:()=>H,NEVER:()=>OT,OK:()=>ot,ParseStatus:()=>Xe,Schema:()=>Y,ZodAny:()=>Fr,ZodArray:()=>Sr,ZodBigInt:()=>Sn,ZodBoolean:()=>kn,ZodBranded:()=>Pi,ZodCatch:()=>In,ZodDate:()=>Pn,ZodDefault:()=>Nn,ZodDiscriminatedUnion:()=>ra,ZodEffects:()=>Dt,ZodEnum:()=>jn,ZodError:()=>vt,ZodFirstPartyTypeKind:()=>E,ZodFunction:()=>oa,ZodIntersection:()=>En,ZodIssueCode:()=>z,ZodLazy:()=>On,ZodLiteral:()=>Cn,ZodMap:()=>bo,ZodNaN:()=>xo,ZodNativeEnum:()=>Mn,ZodNever:()=>Wt,ZodNull:()=>zn,ZodNullable:()=>ur,ZodNumber:()=>$n,ZodObject:()=>wt,ZodOptional:()=>bt,ZodParsedType:()=>M,ZodPipeline:()=>Ti,ZodPromise:()=>Ur,ZodReadonly:()=>Dn,ZodRecord:()=>na,ZodSchema:()=>Y,ZodSet:()=>wo,ZodString:()=>Lr,ZodSymbol:()=>_o,ZodTransformer:()=>Dt,ZodTuple:()=>cr,ZodType:()=>Y,ZodUndefined:()=>Tn,ZodUnion:()=>Rn,ZodUnknown:()=>$r,ZodVoid:()=>vo,addIssueToContext:()=>j,any:()=>nT,array:()=>aT,bigint:()=>YP,boolean:()=>Oy,coerce:()=>ET,custom:()=>zy,date:()=>QP,datetimeRegex:()=>Py,defaultErrorMap:()=>wr,discriminatedUnion:()=>lT,effect:()=>xT,enum:()=>vT,function:()=>gT,getErrorMap:()=>ho,getParsedType:()=>ar,instanceof:()=>KP,intersection:()=>dT,isAborted:()=>ea,isAsync:()=>go,isDirty:()=>ta,isValid:()=>Zr,late:()=>GP,lazy:()=>yT,literal:()=>_T,makeIssue:()=>ki,map:()=>mT,nan:()=>XP,nativeEnum:()=>bT,never:()=>iT,null:()=>rT,nullable:()=>ST,number:()=>Ey,object:()=>Au,objectUtil:()=>Nu,oboolean:()=>RT,onumber:()=>zT,optional:()=>$T,ostring:()=>TT,pipeline:()=>PT,preprocess:()=>kT,promise:()=>wT,quotelessJson:()=>$P,record:()=>pT,set:()=>hT,setErrorMap:()=>kP,strictObject:()=>cT,string:()=>Ry,symbol:()=>eT,transformer:()=>xT,tuple:()=>fT,undefined:()=>tT,union:()=>uT,unknown:()=>oT,util:()=>re,void:()=>sT});var re;(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})(re||(re={}));var Nu;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Nu||(Nu={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ar=e=>{switch(typeof e){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(e)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(e)?M.array:e===null?M.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?M.promise:typeof Map<"u"&&e instanceof Map?M.map:typeof Set<"u"&&e instanceof Set?M.set:typeof Date<"u"&&e instanceof Date?M.date:M.object;default:return M.unknown}};var z=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$P=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),vt=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,re.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()}};vt.create=e=>new vt(e);var SP=(e,t)=>{let r;switch(e.code){case z.invalid_type:e.received===M.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case z.invalid_union:r="Invalid input";break;case z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case z.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case z.invalid_arguments:r="Invalid function arguments";break;case z.invalid_return_type:r="Invalid function return type";break;case z.invalid_date:r="Invalid date";break;case z.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}"`:re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case z.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 z.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 z.custom:r="Invalid input";break;case z.invalid_intersection_types:r="Intersection results could not be merged";break;case z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case z.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},wr=SP;var wy=wr;function kP(e){wy=e}function ho(){return wy}var ki=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}},PP=[];function j(e,t){let r=ho(),n=ki({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wr?void 0:wr].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 H;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 H;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}}},H=Object.freeze({status:"aborted"}),xn=e=>({status:"dirty",value:e}),ot=e=>({status:"valid",value:e}),ea=e=>e.status==="aborted",ta=e=>e.status==="dirty",Zr=e=>e.status==="valid",go=e=>typeof Promise<"u"&&e instanceof Promise;var q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(q||(q={}));var It=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}},xy=(e,t)=>{if(Zr(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 vt(e.common.issues);return this._error=r,this._error}}};function K(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 Y=class{get description(){return this._def.description}_getType(t){return ar(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ar(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:ar(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(go(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:ar(t)},o=this._parseSync({data:t,path:n.path,parent:n});return xy(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ar(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Zr(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=>Zr(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:ar(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(go(o)?o:Promise.resolve(o));return xy(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:z.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 Dt({schema:this,typeName:E.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 bt.create(this,this._def)}nullable(){return ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sr.create(this)}promise(){return Ur.create(this,this._def)}or(t){return Rn.create([this,t],this._def)}and(t){return En.create(this,t,this._def)}transform(t){return new Dt({...K(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Nn({...K(this._def),innerType:this,defaultValue:r,typeName:E.ZodDefault})}brand(){return new Pi({typeName:E.ZodBranded,type:this,...K(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new In({...K(this._def),innerType:this,catchValue:r,typeName:E.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ti.create(this,t)}readonly(){return Dn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TP=/^c[^\s-]{8,}$/i,zP=/^[0-9a-z]+$/,RP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EP=/^[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,OP=/^[a-z0-9_-]{21}$/i,CP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jP=/^[-+]?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)?)??$/,MP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,NP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Iu,IP=/^(?:(?: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])$/,DP=/^(?:(?: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])$/,AP=/^(([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]))$/,qP=/^(([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])$/,ZP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sy="((\\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])))",FP=new RegExp(`^${Sy}$`);function ky(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 UP(e){return new RegExp(`^${ky(e)}$`)}function Py(e){let t=`${Sy}T${ky(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 VP(e,t){return!!((t==="v4"||!t)&&IP.test(e)||(t==="v6"||!t)&&AP.test(e))}function HP(e,t){if(!CP.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 BP(e,t){return!!((t==="v4"||!t)&&DP.test(e)||(t==="v6"||!t)&&qP.test(e))}var Lr=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.string){let i=this._getOrReturnCtx(t);return j(i,{code:z.invalid_type,expected:M.string,received:i.parsedType}),H}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),j(o,{code:z.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),j(o,{code:z.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?j(o,{code:z.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&j(o,{code:z.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")MP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"email",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Iu||(Iu=new RegExp(NP,"u")),Iu.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"emoji",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")EP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"uuid",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")OP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"nanoid",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")TP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cuid",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")zP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cuid2",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")RP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"ulid",code:z.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),j(o,{validation:"url",code:z.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),j(o,{validation:"regex",code:z.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),j(o,{code:z.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),j(o,{code:z.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),j(o,{code:z.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Py(i).test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:z.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?FP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:z.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?UP(i).test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:z.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"duration",code:z.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?VP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"ip",code:z.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?HP(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"jwt",code:z.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?BP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cidr",code:z.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ZP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"base64",code:z.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?LP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"base64url",code:z.invalid_string,message:i.message}),n.dirty()):re.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:z.invalid_string,...q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.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,...q.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,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...q.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...q.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...q.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...q.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...q.errToObj(r)})}nonempty(t){return this.min(1,q.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}};Lr.create=e=>new Lr({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,...K(e)});function WP(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 $n=class e extends Y{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)!==M.number){let i=this._getOrReturnCtx(t);return j(i,{code:z.invalid_type,expected:M.number,received:i.parsedType}),H}let n,o=new Xe;for(let i of this._def.checks)i.kind==="int"?re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),j(n,{code:z.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),j(n,{code:z.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),j(n,{code:z.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?WP(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),j(n,{code:z.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),j(n,{code:z.not_finite,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.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"&&re.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)}};$n.create=e=>new $n({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,...K(e)});var Sn=class e extends Y{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)!==M.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),j(n,{code:z.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),j(n,{code:z.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),j(n,{code:z.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return j(r,{code:z.invalid_type,expected:M.bigint,received:r.parsedType}),H}gte(t,r){return this.setLimit("min",t,!0,q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.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:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.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}};Sn.create=e=>new Sn({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,...K(e)});var kn=class extends Y{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.boolean){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.boolean,received:n.parsedType}),H}return ot(t.data)}};kn.create=e=>new kn({typeName:E.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var Pn=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.date){let i=this._getOrReturnCtx(t);return j(i,{code:z.invalid_type,expected:M.date,received:i.parsedType}),H}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return j(i,{code:z.invalid_date}),H}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),j(o,{code:z.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),j(o,{code:z.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):re.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:q.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:q.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}};Pn.create=e=>new Pn({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,...K(e)});var _o=class extends Y{_parse(t){if(this._getType(t)!==M.symbol){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.symbol,received:n.parsedType}),H}return ot(t.data)}};_o.create=e=>new _o({typeName:E.ZodSymbol,...K(e)});var Tn=class extends Y{_parse(t){if(this._getType(t)!==M.undefined){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.undefined,received:n.parsedType}),H}return ot(t.data)}};Tn.create=e=>new Tn({typeName:E.ZodUndefined,...K(e)});var zn=class extends Y{_parse(t){if(this._getType(t)!==M.null){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.null,received:n.parsedType}),H}return ot(t.data)}};zn.create=e=>new zn({typeName:E.ZodNull,...K(e)});var Fr=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return ot(t.data)}};Fr.create=e=>new Fr({typeName:E.ZodAny,...K(e)});var $r=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ot(t.data)}};$r.create=e=>new $r({typeName:E.ZodUnknown,...K(e)});var Wt=class extends Y{_parse(t){let r=this._getOrReturnCtx(t);return j(r,{code:z.invalid_type,expected:M.never,received:r.parsedType}),H}};Wt.create=e=>new Wt({typeName:E.ZodNever,...K(e)});var vo=class extends Y{_parse(t){if(this._getType(t)!==M.undefined){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.void,received:n.parsedType}),H}return ot(t.data)}};vo.create=e=>new vo({typeName:E.ZodVoid,...K(e)});var Sr=class e extends Y{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==M.array)return j(r,{code:z.invalid_type,expected:M.array,received:r.parsedType}),H;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(j(r,{code:s?z.too_big:z.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&&(j(r,{code:z.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&&(j(r,{code:z.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 It(r,s,r.path,a)))).then(s=>Xe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new It(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:q.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:q.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:q.toString(r)}})}nonempty(t){return this.min(1,t)}};Sr.create=(e,t)=>new Sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...K(t)});function yo(e){if(e instanceof wt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=bt.create(yo(n))}return new wt({...e._def,shape:()=>t})}else return e instanceof Sr?new Sr({...e._def,type:yo(e.element)}):e instanceof bt?bt.create(yo(e.unwrap())):e instanceof ur?ur.create(yo(e.unwrap())):e instanceof cr?cr.create(e.items.map(t=>yo(t))):e}var wt=class e extends Y{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=re.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==M.object){let u=this._getOrReturnCtx(t);return j(u,{code:z.invalid_type,expected:M.object,received:u.parsedType}),H}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wt&&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 It(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Wt){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&&(j(o,{code:z.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 It(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,h=await l.value;u.push({key:d,value:h,alwaysSet:l.alwaysSet})}return u}).then(u=>Xe.mergeObjectSync(n,u)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return q.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:q.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:E.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 re.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 re.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return yo(this)}partial(t){let r={};for(let n of re.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 re.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof bt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Ty(re.objectKeys(this.shape))}};wt.create=(e,t)=>new wt({shape:()=>e,unknownKeys:"strip",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});wt.strictCreate=(e,t)=>new wt({shape:()=>e,unknownKeys:"strict",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});wt.lazycreate=(e,t)=>new wt({shape:e,unknownKeys:"strip",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});var Rn=class extends Y{_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 vt(a.ctx.common.issues));return j(r,{code:z.invalid_union,unionErrors:s}),H}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 vt(c));return j(r,{code:z.invalid_union,unionErrors:a}),H}}get options(){return this._def.options}};Rn.create=(e,t)=>new Rn({options:e,typeName:E.ZodUnion,...K(t)});var xr=e=>e instanceof On?xr(e.schema):e instanceof Dt?xr(e.innerType()):e instanceof Cn?[e.value]:e instanceof jn?e.options:e instanceof Mn?re.objectValues(e.enum):e instanceof Nn?xr(e._def.innerType):e instanceof Tn?[void 0]:e instanceof zn?[null]:e instanceof bt?[void 0,...xr(e.unwrap())]:e instanceof ur?[null,...xr(e.unwrap())]:e instanceof Pi||e instanceof Dn?xr(e.unwrap()):e instanceof In?xr(e._def.innerType):[],ra=class e extends Y{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==M.object)return j(r,{code:z.invalid_type,expected:M.object,received:r.parsedType}),H;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}):(j(r,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),H)}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=xr(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:E.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...K(n)})}};function Du(e,t){let r=ar(e),n=ar(t);if(e===t)return{valid:!0,data:e};if(r===M.object&&n===M.object){let o=re.objectKeys(t),i=re.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Du(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===M.array&&n===M.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=Du(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===M.date&&n===M.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var En=class extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(ea(i)||ea(s))return H;let a=Du(i.value,s.value);return a.valid?((ta(i)||ta(s))&&r.dirty(),{status:r.value,value:a.data}):(j(n,{code:z.invalid_intersection_types}),H)};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}))}};En.create=(e,t,r)=>new En({left:e,right:t,typeName:E.ZodIntersection,...K(r)});var cr=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.array)return j(n,{code:z.invalid_type,expected:M.array,received:n.parsedType}),H;if(n.data.length<this._def.items.length)return j(n,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;!this._def.rest&&n.data.length>this._def.items.length&&(j(n,{code:z.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 It(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})}};cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cr({items:e,typeName:E.ZodTuple,rest:null,...K(t)})};var na=class e extends Y{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!==M.object)return j(n,{code:z.invalid_type,expected:M.object,received:n.parsedType}),H;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new It(n,a,n.path,a)),value:s._parse(new It(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 Y?new e({keyType:t,valueType:r,typeName:E.ZodRecord,...K(n)}):new e({keyType:Lr.create(),valueType:t,typeName:E.ZodRecord,...K(r)})}},bo=class extends Y{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!==M.map)return j(n,{code:z.invalid_type,expected:M.map,received:n.parsedType}),H;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new It(n,a,n.path,[u,"key"])),value:i._parse(new It(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 H;(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 H;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};bo.create=(e,t,r)=>new bo({valueType:t,keyType:e,typeName:E.ZodMap,...K(r)});var wo=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==M.set)return j(n,{code:z.invalid_type,expected:M.set,received:n.parsedType}),H;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(j(n,{code:z.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&&(j(n,{code:z.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 H;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 It(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:q.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:q.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};wo.create=(e,t)=>new wo({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,...K(t)});var oa=class e extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==M.function)return j(r,{code:z.invalid_type,expected:M.function,received:r.parsedType}),H;function n(a,c){return ki({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ho(),wr].filter(u=>!!u),issueData:{code:z.invalid_arguments,argumentsError:c}})}function o(a,c){return ki({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ho(),wr].filter(u=>!!u),issueData:{code:z.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Ur){let a=this;return ot(async function(...c){let u=new vt([]),l=await a._def.args.parseAsync(c,i).catch(m=>{throw u.addIssue(n(c,m)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{let a=this;return ot(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new vt([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new vt([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:cr.create(t).rest($r.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||cr.create([]).rest($r.create()),returns:r||$r.create(),typeName:E.ZodFunction,...K(n)})}},On=class extends Y{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})}};On.create=(e,t)=>new On({getter:e,typeName:E.ZodLazy,...K(t)});var Cn=class extends Y{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return j(r,{received:r.data,code:z.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};Cn.create=(e,t)=>new Cn({value:e,typeName:E.ZodLiteral,...K(t)});function Ty(e,t){return new jn({values:e,typeName:E.ZodEnum,...K(t)})}var jn=class e extends Y{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return j(r,{expected:re.joinValues(n),received:r.parsedType,code:z.invalid_type}),H}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 j(r,{received:r.data,code:z.invalid_enum_value,options:n}),H}return ot(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})}};jn.create=Ty;var Mn=class extends Y{_parse(t){let r=re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==M.string&&n.parsedType!==M.number){let o=re.objectValues(r);return j(n,{expected:re.joinValues(o),received:n.parsedType,code:z.invalid_type}),H}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=re.objectValues(r);return j(n,{received:n.data,code:z.invalid_enum_value,options:o}),H}return ot(t.data)}get enum(){return this._def.values}};Mn.create=(e,t)=>new Mn({values:e,typeName:E.ZodNativeEnum,...K(t)});var Ur=class extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==M.promise&&r.common.async===!1)return j(r,{code:z.invalid_type,expected:M.promise,received:r.parsedType}),H;let n=r.parsedType===M.promise?r.data:Promise.resolve(r.data);return ot(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ur.create=(e,t)=>new Ur({type:e,typeName:E.ZodPromise,...K(t)});var Dt=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.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=>{j(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 H;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?H:c.status==="dirty"?xn(c.value):r.value==="dirty"?xn(c.value):c});{if(r.value==="aborted")return H;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?H:a.status==="dirty"?xn(a.value):r.value==="dirty"?xn(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"?H:(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"?H:(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(!Zr(s))return H;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=>Zr(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):H);re.assertNever(o)}};Dt.create=(e,t,r)=>new Dt({schema:e,typeName:E.ZodEffects,effect:t,...K(r)});Dt.createWithPreprocess=(e,t,r)=>new Dt({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,...K(r)});var bt=class extends Y{_parse(t){return this._getType(t)===M.undefined?ot(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};bt.create=(e,t)=>new bt({innerType:e,typeName:E.ZodOptional,...K(t)});var ur=class extends Y{_parse(t){return this._getType(t)===M.null?ot(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:E.ZodNullable,...K(t)});var Nn=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===M.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nn.create=(e,t)=>new Nn({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(t)});var In=class extends Y{_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 go(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new vt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new vt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};In.create=(e,t)=>new In({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var xo=class extends Y{_parse(t){if(this._getType(t)!==M.nan){let n=this._getOrReturnCtx(t);return j(n,{code:z.invalid_type,expected:M.nan,received:n.parsedType}),H}return{status:"valid",value:t.data}}};xo.create=e=>new xo({typeName:E.ZodNaN,...K(e)});var JP=Symbol("zod_brand"),Pi=class extends Y{_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}},Ti=class e extends Y{_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"?H:i.status==="dirty"?(r.dirty(),xn(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"?H: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:E.ZodPipeline})}},Dn=class extends Y{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Zr(o)&&(o.value=Object.freeze(o.value)),o);return go(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Dn.create=(e,t)=>new Dn({innerType:e,typeName:E.ZodReadonly,...K(t)});function $y(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function zy(e,t={},r){return e?Fr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=$y(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=$y(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Fr.create()}var GP={object:wt.lazycreate},E;(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"})(E||(E={}));var KP=(e,t={message:`Input not instance of ${e.name}`})=>zy(r=>r instanceof e,t),Ry=Lr.create,Ey=$n.create,XP=xo.create,YP=Sn.create,Oy=kn.create,QP=Pn.create,eT=_o.create,tT=Tn.create,rT=zn.create,nT=Fr.create,oT=$r.create,iT=Wt.create,sT=vo.create,aT=Sr.create,Au=wt.create,cT=wt.strictCreate,uT=Rn.create,lT=ra.create,dT=En.create,fT=cr.create,pT=na.create,mT=bo.create,hT=wo.create,gT=oa.create,yT=On.create,_T=Cn.create,vT=jn.create,bT=Mn.create,wT=Ur.create,xT=Dt.create,$T=bt.create,ST=ur.create,kT=Dt.createWithPreprocess,PT=Ti.create,TT=()=>Ry().optional(),zT=()=>Ey().optional(),RT=()=>Oy().optional(),ET={string:(e=>Lr.create({...e,coerce:!0})),number:(e=>$n.create({...e,coerce:!0})),boolean:(e=>kn.create({...e,coerce:!0})),bigint:(e=>Sn.create({...e,coerce:!0})),date:(e=>Pn.create({...e,coerce:!0}))};var OT=H;var CT=Object.freeze({status:"aborted"});function x(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 kr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ia={};function Et(e){return e&&Object.assign(ia,e),ia}var ne={};Ys(ne,{BIGINT_FORMAT_RANGES:()=>jy,Class:()=>Zu,NUMBER_FORMAT_RANGES:()=>Wu,aborted:()=>qn,allowsEval:()=>Vu,assert:()=>DT,assertEqual:()=>jT,assertIs:()=>NT,assertNever:()=>IT,assertNotEqual:()=>MT,assignProp:()=>Uu,cached:()=>Ei,captureStackTrace:()=>aa,cleanEnum:()=>KT,cleanRegex:()=>Ci,clone:()=>Ot,createTransparentProxy:()=>UT,defineLazy:()=>be,esc:()=>An,escapeRegex:()=>Hr,extend:()=>BT,finalizeIssue:()=>Jt,floatSafeRemainder:()=>Fu,getElementAtPath:()=>AT,getEnumValues:()=>Ri,getLengthableOrigin:()=>ji,getParsedType:()=>FT,getSizableOrigin:()=>My,isObject:()=>$o,isPlainObject:()=>So,issue:()=>Ju,joinValues:()=>sa,jsonStringifyReplacer:()=>Lu,merge:()=>WT,normalizeParams:()=>B,nullish:()=>Oi,numKeys:()=>LT,omit:()=>HT,optionalKeys:()=>Bu,partial:()=>JT,pick:()=>VT,prefixIssues:()=>lr,primitiveTypes:()=>Cy,promiseAllObject:()=>qT,propertyKeyTypes:()=>Hu,randomString:()=>ZT,required:()=>GT,stringifyPrimitive:()=>ca,unwrapMessage:()=>zi});function jT(e){return e}function MT(e){return e}function NT(e){}function IT(e){throw new Error}function DT(e){}function Ri(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 sa(e,t="|"){return e.map(r=>ca(r)).join(t)}function Lu(e,t){return typeof t=="bigint"?t.toString():t}function Ei(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Oi(e){return e==null}function Ci(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Fu(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 be(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 Uu(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function AT(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function qT(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 ZT(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function An(e){return JSON.stringify(e)}var aa=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function $o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Vu=Ei(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function So(e){if($o(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!($o(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function LT(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var FT=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}`)}},Hu=new Set(["string","number","symbol"]),Cy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Hr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function B(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 UT(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 ca(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Bu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Wu={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]},jy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function VT(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 Ot(e,{...e._zod.def,shape:r,checks:[]})}function HT(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 Ot(e,{...e._zod.def,shape:r,checks:[]})}function BT(e,t){if(!So(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 Uu(this,"shape",n),n},checks:[]};return Ot(e,r)}function WT(e,t){return Ot(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Uu(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function JT(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 Ot(t,{...t._zod.def,shape:o,checks:[]})}function GT(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 Ot(t,{...t._zod.def,shape:o,checks:[]})}function qn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function lr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function zi(e){return typeof e=="string"?e:e?.message}function Jt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=zi(e.inst?._zod.def?.error?.(e))??zi(t?.error?.(e))??zi(r.customError?.(e))??zi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function My(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ji(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ju(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function KT(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Zu=class{constructor(...t){}};var Ny=(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,Lu,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ua=x("$ZodError",Ny),Mi=x("$ZodError",Ny,{Parent:Error});function Gu(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 Ku(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 Xu=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 kr;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Jt(c,i,Et())));throw aa(a,o?.callee),a}return s.value},Yu=Xu(Mi),Qu=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=>Jt(c,i,Et())));throw aa(a,o?.callee),a}return s.value},el=Qu(Mi),tl=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 kr;return i.issues.length?{success:!1,error:new(e??ua)(i.issues.map(s=>Jt(s,o,Et())))}:{success:!0,data:i.value}},Zn=tl(Mi),rl=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=>Jt(s,o,Et())))}:{success:!0,data:i.value}},Ln=rl(Mi);var Iy=/^[cC][^\s-]{8,}$/,Dy=/^[0-9a-z]+$/,Ay=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qy=/^[0-9a-vA-V]{20}$/,Zy=/^[A-Za-z0-9]{27}$/,Ly=/^[a-zA-Z0-9_-]{21}$/,Fy=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Uy=/^([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})$/,nl=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 Vy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hy(){return new RegExp(YT,"u")}var By=/^(?:(?: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])$/,Wy=/^(([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})$/,Jy=/^((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])$/,Gy=/^(([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])$/,Ky=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ol=/^[A-Za-z0-9_-]*$/,Xy=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var Yy=/^\+(?:[0-9]){6,14}[0-9]$/,Qy="(?:(?:\\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])))",e_=new RegExp(`^${Qy}$`);function t_(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 r_(e){return new RegExp(`^${t_(e)}$`)}function n_(e){let t=t_({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(`^${Qy}T(?:${n})$`)}var o_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var i_=/^\d+$/,s_=/^-?\d+(?:\.\d+)?/i,a_=/true|false/i,c_=/null/i;var u_=/^[^A-Z]*$/,l_=/^[^a-z]*$/;var Ye=x("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),d_={number:"number",bigint:"bigint",object:"date"},il=x("$ZodCheckLessThan",(e,t)=>{Ye.init(e,t);let r=d_[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})}}),sl=x("$ZodCheckGreaterThan",(e,t)=>{Ye.init(e,t);let r=d_[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})}}),f_=x("$ZodCheckMultipleOf",(e,t)=>{Ye.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):Fu(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})}}),p_=x("$ZodCheckNumberFormat",(e,t)=>{Ye.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Wu[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=i_)}),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 m_=x("$ZodCheckMaxLength",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Oi(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=ji(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),h_=x("$ZodCheckMinLength",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Oi(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=ji(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),g_=x("$ZodCheckLengthEquals",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Oi(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=ji(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})}}),Ni=x("$ZodCheckStringFormat",(e,t)=>{var r,n;Ye.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=()=>{})}),y_=x("$ZodCheckRegex",(e,t)=>{Ni.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})}}),__=x("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=u_),Ni.init(e,t)}),v_=x("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=l_),Ni.init(e,t)}),b_=x("$ZodCheckIncludes",(e,t)=>{Ye.init(e,t);let r=Hr(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})}}),w_=x("$ZodCheckStartsWith",(e,t)=>{Ye.init(e,t);let r=new RegExp(`^${Hr(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})}}),x_=x("$ZodCheckEndsWith",(e,t)=>{Ye.init(e,t);let r=new RegExp(`.*${Hr(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 $_=x("$ZodCheckOverwrite",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var da=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(`
20
+ `&&o++}n&&r.length>0&&t.push(r.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return Ht.create(0,t);for(;n<o;){let s=Math.floor((n+o)/2);r[s]>t?o=s:n=s+1}let i=n-1;return Ht.create(i,t-r[i])}offsetAt(t){let r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;let n=r[t.line],o=t.line+1<r.length?r[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,o),n)}get lineCount(){return this.getLineOffsets().length}};(function(e){let t=Object.prototype.toString;function r(m){return typeof m<"u"}e.defined=r;function n(m){return typeof m>"u"}e.undefined=n;function o(m){return m===!0||m===!1}e.boolean=o;function i(m){return t.call(m)==="[object String]"}e.string=i;function s(m){return t.call(m)==="[object Number]"}e.number=s;function a(m,p,y){return t.call(m)==="[object Number]"&&p<=m&&m<=y}e.numberRange=a;function c(m){return t.call(m)==="[object Number]"&&-2147483648<=m&&m<=2147483647}e.integer=c;function u(m){return t.call(m)==="[object Number]"&&0<=m&&m<=2147483647}e.uinteger=u;function l(m){return t.call(m)==="[object Function]"}e.func=l;function d(m){return m!==null&&typeof m=="object"}e.objectLiteral=d;function h(m,p){return Array.isArray(m)&&m.every(p)}e.typedArray=h})(_||(_={}))});var ze=k(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CM=dt.ProtocolNotificationType=dt.ProtocolNotificationType0=dt.ProtocolRequestType=dt.ProtocolRequestType0=dt.RegistrationType=dt.MessageDirection=void 0;var ci=Or(),s0;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(s0||(dt.MessageDirection=s0={}));var Dg=class{____;method;constructor(t){this.method=t}};dt.RegistrationType=Dg;var Ag=class extends ci.RequestType0{__;___;____;_pr;constructor(t){super(t)}};dt.ProtocolRequestType0=Ag;var qg=class extends ci.RequestType{__;___;____;_pr;constructor(t){super(t,ci.ParameterStructures.byName)}};dt.ProtocolRequestType=qg;var Zg=class extends ci.NotificationType0{___;____;constructor(t){super(t)}};dt.ProtocolNotificationType0=Zg;var Lg=class extends ci.NotificationType{___;____;constructor(t){super(t,ci.ParameterStructures.byName)}};dt.ProtocolNotificationType=Lg;var a0;(function(e){function t(r,n){return{client:r,server:n}}e.create=t})(a0||(dt.CM=a0={}))});var vu=k(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.boolean=fA;nr.string=c0;nr.number=pA;nr.error=mA;nr.func=hA;nr.array=u0;nr.stringArray=gA;nr.typedArray=yA;nr.objectLiteral=_A;function fA(e){return e===!0||e===!1}function c0(e){return typeof e=="string"||e instanceof String}function pA(e){return typeof e=="number"||e instanceof Number}function mA(e){return e instanceof Error}function hA(e){return typeof e=="function"}function u0(e){return Array.isArray(e)}function gA(e){return u0(e)&&e.every(t=>c0(t))}function yA(e,t){return Array.isArray(e)&&e.every(t)}function _A(e){return e!==null&&typeof e=="object"}});var d0=k(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.ImplementationRequest=void 0;var Fg=ze(),l0;(function(e){e.method="textDocument/implementation",e.messageDirection=Fg.MessageDirection.clientToServer,e.type=new Fg.ProtocolRequestType(e.method),e.capabilities=Fg.CM.create("textDocument.implementation","implementationProvider")})(l0||(bu.ImplementationRequest=l0={}))});var p0=k(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.TypeDefinitionRequest=void 0;var Ug=ze(),f0;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=Ug.MessageDirection.clientToServer,e.type=new Ug.ProtocolRequestType(e.method),e.capabilities=Ug.CM.create("textDocument.typeDefinition","typeDefinitionProvider")})(f0||(wu.TypeDefinitionRequest=f0={}))});var g0=k(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.DidChangeWorkspaceFoldersNotification=li.WorkspaceFoldersRequest=void 0;var ui=ze(),m0;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=ui.MessageDirection.serverToClient,e.type=new ui.ProtocolRequestType0(e.method),e.capabilities=ui.CM.create("workspace.workspaceFolders","workspace.workspaceFolders")})(m0||(li.WorkspaceFoldersRequest=m0={}));var h0;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=ui.MessageDirection.clientToServer,e.type=new ui.ProtocolNotificationType(e.method),e.capabilities=ui.CM.create(void 0,"workspace.workspaceFolders.changeNotifications")})(h0||(li.DidChangeWorkspaceFoldersNotification=h0={}))});var _0=k(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.ConfigurationRequest=void 0;var Vg=ze(),y0;(function(e){e.method="workspace/configuration",e.messageDirection=Vg.MessageDirection.serverToClient,e.type=new Vg.ProtocolRequestType(e.method),e.capabilities=Vg.CM.create("workspace.configuration",void 0)})(y0||(xu.ConfigurationRequest=y0={}))});var w0=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.ColorPresentationRequest=fi.DocumentColorRequest=void 0;var di=ze(),v0;(function(e){e.method="textDocument/documentColor",e.messageDirection=di.MessageDirection.clientToServer,e.type=new di.ProtocolRequestType(e.method),e.capabilities=di.CM.create("textDocument.colorProvider","colorProvider")})(v0||(fi.DocumentColorRequest=v0={}));var b0;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=di.MessageDirection.clientToServer,e.type=new di.ProtocolRequestType(e.method),e.capabilities=di.CM.create("textDocument.colorProvider","colorProvider")})(b0||(fi.ColorPresentationRequest=b0={}))});var S0=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.FoldingRangeRefreshRequest=mi.FoldingRangeRequest=void 0;var pi=ze(),x0;(function(e){e.method="textDocument/foldingRange",e.messageDirection=pi.MessageDirection.clientToServer,e.type=new pi.ProtocolRequestType(e.method),e.capabilities=pi.CM.create("textDocument.foldingRange","foldingRangeProvider")})(x0||(mi.FoldingRangeRequest=x0={}));var $0;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=pi.MessageDirection.serverToClient,e.type=new pi.ProtocolRequestType0(e.method),e.capabilities=pi.CM.create("workspace.foldingRange.refreshSupport",void 0)})($0||(mi.FoldingRangeRefreshRequest=$0={}))});var P0=k($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.DeclarationRequest=void 0;var Hg=ze(),k0;(function(e){e.method="textDocument/declaration",e.messageDirection=Hg.MessageDirection.clientToServer,e.type=new Hg.ProtocolRequestType(e.method),e.capabilities=Hg.CM.create("textDocument.declaration","declarationProvider")})(k0||($u.DeclarationRequest=k0={}))});var R0=k(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.SelectionRangeRequest=void 0;var Bg=ze(),T0;(function(e){e.method="textDocument/selectionRange",e.messageDirection=Bg.MessageDirection.clientToServer,e.type=new Bg.ProtocolRequestType(e.method),e.capabilities=Bg.CM.create("textDocument.selectionRange","selectionRangeProvider")})(T0||(Su.SelectionRangeRequest=T0={}))});var C0=k(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.WorkDoneProgressCancelNotification=mn.WorkDoneProgressCreateRequest=mn.WorkDoneProgress=void 0;var vA=Or(),Bs=ze(),z0;(function(e){e.type=new vA.ProgressType;function t(r){return r===e.type}e.is=t})(z0||(mn.WorkDoneProgress=z0={}));var E0;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Bs.MessageDirection.serverToClient,e.type=new Bs.ProtocolRequestType(e.method),e.capabilities=Bs.CM.create("window.workDoneProgress",void 0)})(E0||(mn.WorkDoneProgressCreateRequest=E0={}));var O0;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Bs.MessageDirection.clientToServer,e.type=new Bs.ProtocolNotificationType(e.method)})(O0||(mn.WorkDoneProgressCancelNotification=O0={}))});var M0=k(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.CallHierarchyOutgoingCallsRequest=hn.CallHierarchyIncomingCallsRequest=hn.CallHierarchyPrepareRequest=void 0;var Nr=ze(),j0;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method),e.capabilities=Nr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(j0||(hn.CallHierarchyPrepareRequest=j0={}));var N0;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method),e.capabilities=Nr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(N0||(hn.CallHierarchyIncomingCallsRequest=N0={}));var I0;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Nr.MessageDirection.clientToServer,e.type=new Nr.ProtocolRequestType(e.method),e.capabilities=Nr.CM.create("textDocument.callHierarchy","callHierarchyProvider")})(I0||(hn.CallHierarchyOutgoingCallsRequest=I0={}))});var F0=k(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.SemanticTokensRefreshRequest=Rt.SemanticTokensRangeRequest=Rt.SemanticTokensDeltaRequest=Rt.SemanticTokensRequest=Rt.SemanticTokensRegistrationType=Rt.TokenFormat=void 0;var It=ze(),D0;(function(e){e.Relative="relative"})(D0||(Rt.TokenFormat=D0={}));var Ws;(function(e){e.method="textDocument/semanticTokens",e.type=new It.RegistrationType(e.method)})(Ws||(Rt.SemanticTokensRegistrationType=Ws={}));var A0;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=It.MessageDirection.clientToServer,e.type=new It.ProtocolRequestType(e.method),e.registrationMethod=Ws.method,e.capabilities=It.CM.create("textDocument.semanticTokens","semanticTokensProvider")})(A0||(Rt.SemanticTokensRequest=A0={}));var q0;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=It.MessageDirection.clientToServer,e.type=new It.ProtocolRequestType(e.method),e.registrationMethod=Ws.method,e.capabilities=It.CM.create("textDocument.semanticTokens.requests.full.delta","semanticTokensProvider.full.delta")})(q0||(Rt.SemanticTokensDeltaRequest=q0={}));var Z0;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=It.MessageDirection.clientToServer,e.type=new It.ProtocolRequestType(e.method),e.registrationMethod=Ws.method,e.capabilities=It.CM.create("textDocument.semanticTokens.requests.range","semanticTokensProvider.range")})(Z0||(Rt.SemanticTokensRangeRequest=Z0={}));var L0;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=It.MessageDirection.serverToClient,e.type=new It.ProtocolRequestType0(e.method),e.capabilities=It.CM.create("workspace.semanticTokens.refreshSupport",void 0)})(L0||(Rt.SemanticTokensRefreshRequest=L0={}))});var V0=k(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.ShowDocumentRequest=void 0;var Wg=ze(),U0;(function(e){e.method="window/showDocument",e.messageDirection=Wg.MessageDirection.serverToClient,e.type=new Wg.ProtocolRequestType(e.method),e.capabilities=Wg.CM.create("window.showDocument.support",void 0)})(U0||(ku.ShowDocumentRequest=U0={}))});var B0=k(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.LinkedEditingRangeRequest=void 0;var Jg=ze(),H0;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=Jg.MessageDirection.clientToServer,e.type=new Jg.ProtocolRequestType(e.method),e.capabilities=Jg.CM.create("textDocument.linkedEditingRange","linkedEditingRangeProvider")})(H0||(Pu.LinkedEditingRangeRequest=H0={}))});var eS=k(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.WillDeleteFilesRequest=ft.DidDeleteFilesNotification=ft.DidRenameFilesNotification=ft.WillRenameFilesRequest=ft.DidCreateFilesNotification=ft.WillCreateFilesRequest=ft.FileOperationPatternKind=void 0;var Je=ze(),W0;(function(e){e.file="file",e.folder="folder"})(W0||(ft.FileOperationPatternKind=W0={}));var J0;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willCreate","workspace.fileOperations.willCreate")})(J0||(ft.WillCreateFilesRequest=J0={}));var G0;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didCreate","workspace.fileOperations.didCreate")})(G0||(ft.DidCreateFilesNotification=G0={}));var K0;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willRename","workspace.fileOperations.willRename")})(K0||(ft.WillRenameFilesRequest=K0={}));var X0;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didRename","workspace.fileOperations.didRename")})(X0||(ft.DidRenameFilesNotification=X0={}));var Y0;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolNotificationType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.didDelete","workspace.fileOperations.didDelete")})(Y0||(ft.DidDeleteFilesNotification=Y0={}));var Q0;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=Je.MessageDirection.clientToServer,e.type=new Je.ProtocolRequestType(e.method),e.capabilities=Je.CM.create("workspace.fileOperations.willDelete","workspace.fileOperations.willDelete")})(Q0||(ft.WillDeleteFilesRequest=Q0={}))});var oS=k(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.MonikerRequest=gn.MonikerKind=gn.UniquenessLevel=void 0;var Gg=ze(),tS;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(tS||(gn.UniquenessLevel=tS={}));var rS;(function(e){e.$import="import",e.$export="export",e.local="local"})(rS||(gn.MonikerKind=rS={}));var nS;(function(e){e.method="textDocument/moniker",e.messageDirection=Gg.MessageDirection.clientToServer,e.type=new Gg.ProtocolRequestType(e.method),e.capabilities=Gg.CM.create("textDocument.moniker","monikerProvider")})(nS||(gn.MonikerRequest=nS={}))});var cS=k(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.TypeHierarchySubtypesRequest=yn.TypeHierarchySupertypesRequest=yn.TypeHierarchyPrepareRequest=void 0;var uo=ze(),iS;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=uo.MessageDirection.clientToServer,e.type=new uo.ProtocolRequestType(e.method),e.capabilities=uo.CM.create("textDocument.typeHierarchy","typeHierarchyProvider")})(iS||(yn.TypeHierarchyPrepareRequest=iS={}));var sS;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=uo.MessageDirection.clientToServer,e.type=new uo.ProtocolRequestType(e.method)})(sS||(yn.TypeHierarchySupertypesRequest=sS={}));var aS;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=uo.MessageDirection.clientToServer,e.type=new uo.ProtocolRequestType(e.method)})(aS||(yn.TypeHierarchySubtypesRequest=aS={}))});var dS=k(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.InlineValueRefreshRequest=gi.InlineValueRequest=void 0;var hi=ze(),uS;(function(e){e.method="textDocument/inlineValue",e.messageDirection=hi.MessageDirection.clientToServer,e.type=new hi.ProtocolRequestType(e.method),e.capabilities=hi.CM.create("textDocument.inlineValue","inlineValueProvider")})(uS||(gi.InlineValueRequest=uS={}));var lS;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=hi.MessageDirection.serverToClient,e.type=new hi.ProtocolRequestType0(e.method),e.capabilities=hi.CM.create("workspace.inlineValue.refreshSupport",void 0)})(lS||(gi.InlineValueRefreshRequest=lS={}))});var hS=k(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.InlayHintRefreshRequest=_n.InlayHintResolveRequest=_n.InlayHintRequest=void 0;var Ir=ze(),fS;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Ir.MessageDirection.clientToServer,e.type=new Ir.ProtocolRequestType(e.method),e.capabilities=Ir.CM.create("textDocument.inlayHint","inlayHintProvider")})(fS||(_n.InlayHintRequest=fS={}));var pS;(function(e){e.method="inlayHint/resolve",e.messageDirection=Ir.MessageDirection.clientToServer,e.type=new Ir.ProtocolRequestType(e.method),e.capabilities=Ir.CM.create("textDocument.inlayHint.resolveSupport","inlayHintProvider.resolveProvider")})(pS||(_n.InlayHintResolveRequest=pS={}));var mS;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Ir.MessageDirection.serverToClient,e.type=new Ir.ProtocolRequestType0(e.method),e.capabilities=Ir.CM.create("workspace.inlayHint.refreshSupport",void 0)})(mS||(_n.InlayHintRefreshRequest=mS={}))});var xS=k(Ge=>{"use strict";var bA=Ge&&Ge.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),wA=Ge&&Ge.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xA=Ge&&Ge.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&bA(r,t,n[o]);return wA(r,t),r}})();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.DiagnosticRefreshRequest=Ge.WorkspaceDiagnosticRequest=Ge.DocumentDiagnosticRequest=Ge.DocumentDiagnosticReportKind=Ge.DiagnosticServerCancellationData=void 0;var wS=Or(),$A=xA(vu()),Mr=ze(),gS;(function(e){function t(r){let n=r;return n&&$A.boolean(n.retriggerRequest)}e.is=t})(gS||(Ge.DiagnosticServerCancellationData=gS={}));var yS;(function(e){e.Full="full",e.Unchanged="unchanged"})(yS||(Ge.DocumentDiagnosticReportKind=yS={}));var _S;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Mr.MessageDirection.clientToServer,e.type=new Mr.ProtocolRequestType(e.method),e.partialResult=new wS.ProgressType,e.capabilities=Mr.CM.create("textDocument.diagnostic","diagnosticProvider")})(_S||(Ge.DocumentDiagnosticRequest=_S={}));var vS;(function(e){e.method="workspace/diagnostic",e.messageDirection=Mr.MessageDirection.clientToServer,e.type=new Mr.ProtocolRequestType(e.method),e.partialResult=new wS.ProgressType,e.capabilities=Mr.CM.create("workspace.diagnostics","diagnosticProvider.workspaceDiagnostics")})(vS||(Ge.WorkspaceDiagnosticRequest=vS={}));var bS;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Mr.MessageDirection.serverToClient,e.type=new Mr.ProtocolRequestType0(e.method),e.capabilities=Mr.CM.create("workspace.diagnostics.refreshSupport",void 0)})(bS||(Ge.DiagnosticRefreshRequest=bS={}))});var zS=k(_e=>{"use strict";var SA=_e&&_e.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),kA=_e&&_e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),PA=_e&&_e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&SA(r,t,n[o]);return kA(r,t),r}})();Object.defineProperty(_e,"__esModule",{value:!0});_e.DidCloseNotebookDocumentNotification=_e.DidSaveNotebookDocumentNotification=_e.DidChangeNotebookDocumentNotification=_e.NotebookCellArrayChange=_e.DidOpenNotebookDocumentNotification=_e.NotebookDocumentSyncRegistrationType=_e.NotebookDocument=_e.NotebookCell=_e.ExecutionSummary=_e.NotebookCellKind=void 0;var Js=(_u(),Mu(yu)),or=PA(vu()),yr=ze(),Kg;(function(e){e.Markup=1,e.Code=2;function t(r){return r===1||r===2}e.is=t})(Kg||(_e.NotebookCellKind=Kg={}));var Xg;(function(e){function t(o,i){let s={executionOrder:o};return(i===!0||i===!1)&&(s.success=i),s}e.create=t;function r(o){let i=o;return or.objectLiteral(i)&&Js.uinteger.is(i.executionOrder)&&(i.success===void 0||or.boolean(i.success))}e.is=r;function n(o,i){return o===i?!0:o==null||i===null||i===void 0?!1:o.executionOrder===i.executionOrder&&o.success===i.success}e.equals=n})(Xg||(_e.ExecutionSummary=Xg={}));var Tu;(function(e){function t(i,s){return{kind:i,document:s}}e.create=t;function r(i){let s=i;return or.objectLiteral(s)&&Kg.is(s.kind)&&Js.DocumentUri.is(s.document)&&(s.metadata===void 0||or.objectLiteral(s.metadata))}e.is=r;function n(i,s){let a=new Set;return i.document!==s.document&&a.add("document"),i.kind!==s.kind&&a.add("kind"),i.executionSummary!==s.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||s.metadata!==void 0)&&!o(i.metadata,s.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||s.executionSummary!==void 0)&&!Xg.equals(i.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}e.diff=n;function o(i,s){if(i===s)return!0;if(i==null||s===null||s===void 0||typeof i!=typeof s||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(s);if(a!==c)return!1;if(a&&c){if(i.length!==s.length)return!1;for(let u=0;u<i.length;u++)if(!o(i[u],s[u]))return!1}if(or.objectLiteral(i)&&or.objectLiteral(s)){let u=Object.keys(i),l=Object.keys(s);if(u.length!==l.length||(u.sort(),l.sort(),!o(u,l)))return!1;for(let d=0;d<u.length;d++){let h=u[d];if(!o(i[h],s[h]))return!1}}return!0}})(Tu||(_e.NotebookCell=Tu={}));var $S;(function(e){function t(n,o,i,s){return{uri:n,notebookType:o,version:i,cells:s}}e.create=t;function r(n){let o=n;return or.objectLiteral(o)&&or.string(o.uri)&&Js.integer.is(o.version)&&or.typedArray(o.cells,Tu.is)}e.is=r})($S||(_e.NotebookDocument=$S={}));var yi;(function(e){e.method="notebookDocument/sync",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.RegistrationType(e.method)})(yi||(_e.NotebookDocumentSyncRegistrationType=yi={}));var SS;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=yi.method})(SS||(_e.DidOpenNotebookDocumentNotification=SS={}));var kS;(function(e){function t(n){let o=n;return or.objectLiteral(o)&&Js.uinteger.is(o.start)&&Js.uinteger.is(o.deleteCount)&&(o.cells===void 0||or.typedArray(o.cells,Tu.is))}e.is=t;function r(n,o,i){let s={start:n,deleteCount:o};return i!==void 0&&(s.cells=i),s}e.create=r})(kS||(_e.NotebookCellArrayChange=kS={}));var PS;(function(e){e.method="notebookDocument/didChange",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=yi.method})(PS||(_e.DidChangeNotebookDocumentNotification=PS={}));var TS;(function(e){e.method="notebookDocument/didSave",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=yi.method})(TS||(_e.DidSaveNotebookDocumentNotification=TS={}));var RS;(function(e){e.method="notebookDocument/didClose",e.messageDirection=yr.MessageDirection.clientToServer,e.type=new yr.ProtocolNotificationType(e.method),e.registrationMethod=yi.method})(RS||(_e.DidCloseNotebookDocumentNotification=RS={}))});var OS=k(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.InlineCompletionRequest=void 0;var Yg=ze(),ES;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=Yg.MessageDirection.clientToServer,e.type=new Yg.ProtocolRequestType(e.method),e.capabilities=Yg.CM.create("textDocument.inlineCompletion","inlineCompletionProvider")})(ES||(Ru.InlineCompletionRequest=ES={}))});var NS=k(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.TextDocumentContentRefreshRequest=_i.TextDocumentContentRequest=void 0;var Gs=ze(),CS;(function(e){e.method="workspace/textDocumentContent",e.messageDirection=Gs.MessageDirection.clientToServer,e.type=new Gs.ProtocolRequestType(e.method),e.capabilities=Gs.CM.create("workspace.textDocumentContent","workspace.textDocumentContent")})(CS||(_i.TextDocumentContentRequest=CS={}));var jS;(function(e){e.method="workspace/textDocumentContent/refresh",e.messageDirection=Gs.MessageDirection.serverToClient,e.type=new Gs.ProtocolRequestType(e.method)})(jS||(_i.TextDocumentContentRefreshRequest=jS={}))});var Jk=k(f=>{"use strict";var TA=f&&f.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),RA=f&&f.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),zA=f&&f.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&TA(r,t,n[o]);return RA(r,t),r}})();Object.defineProperty(f,"__esModule",{value:!0});f.CodeActionRequest=f.DocumentSymbolRequest=f.DocumentHighlightRequest=f.ReferencesRequest=f.DefinitionRequest=f.SignatureHelpRequest=f.SignatureHelpTriggerKind=f.HoverRequest=f.CompletionResolveRequest=f.CompletionRequest=f.CompletionTriggerKind=f.PublishDiagnosticsNotification=f.WatchKind=f.GlobPattern=f.RelativePattern=f.FileChangeType=f.DidChangeWatchedFilesNotification=f.WillSaveTextDocumentWaitUntilRequest=f.WillSaveTextDocumentNotification=f.TextDocumentSaveReason=f.DidSaveTextDocumentNotification=f.DidCloseTextDocumentNotification=f.DidChangeTextDocumentNotification=f.TextDocumentContentChangeEvent=f.DidOpenTextDocumentNotification=f.TextDocumentSyncKind=f.TelemetryEventNotification=f.LogMessageNotification=f.ShowMessageRequest=f.ShowMessageNotification=f.MessageType=f.DidChangeConfigurationNotification=f.ExitNotification=f.ShutdownRequest=f.InitializedNotification=f.InitializeErrorCodes=f.InitializeRequest=f.WorkDoneProgressOptions=f.TextDocumentRegistrationOptions=f.StaticRegistrationOptions=f.PositionEncodingKind=f.RegularExpressionEngineKind=f.FailureHandlingKind=f.ResourceOperationKind=f.UnregistrationRequest=f.RegistrationRequest=f.DocumentSelector=f.NotebookCellTextDocumentFilter=f.NotebookDocumentFilter=f.TextDocumentFilter=void 0;f.UniquenessLevel=f.WillDeleteFilesRequest=f.DidDeleteFilesNotification=f.WillRenameFilesRequest=f.DidRenameFilesNotification=f.WillCreateFilesRequest=f.DidCreateFilesNotification=f.FileOperationPatternKind=f.LinkedEditingRangeRequest=f.ShowDocumentRequest=f.SemanticTokensRegistrationType=f.SemanticTokensRefreshRequest=f.SemanticTokensRangeRequest=f.SemanticTokensDeltaRequest=f.SemanticTokensRequest=f.TokenFormat=f.CallHierarchyPrepareRequest=f.CallHierarchyOutgoingCallsRequest=f.CallHierarchyIncomingCallsRequest=f.WorkDoneProgressCancelNotification=f.WorkDoneProgressCreateRequest=f.WorkDoneProgress=f.SelectionRangeRequest=f.DeclarationRequest=f.FoldingRangeRefreshRequest=f.FoldingRangeRequest=f.ColorPresentationRequest=f.DocumentColorRequest=f.ConfigurationRequest=f.DidChangeWorkspaceFoldersNotification=f.WorkspaceFoldersRequest=f.TypeDefinitionRequest=f.ImplementationRequest=f.ApplyWorkspaceEditRequest=f.ExecuteCommandRequest=f.PrepareRenameRequest=f.RenameRequest=f.PrepareSupportDefaultBehavior=f.DocumentOnTypeFormattingRequest=f.DocumentRangesFormattingRequest=f.DocumentRangeFormattingRequest=f.DocumentFormattingRequest=f.DocumentLinkResolveRequest=f.DocumentLinkRequest=f.CodeLensRefreshRequest=f.CodeLensResolveRequest=f.CodeLensRequest=f.WorkspaceSymbolResolveRequest=f.WorkspaceSymbolRequest=f.CodeActionResolveRequest=void 0;f.TextDocumentContentRefreshRequest=f.TextDocumentContentRequest=f.InlineCompletionRequest=f.DidCloseNotebookDocumentNotification=f.DidSaveNotebookDocumentNotification=f.DidChangeNotebookDocumentNotification=f.NotebookCellArrayChange=f.DidOpenNotebookDocumentNotification=f.NotebookDocumentSyncRegistrationType=f.NotebookDocument=f.NotebookCell=f.ExecutionSummary=f.NotebookCellKind=f.DiagnosticRefreshRequest=f.WorkspaceDiagnosticRequest=f.DocumentDiagnosticRequest=f.DocumentDiagnosticReportKind=f.DiagnosticServerCancellationData=f.InlayHintRefreshRequest=f.InlayHintResolveRequest=f.InlayHintRequest=f.InlineValueRefreshRequest=f.InlineValueRequest=f.TypeHierarchySupertypesRequest=f.TypeHierarchySubtypesRequest=f.TypeHierarchyPrepareRequest=f.MonikerRequest=f.MonikerKind=void 0;var $=ze(),IS=(_u(),Mu(yu)),Ke=zA(vu()),EA=d0();Object.defineProperty(f,"ImplementationRequest",{enumerable:!0,get:function(){return EA.ImplementationRequest}});var OA=p0();Object.defineProperty(f,"TypeDefinitionRequest",{enumerable:!0,get:function(){return OA.TypeDefinitionRequest}});var Uk=g0();Object.defineProperty(f,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Uk.WorkspaceFoldersRequest}});Object.defineProperty(f,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Uk.DidChangeWorkspaceFoldersNotification}});var CA=_0();Object.defineProperty(f,"ConfigurationRequest",{enumerable:!0,get:function(){return CA.ConfigurationRequest}});var Vk=w0();Object.defineProperty(f,"DocumentColorRequest",{enumerable:!0,get:function(){return Vk.DocumentColorRequest}});Object.defineProperty(f,"ColorPresentationRequest",{enumerable:!0,get:function(){return Vk.ColorPresentationRequest}});var Hk=S0();Object.defineProperty(f,"FoldingRangeRequest",{enumerable:!0,get:function(){return Hk.FoldingRangeRequest}});Object.defineProperty(f,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Hk.FoldingRangeRefreshRequest}});var jA=P0();Object.defineProperty(f,"DeclarationRequest",{enumerable:!0,get:function(){return jA.DeclarationRequest}});var NA=R0();Object.defineProperty(f,"SelectionRangeRequest",{enumerable:!0,get:function(){return NA.SelectionRangeRequest}});var iy=C0();Object.defineProperty(f,"WorkDoneProgress",{enumerable:!0,get:function(){return iy.WorkDoneProgress}});Object.defineProperty(f,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return iy.WorkDoneProgressCreateRequest}});Object.defineProperty(f,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return iy.WorkDoneProgressCancelNotification}});var sy=M0();Object.defineProperty(f,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return sy.CallHierarchyIncomingCallsRequest}});Object.defineProperty(f,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return sy.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(f,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return sy.CallHierarchyPrepareRequest}});var vi=F0();Object.defineProperty(f,"TokenFormat",{enumerable:!0,get:function(){return vi.TokenFormat}});Object.defineProperty(f,"SemanticTokensRequest",{enumerable:!0,get:function(){return vi.SemanticTokensRequest}});Object.defineProperty(f,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return vi.SemanticTokensDeltaRequest}});Object.defineProperty(f,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return vi.SemanticTokensRangeRequest}});Object.defineProperty(f,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return vi.SemanticTokensRefreshRequest}});Object.defineProperty(f,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return vi.SemanticTokensRegistrationType}});var IA=V0();Object.defineProperty(f,"ShowDocumentRequest",{enumerable:!0,get:function(){return IA.ShowDocumentRequest}});var MA=B0();Object.defineProperty(f,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return MA.LinkedEditingRangeRequest}});var lo=eS();Object.defineProperty(f,"FileOperationPatternKind",{enumerable:!0,get:function(){return lo.FileOperationPatternKind}});Object.defineProperty(f,"DidCreateFilesNotification",{enumerable:!0,get:function(){return lo.DidCreateFilesNotification}});Object.defineProperty(f,"WillCreateFilesRequest",{enumerable:!0,get:function(){return lo.WillCreateFilesRequest}});Object.defineProperty(f,"DidRenameFilesNotification",{enumerable:!0,get:function(){return lo.DidRenameFilesNotification}});Object.defineProperty(f,"WillRenameFilesRequest",{enumerable:!0,get:function(){return lo.WillRenameFilesRequest}});Object.defineProperty(f,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return lo.DidDeleteFilesNotification}});Object.defineProperty(f,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return lo.WillDeleteFilesRequest}});var ay=oS();Object.defineProperty(f,"UniquenessLevel",{enumerable:!0,get:function(){return ay.UniquenessLevel}});Object.defineProperty(f,"MonikerKind",{enumerable:!0,get:function(){return ay.MonikerKind}});Object.defineProperty(f,"MonikerRequest",{enumerable:!0,get:function(){return ay.MonikerRequest}});var cy=cS();Object.defineProperty(f,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return cy.TypeHierarchyPrepareRequest}});Object.defineProperty(f,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return cy.TypeHierarchySubtypesRequest}});Object.defineProperty(f,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return cy.TypeHierarchySupertypesRequest}});var Bk=dS();Object.defineProperty(f,"InlineValueRequest",{enumerable:!0,get:function(){return Bk.InlineValueRequest}});Object.defineProperty(f,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Bk.InlineValueRefreshRequest}});var uy=hS();Object.defineProperty(f,"InlayHintRequest",{enumerable:!0,get:function(){return uy.InlayHintRequest}});Object.defineProperty(f,"InlayHintResolveRequest",{enumerable:!0,get:function(){return uy.InlayHintResolveRequest}});Object.defineProperty(f,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return uy.InlayHintRefreshRequest}});var Ks=xS();Object.defineProperty(f,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Ks.DiagnosticServerCancellationData}});Object.defineProperty(f,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Ks.DocumentDiagnosticReportKind}});Object.defineProperty(f,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Ks.DocumentDiagnosticRequest}});Object.defineProperty(f,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Ks.WorkspaceDiagnosticRequest}});Object.defineProperty(f,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Ks.DiagnosticRefreshRequest}});var _r=zS();Object.defineProperty(f,"NotebookCellKind",{enumerable:!0,get:function(){return _r.NotebookCellKind}});Object.defineProperty(f,"ExecutionSummary",{enumerable:!0,get:function(){return _r.ExecutionSummary}});Object.defineProperty(f,"NotebookCell",{enumerable:!0,get:function(){return _r.NotebookCell}});Object.defineProperty(f,"NotebookDocument",{enumerable:!0,get:function(){return _r.NotebookDocument}});Object.defineProperty(f,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _r.NotebookDocumentSyncRegistrationType}});Object.defineProperty(f,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidOpenNotebookDocumentNotification}});Object.defineProperty(f,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _r.NotebookCellArrayChange}});Object.defineProperty(f,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidChangeNotebookDocumentNotification}});Object.defineProperty(f,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidSaveNotebookDocumentNotification}});Object.defineProperty(f,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _r.DidCloseNotebookDocumentNotification}});var DA=OS();Object.defineProperty(f,"InlineCompletionRequest",{enumerable:!0,get:function(){return DA.InlineCompletionRequest}});var Wk=NS();Object.defineProperty(f,"TextDocumentContentRequest",{enumerable:!0,get:function(){return Wk.TextDocumentContentRequest}});Object.defineProperty(f,"TextDocumentContentRefreshRequest",{enumerable:!0,get:function(){return Wk.TextDocumentContentRefreshRequest}});var Qg;(function(e){function t(r){let n=r;return Ke.string(n)||Ke.string(n.language)||Ke.string(n.scheme)||oy.is(n.pattern)}e.is=t})(Qg||(f.TextDocumentFilter=Qg={}));var ey;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(Ke.string(n.notebookType)||Ke.string(n.scheme)||Ke.string(n.pattern))}e.is=t})(ey||(f.NotebookDocumentFilter=ey={}));var ty;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(Ke.string(n.notebook)||ey.is(n.notebook))&&(n.language===void 0||Ke.string(n.language))}e.is=t})(ty||(f.NotebookCellTextDocumentFilter=ty={}));var ry;(function(e){function t(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ke.string(n)&&!Qg.is(n)&&!ty.is(n))return!1;return!0}e.is=t})(ry||(f.DocumentSelector=ry={}));var MS;(function(e){e.method="client/registerCapability",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method)})(MS||(f.RegistrationRequest=MS={}));var DS;(function(e){e.method="client/unregisterCapability",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method)})(DS||(f.UnregistrationRequest=DS={}));var AS;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(AS||(f.ResourceOperationKind=AS={}));var qS;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(qS||(f.FailureHandlingKind=qS={}));var ZS;(function(e){e.ES2020="ES2020"})(ZS||(f.RegularExpressionEngineKind=ZS={}));var LS;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(LS||(f.PositionEncodingKind=LS={}));var FS;(function(e){function t(r){let n=r;return n&&Ke.string(n.id)&&n.id.length>0}e.hasId=t})(FS||(f.StaticRegistrationOptions=FS={}));var US;(function(e){function t(r){let n=r;return n&&(n.documentSelector===null||ry.is(n.documentSelector))}e.is=t})(US||(f.TextDocumentRegistrationOptions=US={}));var VS;(function(e){function t(n){let o=n;return Ke.objectLiteral(o)&&(o.workDoneProgress===void 0||Ke.boolean(o.workDoneProgress))}e.is=t;function r(n){let o=n;return o&&Ke.boolean(o.workDoneProgress)}e.hasWorkDoneProgress=r})(VS||(f.WorkDoneProgressOptions=VS={}));var HS;(function(e){e.method="initialize",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method)})(HS||(f.InitializeRequest=HS={}));var BS;(function(e){e.unknownProtocolVersion=1})(BS||(f.InitializeErrorCodes=BS={}));var WS;(function(e){e.method="initialized",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method)})(WS||(f.InitializedNotification=WS={}));var JS;(function(e){e.method="shutdown",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType0(e.method)})(JS||(f.ShutdownRequest=JS={}));var GS;(function(e){e.method="exit",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType0(e.method)})(GS||(f.ExitNotification=GS={}));var KS;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("workspace.didChangeConfiguration",void 0)})(KS||(f.DidChangeConfigurationNotification=KS={}));var XS;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(XS||(f.MessageType=XS={}));var YS;(function(e){e.method="window/showMessage",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("window.showMessage",void 0)})(YS||(f.ShowMessageNotification=YS={}));var QS;(function(e){e.method="window/showMessageRequest",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("window.showMessage",void 0)})(QS||(f.ShowMessageRequest=QS={}));var ek;(function(e){e.method="window/logMessage",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method)})(ek||(f.LogMessageNotification=ek={}));var tk;(function(e){e.method="telemetry/event",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method)})(tk||(f.TelemetryEventNotification=tk={}));var rk;(function(e){e.None=0,e.Full=1,e.Incremental=2})(rk||(f.TextDocumentSyncKind=rk={}));var nk;(function(e){e.method="textDocument/didOpen",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(nk||(f.DidOpenTextDocumentNotification=nk={}));var ok;(function(e){function t(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}e.isIncremental=t;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}e.isFull=r})(ok||(f.TextDocumentContentChangeEvent=ok={}));var ik;(function(e){e.method="textDocument/didChange",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync")})(ik||(f.DidChangeTextDocumentNotification=ik={}));var sk;(function(e){e.method="textDocument/didClose",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization","textDocumentSync.openClose")})(sk||(f.DidCloseTextDocumentNotification=sk={}));var ak;(function(e){e.method="textDocument/didSave",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.didSave","textDocumentSync.save")})(ak||(f.DidSaveTextDocumentNotification=ak={}));var ck;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(ck||(f.TextDocumentSaveReason=ck={}));var uk;(function(e){e.method="textDocument/willSave",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.willSave","textDocumentSync.willSave")})(uk||(f.WillSaveTextDocumentNotification=uk={}));var lk;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.synchronization.willSaveWaitUntil","textDocumentSync.willSaveWaitUntil")})(lk||(f.WillSaveTextDocumentWaitUntilRequest=lk={}));var dk;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("workspace.didChangeWatchedFiles",void 0)})(dk||(f.DidChangeWatchedFilesNotification=dk={}));var fk;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(fk||(f.FileChangeType=fk={}));var ny;(function(e){function t(r){let n=r;return Ke.objectLiteral(n)&&(IS.URI.is(n.baseUri)||IS.WorkspaceFolder.is(n.baseUri))&&Ke.string(n.pattern)}e.is=t})(ny||(f.RelativePattern=ny={}));var oy;(function(e){function t(r){let n=r;return Ke.string(n)||ny.is(n)}e.is=t})(oy||(f.GlobPattern=oy={}));var pk;(function(e){e.Create=1,e.Change=2,e.Delete=4})(pk||(f.WatchKind=pk={}));var mk;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolNotificationType(e.method),e.capabilities=$.CM.create("textDocument.publishDiagnostics",void 0)})(mk||(f.PublishDiagnosticsNotification=mk={}));var hk;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(hk||(f.CompletionTriggerKind=hk={}));var gk;(function(e){e.method="textDocument/completion",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.completion","completionProvider")})(gk||(f.CompletionRequest=gk={}));var yk;(function(e){e.method="completionItem/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.completion.completionItem.resolveSupport","completionProvider.resolveProvider")})(yk||(f.CompletionResolveRequest=yk={}));var _k;(function(e){e.method="textDocument/hover",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.hover","hoverProvider")})(_k||(f.HoverRequest=_k={}));var vk;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(vk||(f.SignatureHelpTriggerKind=vk={}));var bk;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.signatureHelp","signatureHelpProvider")})(bk||(f.SignatureHelpRequest=bk={}));var wk;(function(e){e.method="textDocument/definition",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.definition","definitionProvider")})(wk||(f.DefinitionRequest=wk={}));var xk;(function(e){e.method="textDocument/references",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.references","referencesProvider")})(xk||(f.ReferencesRequest=xk={}));var $k;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentHighlight","documentHighlightProvider")})($k||(f.DocumentHighlightRequest=$k={}));var Sk;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentSymbol","documentSymbolProvider")})(Sk||(f.DocumentSymbolRequest=Sk={}));var kk;(function(e){e.method="textDocument/codeAction",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeAction","codeActionProvider")})(kk||(f.CodeActionRequest=kk={}));var Pk;(function(e){e.method="codeAction/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeAction.resolveSupport","codeActionProvider.resolveProvider")})(Pk||(f.CodeActionResolveRequest=Pk={}));var Tk;(function(e){e.method="workspace/symbol",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.symbol","workspaceSymbolProvider")})(Tk||(f.WorkspaceSymbolRequest=Tk={}));var Rk;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.symbol.resolveSupport","workspaceSymbolProvider.resolveProvider")})(Rk||(f.WorkspaceSymbolResolveRequest=Rk={}));var zk;(function(e){e.method="textDocument/codeLens",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeLens","codeLensProvider")})(zk||(f.CodeLensRequest=zk={}));var Ek;(function(e){e.method="codeLens/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.codeLens.resolveSupport","codeLensProvider.resolveProvider")})(Ek||(f.CodeLensResolveRequest=Ek={}));var Ok;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType0(e.method),e.capabilities=$.CM.create("workspace.codeLens",void 0)})(Ok||(f.CodeLensRefreshRequest=Ok={}));var Ck;(function(e){e.method="textDocument/documentLink",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentLink","documentLinkProvider")})(Ck||(f.DocumentLinkRequest=Ck={}));var jk;(function(e){e.method="documentLink/resolve",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.documentLink","documentLinkProvider.resolveProvider")})(jk||(f.DocumentLinkResolveRequest=jk={}));var Nk;(function(e){e.method="textDocument/formatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.formatting","documentFormattingProvider")})(Nk||(f.DocumentFormattingRequest=Nk={}));var Ik;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rangeFormatting","documentRangeFormattingProvider")})(Ik||(f.DocumentRangeFormattingRequest=Ik={}));var Mk;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rangeFormatting.rangesSupport","documentRangeFormattingProvider.rangesSupport")})(Mk||(f.DocumentRangesFormattingRequest=Mk={}));var Dk;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.onTypeFormatting","documentOnTypeFormattingProvider")})(Dk||(f.DocumentOnTypeFormattingRequest=Dk={}));var Ak;(function(e){e.Identifier=1})(Ak||(f.PrepareSupportDefaultBehavior=Ak={}));var qk;(function(e){e.method="textDocument/rename",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rename","renameProvider")})(qk||(f.RenameRequest=qk={}));var Zk;(function(e){e.method="textDocument/prepareRename",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("textDocument.rename.prepareSupport","renameProvider.prepareProvider")})(Zk||(f.PrepareRenameRequest=Zk={}));var Lk;(function(e){e.method="workspace/executeCommand",e.messageDirection=$.MessageDirection.clientToServer,e.type=new $.ProtocolRequestType(e.method),e.capabilities=$.CM.create("workspace.executeCommand","executeCommandProvider")})(Lk||(f.ExecuteCommandRequest=Lk={}));var Fk;(function(e){e.method="workspace/applyEdit",e.messageDirection=$.MessageDirection.serverToClient,e.type=new $.ProtocolRequestType("workspace/applyEdit"),e.capabilities=$.CM.create("workspace.applyEdit",void 0)})(Fk||(f.ApplyWorkspaceEditRequest=Fk={}))});var Kk=k(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.createProtocolConnection=AA;var Gk=Or();function AA(e,t,r,n){return Gk.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Gk.createMessageConnection)(e,t,r,n)}});var dy=k(zt=>{"use strict";var qA=zt&&zt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),zu=zt&&zt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&qA(t,e,r)};Object.defineProperty(zt,"__esModule",{value:!0});zt.LSPErrorCodes=zt.createProtocolConnection=void 0;zu(Or(),zt);zu((_u(),Mu(yu)),zt);zu(ze(),zt);zu(Jk(),zt);var ZA=Kk();Object.defineProperty(zt,"createProtocolConnection",{enumerable:!0,get:function(){return ZA.createProtocolConnection}});var Xk;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(Xk||(zt.LSPErrorCodes=Xk={}))});var Qk=k(Dr=>{"use strict";var LA=Dr&&Dr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Yk=Dr&&Dr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LA(t,e,r)};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createProtocolConnection=UA;var FA=Ch();Yk(Ch(),Dr);Yk(dy(),Dr);function UA(e,t,r,n){return(0,FA.createMessageConnection)(e,t,r,n)}});import{extname as tq}from"node:path";var Vr={};Qs(Vr,{BRAND:()=>QP,DIRTY:()=>$n,EMPTY_PATH:()=>OP,INVALID:()=>H,NEVER:()=>MT,OK:()=>ot,ParseStatus:()=>Xe,Schema:()=>Y,ZodAny:()=>Fr,ZodArray:()=>Sr,ZodBigInt:()=>kn,ZodBoolean:()=>Pn,ZodBranded:()=>Ti,ZodCatch:()=>Dn,ZodDate:()=>Tn,ZodDefault:()=>Mn,ZodDiscriminatedUnion:()=>na,ZodEffects:()=>Dt,ZodEnum:()=>Nn,ZodError:()=>vt,ZodFirstPartyTypeKind:()=>E,ZodFunction:()=>ia,ZodIntersection:()=>On,ZodIssueCode:()=>R,ZodLazy:()=>Cn,ZodLiteral:()=>jn,ZodMap:()=>wo,ZodNaN:()=>$o,ZodNativeEnum:()=>In,ZodNever:()=>Wt,ZodNull:()=>zn,ZodNullable:()=>ur,ZodNumber:()=>Sn,ZodObject:()=>wt,ZodOptional:()=>bt,ZodParsedType:()=>N,ZodPipeline:()=>Ri,ZodPromise:()=>Ur,ZodReadonly:()=>An,ZodRecord:()=>oa,ZodSchema:()=>Y,ZodSet:()=>xo,ZodString:()=>Lr,ZodSymbol:()=>vo,ZodTransformer:()=>Dt,ZodTuple:()=>cr,ZodType:()=>Y,ZodUndefined:()=>Rn,ZodUnion:()=>En,ZodUnknown:()=>$r,ZodVoid:()=>bo,addIssueToContext:()=>j,any:()=>cT,array:()=>fT,bigint:()=>nT,boolean:()=>Ny,coerce:()=>IT,custom:()=>Oy,date:()=>oT,datetimeRegex:()=>zy,defaultErrorMap:()=>wr,discriminatedUnion:()=>hT,effect:()=>TT,enum:()=>ST,function:()=>wT,getErrorMap:()=>go,getParsedType:()=>ar,instanceof:()=>tT,intersection:()=>gT,isAborted:()=>ta,isAsync:()=>yo,isDirty:()=>ra,isValid:()=>Zr,late:()=>eT,lazy:()=>xT,literal:()=>$T,makeIssue:()=>Pi,map:()=>vT,nan:()=>rT,nativeEnum:()=>kT,never:()=>lT,null:()=>aT,nullable:()=>zT,number:()=>jy,object:()=>Zu,objectUtil:()=>Du,oboolean:()=>NT,onumber:()=>jT,optional:()=>RT,ostring:()=>CT,pipeline:()=>OT,preprocess:()=>ET,promise:()=>PT,quotelessJson:()=>RP,record:()=>_T,set:()=>bT,setErrorMap:()=>EP,strictObject:()=>pT,string:()=>Cy,symbol:()=>iT,transformer:()=>TT,tuple:()=>yT,undefined:()=>sT,union:()=>mT,unknown:()=>uT,util:()=>re,void:()=>dT});var re;(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})(re||(re={}));var Du;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Du||(Du={}));var N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ar=e=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(e)?N.array:e===null?N.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?N.promise:typeof Map<"u"&&e instanceof Map?N.map:typeof Set<"u"&&e instanceof Set?N.set:typeof Date<"u"&&e instanceof Date?N.date:N.object;default:return N.unknown}};var R=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),RP=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),vt=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,re.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()}};vt.create=e=>new vt(e);var zP=(e,t)=>{let r;switch(e.code){case R.invalid_type:e.received===N.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case R.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case R.invalid_union:r="Invalid input";break;case R.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case R.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case R.invalid_arguments:r="Invalid function arguments";break;case R.invalid_return_type:r="Invalid function return type";break;case R.invalid_date:r="Invalid date";break;case R.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}"`:re.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case R.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 R.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 R.custom:r="Invalid input";break;case R.invalid_intersection_types:r="Intersection results could not be merged";break;case R.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case R.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},wr=zP;var Sy=wr;function EP(e){Sy=e}function go(){return Sy}var Pi=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}},OP=[];function j(e,t){let r=go(),n=Pi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wr?void 0:wr].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 H;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 H;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}}},H=Object.freeze({status:"aborted"}),$n=e=>({status:"dirty",value:e}),ot=e=>({status:"valid",value:e}),ta=e=>e.status==="aborted",ra=e=>e.status==="dirty",Zr=e=>e.status==="valid",yo=e=>typeof Promise<"u"&&e instanceof Promise;var q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(q||(q={}));var Mt=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}},ky=(e,t)=>{if(Zr(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 vt(e.common.issues);return this._error=r,this._error}}};function K(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 Y=class{get description(){return this._def.description}_getType(t){return ar(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ar(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:ar(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(yo(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:ar(t)},o=this._parseSync({data:t,path:n.path,parent:n});return ky(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ar(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Zr(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=>Zr(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:ar(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(yo(o)?o:Promise.resolve(o));return ky(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:R.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 Dt({schema:this,typeName:E.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 bt.create(this,this._def)}nullable(){return ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sr.create(this)}promise(){return Ur.create(this,this._def)}or(t){return En.create([this,t],this._def)}and(t){return On.create(this,t,this._def)}transform(t){return new Dt({...K(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Mn({...K(this._def),innerType:this,defaultValue:r,typeName:E.ZodDefault})}brand(){return new Ti({typeName:E.ZodBranded,type:this,...K(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Dn({...K(this._def),innerType:this,catchValue:r,typeName:E.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ri.create(this,t)}readonly(){return An.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},CP=/^c[^\s-]{8,}$/i,jP=/^[0-9a-z]+$/,NP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IP=/^[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,MP=/^[a-z0-9_-]{21}$/i,DP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AP=/^[-+]?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)?)??$/,qP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Au,LP=/^(?:(?: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])$/,FP=/^(?:(?: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])$/,UP=/^(([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]))$/,VP=/^(([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])$/,HP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ty="((\\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])))",WP=new RegExp(`^${Ty}$`);function Ry(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 JP(e){return new RegExp(`^${Ry(e)}$`)}function zy(e){let t=`${Ty}T${Ry(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 GP(e,t){return!!((t==="v4"||!t)&&LP.test(e)||(t==="v6"||!t)&&UP.test(e))}function KP(e,t){if(!DP.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 XP(e,t){return!!((t==="v4"||!t)&&FP.test(e)||(t==="v6"||!t)&&VP.test(e))}var Lr=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let i=this._getOrReturnCtx(t);return j(i,{code:R.invalid_type,expected:N.string,received:i.parsedType}),H}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),j(o,{code:R.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),j(o,{code:R.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?j(o,{code:R.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&j(o,{code:R.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")qP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"email",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Au||(Au=new RegExp(ZP,"u")),Au.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"emoji",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")IP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"uuid",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")MP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"nanoid",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")CP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cuid",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")jP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cuid2",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")NP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"ulid",code:R.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),j(o,{validation:"url",code:R.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),j(o,{validation:"regex",code:R.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),j(o,{code:R.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),j(o,{code:R.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),j(o,{code:R.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?zy(i).test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:R.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?WP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:R.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?JP(i).test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:R.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?AP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"duration",code:R.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?GP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"ip",code:R.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?KP(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"jwt",code:R.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?XP(t.data,i.version)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"cidr",code:R.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?HP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"base64",code:R.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?BP.test(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{validation:"base64url",code:R.invalid_string,message:i.message}),n.dirty()):re.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:R.invalid_string,...q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.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,...q.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,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...q.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...q.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...q.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...q.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...q.errToObj(r)})}nonempty(t){return this.min(1,q.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}};Lr.create=e=>new Lr({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,...K(e)});function YP(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 Sn=class e extends Y{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)!==N.number){let i=this._getOrReturnCtx(t);return j(i,{code:R.invalid_type,expected:N.number,received:i.parsedType}),H}let n,o=new Xe;for(let i of this._def.checks)i.kind==="int"?re.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),j(n,{code:R.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),j(n,{code:R.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),j(n,{code:R.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?YP(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),j(n,{code:R.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),j(n,{code:R.not_finite,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.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"&&re.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)}};Sn.create=e=>new Sn({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,...K(e)});var kn=class e extends Y{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)!==N.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),j(n,{code:R.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),j(n,{code:R.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),j(n,{code:R.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return j(r,{code:R.invalid_type,expected:N.bigint,received:r.parsedType}),H}gte(t,r){return this.setLimit("min",t,!0,q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.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:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.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}};kn.create=e=>new kn({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,...K(e)});var Pn=class extends Y{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==N.boolean){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.boolean,received:n.parsedType}),H}return ot(t.data)}};Pn.create=e=>new Pn({typeName:E.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var Tn=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let i=this._getOrReturnCtx(t);return j(i,{code:R.invalid_type,expected:N.date,received:i.parsedType}),H}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return j(i,{code:R.invalid_date}),H}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),j(o,{code:R.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),j(o,{code:R.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):re.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:q.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:q.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}};Tn.create=e=>new Tn({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,...K(e)});var vo=class extends Y{_parse(t){if(this._getType(t)!==N.symbol){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.symbol,received:n.parsedType}),H}return ot(t.data)}};vo.create=e=>new vo({typeName:E.ZodSymbol,...K(e)});var Rn=class extends Y{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.undefined,received:n.parsedType}),H}return ot(t.data)}};Rn.create=e=>new Rn({typeName:E.ZodUndefined,...K(e)});var zn=class extends Y{_parse(t){if(this._getType(t)!==N.null){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.null,received:n.parsedType}),H}return ot(t.data)}};zn.create=e=>new zn({typeName:E.ZodNull,...K(e)});var Fr=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return ot(t.data)}};Fr.create=e=>new Fr({typeName:E.ZodAny,...K(e)});var $r=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ot(t.data)}};$r.create=e=>new $r({typeName:E.ZodUnknown,...K(e)});var Wt=class extends Y{_parse(t){let r=this._getOrReturnCtx(t);return j(r,{code:R.invalid_type,expected:N.never,received:r.parsedType}),H}};Wt.create=e=>new Wt({typeName:E.ZodNever,...K(e)});var bo=class extends Y{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.void,received:n.parsedType}),H}return ot(t.data)}};bo.create=e=>new bo({typeName:E.ZodVoid,...K(e)});var Sr=class e extends Y{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==N.array)return j(r,{code:R.invalid_type,expected:N.array,received:r.parsedType}),H;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(j(r,{code:s?R.too_big:R.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&&(j(r,{code:R.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&&(j(r,{code:R.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 Mt(r,s,r.path,a)))).then(s=>Xe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Mt(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:q.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:q.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:q.toString(r)}})}nonempty(t){return this.min(1,t)}};Sr.create=(e,t)=>new Sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...K(t)});function _o(e){if(e instanceof wt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=bt.create(_o(n))}return new wt({...e._def,shape:()=>t})}else return e instanceof Sr?new Sr({...e._def,type:_o(e.element)}):e instanceof bt?bt.create(_o(e.unwrap())):e instanceof ur?ur.create(_o(e.unwrap())):e instanceof cr?cr.create(e.items.map(t=>_o(t))):e}var wt=class e extends Y{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=re.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==N.object){let u=this._getOrReturnCtx(t);return j(u,{code:R.invalid_type,expected:N.object,received:u.parsedType}),H}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wt&&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 Mt(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Wt){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&&(j(o,{code:R.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 Mt(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,h=await l.value;u.push({key:d,value:h,alwaysSet:l.alwaysSet})}return u}).then(u=>Xe.mergeObjectSync(n,u)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return q.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:q.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:E.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 re.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 re.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return _o(this)}partial(t){let r={};for(let n of re.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 re.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof bt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Ey(re.objectKeys(this.shape))}};wt.create=(e,t)=>new wt({shape:()=>e,unknownKeys:"strip",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});wt.strictCreate=(e,t)=>new wt({shape:()=>e,unknownKeys:"strict",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});wt.lazycreate=(e,t)=>new wt({shape:e,unknownKeys:"strip",catchall:Wt.create(),typeName:E.ZodObject,...K(t)});var En=class extends Y{_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 vt(a.ctx.common.issues));return j(r,{code:R.invalid_union,unionErrors:s}),H}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 vt(c));return j(r,{code:R.invalid_union,unionErrors:a}),H}}get options(){return this._def.options}};En.create=(e,t)=>new En({options:e,typeName:E.ZodUnion,...K(t)});var xr=e=>e instanceof Cn?xr(e.schema):e instanceof Dt?xr(e.innerType()):e instanceof jn?[e.value]:e instanceof Nn?e.options:e instanceof In?re.objectValues(e.enum):e instanceof Mn?xr(e._def.innerType):e instanceof Rn?[void 0]:e instanceof zn?[null]:e instanceof bt?[void 0,...xr(e.unwrap())]:e instanceof ur?[null,...xr(e.unwrap())]:e instanceof Ti||e instanceof An?xr(e.unwrap()):e instanceof Dn?xr(e._def.innerType):[],na=class e extends Y{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return j(r,{code:R.invalid_type,expected:N.object,received:r.parsedType}),H;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}):(j(r,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),H)}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=xr(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:E.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...K(n)})}};function qu(e,t){let r=ar(e),n=ar(t);if(e===t)return{valid:!0,data:e};if(r===N.object&&n===N.object){let o=re.objectKeys(t),i=re.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=qu(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===N.array&&n===N.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=qu(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===N.date&&n===N.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var On=class extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(ta(i)||ta(s))return H;let a=qu(i.value,s.value);return a.valid?((ra(i)||ra(s))&&r.dirty(),{status:r.value,value:a.data}):(j(n,{code:R.invalid_intersection_types}),H)};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}))}};On.create=(e,t,r)=>new On({left:e,right:t,typeName:E.ZodIntersection,...K(r)});var cr=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==N.array)return j(n,{code:R.invalid_type,expected:N.array,received:n.parsedType}),H;if(n.data.length<this._def.items.length)return j(n,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;!this._def.rest&&n.data.length>this._def.items.length&&(j(n,{code:R.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 Mt(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})}};cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cr({items:e,typeName:E.ZodTuple,rest:null,...K(t)})};var oa=class e extends Y{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!==N.object)return j(n,{code:R.invalid_type,expected:N.object,received:n.parsedType}),H;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Mt(n,a,n.path,a)),value:s._parse(new Mt(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 Y?new e({keyType:t,valueType:r,typeName:E.ZodRecord,...K(n)}):new e({keyType:Lr.create(),valueType:t,typeName:E.ZodRecord,...K(r)})}},wo=class extends Y{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!==N.map)return j(n,{code:R.invalid_type,expected:N.map,received:n.parsedType}),H;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new Mt(n,a,n.path,[u,"key"])),value:i._parse(new Mt(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 H;(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 H;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};wo.create=(e,t,r)=>new wo({valueType:t,keyType:e,typeName:E.ZodMap,...K(r)});var xo=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==N.set)return j(n,{code:R.invalid_type,expected:N.set,received:n.parsedType}),H;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(j(n,{code:R.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&&(j(n,{code:R.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 H;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 Mt(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:q.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:q.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};xo.create=(e,t)=>new xo({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,...K(t)});var ia=class e extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.function)return j(r,{code:R.invalid_type,expected:N.function,received:r.parsedType}),H;function n(a,c){return Pi({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,go(),wr].filter(u=>!!u),issueData:{code:R.invalid_arguments,argumentsError:c}})}function o(a,c){return Pi({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,go(),wr].filter(u=>!!u),issueData:{code:R.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Ur){let a=this;return ot(async function(...c){let u=new vt([]),l=await a._def.args.parseAsync(c,i).catch(m=>{throw u.addIssue(n(c,m)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{let a=this;return ot(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new vt([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new vt([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:cr.create(t).rest($r.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||cr.create([]).rest($r.create()),returns:r||$r.create(),typeName:E.ZodFunction,...K(n)})}},Cn=class extends Y{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})}};Cn.create=(e,t)=>new Cn({getter:e,typeName:E.ZodLazy,...K(t)});var jn=class extends Y{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return j(r,{received:r.data,code:R.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};jn.create=(e,t)=>new jn({value:e,typeName:E.ZodLiteral,...K(t)});function Ey(e,t){return new Nn({values:e,typeName:E.ZodEnum,...K(t)})}var Nn=class e extends Y{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return j(r,{expected:re.joinValues(n),received:r.parsedType,code:R.invalid_type}),H}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 j(r,{received:r.data,code:R.invalid_enum_value,options:n}),H}return ot(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})}};Nn.create=Ey;var In=class extends Y{_parse(t){let r=re.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==N.string&&n.parsedType!==N.number){let o=re.objectValues(r);return j(n,{expected:re.joinValues(o),received:n.parsedType,code:R.invalid_type}),H}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=re.objectValues(r);return j(n,{received:n.data,code:R.invalid_enum_value,options:o}),H}return ot(t.data)}get enum(){return this._def.values}};In.create=(e,t)=>new In({values:e,typeName:E.ZodNativeEnum,...K(t)});var Ur=class extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.promise&&r.common.async===!1)return j(r,{code:R.invalid_type,expected:N.promise,received:r.parsedType}),H;let n=r.parsedType===N.promise?r.data:Promise.resolve(r.data);return ot(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ur.create=(e,t)=>new Ur({type:e,typeName:E.ZodPromise,...K(t)});var Dt=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.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=>{j(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 H;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?H:c.status==="dirty"?$n(c.value):r.value==="dirty"?$n(c.value):c});{if(r.value==="aborted")return H;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?H:a.status==="dirty"?$n(a.value):r.value==="dirty"?$n(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"?H:(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"?H:(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(!Zr(s))return H;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=>Zr(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):H);re.assertNever(o)}};Dt.create=(e,t,r)=>new Dt({schema:e,typeName:E.ZodEffects,effect:t,...K(r)});Dt.createWithPreprocess=(e,t,r)=>new Dt({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,...K(r)});var bt=class extends Y{_parse(t){return this._getType(t)===N.undefined?ot(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};bt.create=(e,t)=>new bt({innerType:e,typeName:E.ZodOptional,...K(t)});var ur=class extends Y{_parse(t){return this._getType(t)===N.null?ot(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:E.ZodNullable,...K(t)});var Mn=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===N.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Mn.create=(e,t)=>new Mn({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(t)});var Dn=class extends Y{_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 yo(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new vt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new vt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Dn.create=(e,t)=>new Dn({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var $o=class extends Y{_parse(t){if(this._getType(t)!==N.nan){let n=this._getOrReturnCtx(t);return j(n,{code:R.invalid_type,expected:N.nan,received:n.parsedType}),H}return{status:"valid",value:t.data}}};$o.create=e=>new $o({typeName:E.ZodNaN,...K(e)});var QP=Symbol("zod_brand"),Ti=class extends Y{_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}},Ri=class e extends Y{_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"?H:i.status==="dirty"?(r.dirty(),$n(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"?H: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:E.ZodPipeline})}},An=class extends Y{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Zr(o)&&(o.value=Object.freeze(o.value)),o);return yo(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};An.create=(e,t)=>new An({innerType:e,typeName:E.ZodReadonly,...K(t)});function Py(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Oy(e,t={},r){return e?Fr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Py(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Py(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Fr.create()}var eT={object:wt.lazycreate},E;(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"})(E||(E={}));var tT=(e,t={message:`Input not instance of ${e.name}`})=>Oy(r=>r instanceof e,t),Cy=Lr.create,jy=Sn.create,rT=$o.create,nT=kn.create,Ny=Pn.create,oT=Tn.create,iT=vo.create,sT=Rn.create,aT=zn.create,cT=Fr.create,uT=$r.create,lT=Wt.create,dT=bo.create,fT=Sr.create,Zu=wt.create,pT=wt.strictCreate,mT=En.create,hT=na.create,gT=On.create,yT=cr.create,_T=oa.create,vT=wo.create,bT=xo.create,wT=ia.create,xT=Cn.create,$T=jn.create,ST=Nn.create,kT=In.create,PT=Ur.create,TT=Dt.create,RT=bt.create,zT=ur.create,ET=Dt.createWithPreprocess,OT=Ri.create,CT=()=>Cy().optional(),jT=()=>jy().optional(),NT=()=>Ny().optional(),IT={string:(e=>Lr.create({...e,coerce:!0})),number:(e=>Sn.create({...e,coerce:!0})),boolean:(e=>Pn.create({...e,coerce:!0})),bigint:(e=>kn.create({...e,coerce:!0})),date:(e=>Tn.create({...e,coerce:!0}))};var MT=H;var DT=Object.freeze({status:"aborted"});function x(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 kr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},sa={};function Et(e){return e&&Object.assign(sa,e),sa}var ne={};Qs(ne,{BIGINT_FORMAT_RANGES:()=>My,Class:()=>Fu,NUMBER_FORMAT_RANGES:()=>Gu,aborted:()=>Zn,allowsEval:()=>Bu,assert:()=>FT,assertEqual:()=>AT,assertIs:()=>ZT,assertNever:()=>LT,assertNotEqual:()=>qT,assignProp:()=>Hu,cached:()=>Oi,captureStackTrace:()=>ca,cleanEnum:()=>tR,cleanRegex:()=>ji,clone:()=>Ot,createTransparentProxy:()=>JT,defineLazy:()=>be,esc:()=>qn,escapeRegex:()=>Hr,extend:()=>XT,finalizeIssue:()=>Jt,floatSafeRemainder:()=>Vu,getElementAtPath:()=>UT,getEnumValues:()=>Ei,getLengthableOrigin:()=>Ni,getParsedType:()=>WT,getSizableOrigin:()=>Dy,isObject:()=>So,isPlainObject:()=>ko,issue:()=>Ku,joinValues:()=>aa,jsonStringifyReplacer:()=>Uu,merge:()=>YT,normalizeParams:()=>B,nullish:()=>Ci,numKeys:()=>BT,omit:()=>KT,optionalKeys:()=>Ju,partial:()=>QT,pick:()=>GT,prefixIssues:()=>lr,primitiveTypes:()=>Iy,promiseAllObject:()=>VT,propertyKeyTypes:()=>Wu,randomString:()=>HT,required:()=>eR,stringifyPrimitive:()=>ua,unwrapMessage:()=>zi});function AT(e){return e}function qT(e){return e}function ZT(e){}function LT(e){throw new Error}function FT(e){}function Ei(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 aa(e,t="|"){return e.map(r=>ua(r)).join(t)}function Uu(e,t){return typeof t=="bigint"?t.toString():t}function Oi(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ci(e){return e==null}function ji(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Vu(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 be(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 Hu(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function UT(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function VT(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 HT(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function qn(e){return JSON.stringify(e)}var ca=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function So(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Bu=Oi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ko(e){if(So(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(So(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function BT(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var WT=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}`)}},Wu=new Set(["string","number","symbol"]),Iy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Hr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function B(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 JT(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 ua(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ju(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Gu={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]},My={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function GT(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 Ot(e,{...e._zod.def,shape:r,checks:[]})}function KT(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 Ot(e,{...e._zod.def,shape:r,checks:[]})}function XT(e,t){if(!ko(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 Hu(this,"shape",n),n},checks:[]};return Ot(e,r)}function YT(e,t){return Ot(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Hu(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function QT(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 Ot(t,{...t._zod.def,shape:o,checks:[]})}function eR(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 Ot(t,{...t._zod.def,shape:o,checks:[]})}function Zn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function lr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function zi(e){return typeof e=="string"?e:e?.message}function Jt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=zi(e.inst?._zod.def?.error?.(e))??zi(t?.error?.(e))??zi(r.customError?.(e))??zi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Dy(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ni(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ku(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function tR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Fu=class{constructor(...t){}};var Ay=(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,Uu,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},la=x("$ZodError",Ay),Ii=x("$ZodError",Ay,{Parent:Error});function Xu(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 Yu(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 Qu=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 kr;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map(c=>Jt(c,i,Et())));throw ca(a,o?.callee),a}return s.value},el=Qu(Ii),tl=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=>Jt(c,i,Et())));throw ca(a,o?.callee),a}return s.value},rl=tl(Ii),nl=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 kr;return i.issues.length?{success:!1,error:new(e??la)(i.issues.map(s=>Jt(s,o,Et())))}:{success:!0,data:i.value}},Ln=nl(Ii),ol=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=>Jt(s,o,Et())))}:{success:!0,data:i.value}},Fn=ol(Ii);var qy=/^[cC][^\s-]{8,}$/,Zy=/^[0-9a-z]+$/,Ly=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fy=/^[0-9a-vA-V]{20}$/,Uy=/^[A-Za-z0-9]{27}$/,Vy=/^[a-zA-Z0-9_-]{21}$/,Hy=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var By=/^([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})$/,il=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 Wy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var nR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Jy(){return new RegExp(nR,"u")}var Gy=/^(?:(?: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])$/,Ky=/^(([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})$/,Xy=/^((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])$/,Yy=/^(([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])$/,Qy=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sl=/^[A-Za-z0-9_-]*$/,e_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var t_=/^\+(?:[0-9]){6,14}[0-9]$/,r_="(?:(?:\\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])))",n_=new RegExp(`^${r_}$`);function o_(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 i_(e){return new RegExp(`^${o_(e)}$`)}function s_(e){let t=o_({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(`^${r_}T(?:${n})$`)}var a_=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var c_=/^\d+$/,u_=/^-?\d+(?:\.\d+)?/i,l_=/true|false/i,d_=/null/i;var f_=/^[^A-Z]*$/,p_=/^[^a-z]*$/;var Ye=x("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),m_={number:"number",bigint:"bigint",object:"date"},al=x("$ZodCheckLessThan",(e,t)=>{Ye.init(e,t);let r=m_[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})}}),cl=x("$ZodCheckGreaterThan",(e,t)=>{Ye.init(e,t);let r=m_[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})}}),h_=x("$ZodCheckMultipleOf",(e,t)=>{Ye.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):Vu(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})}}),g_=x("$ZodCheckNumberFormat",(e,t)=>{Ye.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Gu[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=c_)}),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 y_=x("$ZodCheckMaxLength",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ci(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=Ni(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),__=x("$ZodCheckMinLength",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ci(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=Ni(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),v_=x("$ZodCheckLengthEquals",(e,t)=>{var r;Ye.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ci(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=Ni(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})}}),Mi=x("$ZodCheckStringFormat",(e,t)=>{var r,n;Ye.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=()=>{})}),b_=x("$ZodCheckRegex",(e,t)=>{Mi.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})}}),w_=x("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=f_),Mi.init(e,t)}),x_=x("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=p_),Mi.init(e,t)}),$_=x("$ZodCheckIncludes",(e,t)=>{Ye.init(e,t);let r=Hr(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})}}),S_=x("$ZodCheckStartsWith",(e,t)=>{Ye.init(e,t);let r=new RegExp(`^${Hr(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})}}),k_=x("$ZodCheckEndsWith",(e,t)=>{Ye.init(e,t);let r=new RegExp(`.*${Hr(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 P_=x("$ZodCheckOverwrite",(e,t)=>{Ye.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var fa=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(`
21
21
  `).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(`
22
- `))}};var k_={major:4,minor:0,patch:0};var ge=x("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=k_;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=qn(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,h=l._zod.check(i);if(h instanceof Promise&&a?.async===!1)throw new kr;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,i.issues.length!==d&&(c||(c=qn(i,d)))});else{if(i.issues.length===d)continue;c||(c=qn(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 kr;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=Zn(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ln(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Ii=x("$ZodString",(e,t)=>{ge.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o_(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}}),we=x("$ZodStringFormat",(e,t)=>{Ni.init(e,t),Ii.init(e,t)}),cl=x("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Uy),we.init(e,t)}),ul=x("$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=nl(n))}else t.pattern??(t.pattern=nl());we.init(e,t)}),ll=x("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vy),we.init(e,t)}),dl=x("$ZodURL",(e,t)=>{we.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:Xy.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})}}}),fl=x("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hy()),we.init(e,t)}),pl=x("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ly),we.init(e,t)}),ml=x("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Iy),we.init(e,t)}),hl=x("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dy),we.init(e,t)}),gl=x("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ay),we.init(e,t)}),yl=x("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qy),we.init(e,t)}),_l=x("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Zy),we.init(e,t)}),N_=x("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=n_(t)),we.init(e,t)}),I_=x("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e_),we.init(e,t)}),D_=x("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=r_(t)),we.init(e,t)}),A_=x("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Fy),we.init(e,t)}),vl=x("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=By),we.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),bl=x("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wy),we.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})}}}),wl=x("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jy),we.init(e,t)}),xl=x("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gy),we.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 q_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var $l=x("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ky),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{q_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function QT(e){if(!ol.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return q_(r)}var Sl=x("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ol),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{QT(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),kl=x("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Yy),we.init(e,t)});function ez(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 Pl=x("$ZodJWT",(e,t)=>{we.init(e,t),e._zod.check=r=>{ez(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var pa=x("$ZodNumber",(e,t)=>{ge.init(e,t),e._zod.pattern=e._zod.bag.pattern??s_,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}}),Tl=x("$ZodNumber",(e,t)=>{p_.init(e,t),pa.init(e,t)}),zl=x("$ZodBoolean",(e,t)=>{ge.init(e,t),e._zod.pattern=a_,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 Rl=x("$ZodNull",(e,t)=>{ge.init(e,t),e._zod.pattern=c_,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 El=x("$ZodUnknown",(e,t)=>{ge.init(e,t),e._zod.parse=r=>r}),Ol=x("$ZodNever",(e,t)=>{ge.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function P_(e,t,r){e.issues.length&&t.issues.push(...lr(r,e.issues)),t.value[r]=e.value}var Cl=x("$ZodArray",(e,t)=>{ge.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=>P_(u,r,s))):P_(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function fa(e,t,r){e.issues.length&&t.issues.push(...lr(r,e.issues)),t.value[r]=e.value}function T_(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(...lr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}var ma=x("$ZodObject",(e,t)=>{ge.init(e,t);let r=Ei(()=>{let d=Object.keys(t.shape);for(let m of d)if(!(t.shape[m]instanceof ge))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Bu(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(h)}});be(e._zod,"propValues",()=>{let d=t.shape,h={};for(let m in d){let p=d[m]._zod;if(p.values){h[m]??(h[m]=new Set);for(let y of p.values)h[m].add(y)}}return h});let n=d=>{let h=new da(["shape","payload","ctx"]),m=r.value,p=T=>{let R=An(T);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),v=0;for(let T of m.keys)y[T]=`key_${v++}`;h.write("const newResult = {}");for(let T of m.keys)if(m.optionalKeys.has(T)){let R=y[T];h.write(`const ${R} = ${p(T)};`);let I=An(T);h.write(`
23
- if (${R}.issues.length) {
24
- if (input[${I}] === undefined) {
25
- if (${I} in input) {
26
- newResult[${I}] = undefined;
22
+ `))}};var R_={major:4,minor:0,patch:0};var ge=x("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=R_;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=Zn(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,h=l._zod.check(i);if(h instanceof Promise&&a?.async===!1)throw new kr;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,i.issues.length!==d&&(c||(c=Zn(i,d)))});else{if(i.issues.length===d)continue;c||(c=Zn(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 kr;return a.then(c=>o(c,n,s))}return o(a,n,s)}}e["~standard"]={validate:o=>{try{let i=Ln(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Fn(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Di=x("$ZodString",(e,t)=>{ge.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??a_(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}}),we=x("$ZodStringFormat",(e,t)=>{Mi.init(e,t),Di.init(e,t)}),ll=x("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=By),we.init(e,t)}),dl=x("$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=il(n))}else t.pattern??(t.pattern=il());we.init(e,t)}),fl=x("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wy),we.init(e,t)}),pl=x("$ZodURL",(e,t)=>{we.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:e_.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})}}}),ml=x("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Jy()),we.init(e,t)}),hl=x("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Vy),we.init(e,t)}),gl=x("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=qy),we.init(e,t)}),yl=x("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Zy),we.init(e,t)}),_l=x("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ly),we.init(e,t)}),vl=x("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fy),we.init(e,t)}),bl=x("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Uy),we.init(e,t)}),A_=x("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=s_(t)),we.init(e,t)}),q_=x("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=n_),we.init(e,t)}),Z_=x("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=i_(t)),we.init(e,t)}),L_=x("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hy),we.init(e,t)}),wl=x("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gy),we.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),xl=x("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ky),we.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})}}}),$l=x("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xy),we.init(e,t)}),Sl=x("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yy),we.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 F_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var kl=x("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qy),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{F_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function oR(e){if(!sl.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return F_(r)}var Pl=x("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sl),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{oR(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Tl=x("$ZodE164",(e,t)=>{t.pattern??(t.pattern=t_),we.init(e,t)});function iR(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 Rl=x("$ZodJWT",(e,t)=>{we.init(e,t),e._zod.check=r=>{iR(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var ma=x("$ZodNumber",(e,t)=>{ge.init(e,t),e._zod.pattern=e._zod.bag.pattern??u_,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}}),zl=x("$ZodNumber",(e,t)=>{g_.init(e,t),ma.init(e,t)}),El=x("$ZodBoolean",(e,t)=>{ge.init(e,t),e._zod.pattern=l_,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 Ol=x("$ZodNull",(e,t)=>{ge.init(e,t),e._zod.pattern=d_,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 Cl=x("$ZodUnknown",(e,t)=>{ge.init(e,t),e._zod.parse=r=>r}),jl=x("$ZodNever",(e,t)=>{ge.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function z_(e,t,r){e.issues.length&&t.issues.push(...lr(r,e.issues)),t.value[r]=e.value}var Nl=x("$ZodArray",(e,t)=>{ge.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=>z_(u,r,s))):z_(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function pa(e,t,r){e.issues.length&&t.issues.push(...lr(r,e.issues)),t.value[r]=e.value}function E_(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(...lr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}var ha=x("$ZodObject",(e,t)=>{ge.init(e,t);let r=Oi(()=>{let d=Object.keys(t.shape);for(let m of d)if(!(t.shape[m]instanceof ge))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Ju(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(h)}});be(e._zod,"propValues",()=>{let d=t.shape,h={};for(let m in d){let p=d[m]._zod;if(p.values){h[m]??(h[m]=new Set);for(let y of p.values)h[m].add(y)}}return h});let n=d=>{let h=new fa(["shape","payload","ctx"]),m=r.value,p=T=>{let z=qn(T);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),v=0;for(let T of m.keys)y[T]=`key_${v++}`;h.write("const newResult = {}");for(let T of m.keys)if(m.optionalKeys.has(T)){let z=y[T];h.write(`const ${z} = ${p(T)};`);let M=qn(T);h.write(`
23
+ if (${z}.issues.length) {
24
+ if (input[${M}] === undefined) {
25
+ if (${M} in input) {
26
+ newResult[${M}] = undefined;
27
27
  }
28
28
  } else {
29
29
  payload.issues = payload.issues.concat(
30
- ${R}.issues.map((iss) => ({
30
+ ${z}.issues.map((iss) => ({
31
31
  ...iss,
32
- path: iss.path ? [${I}, ...iss.path] : [${I}],
32
+ path: iss.path ? [${M}, ...iss.path] : [${M}],
33
33
  }))
34
34
  );
35
35
  }
36
- } else if (${R}.value === undefined) {
37
- if (${I} in input) newResult[${I}] = undefined;
36
+ } else if (${z}.value === undefined) {
37
+ if (${M} in input) newResult[${M}] = undefined;
38
38
  } else {
39
- newResult[${I}] = ${R}.value;
39
+ newResult[${M}] = ${z}.value;
40
40
  }
41
- `)}else{let R=y[T];h.write(`const ${R} = ${p(T)};`),h.write(`
42
- if (${R}.issues.length) payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
41
+ `)}else{let z=y[T];h.write(`const ${z} = ${p(T)};`),h.write(`
42
+ if (${z}.issues.length) payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
43
43
  ...iss,
44
- path: iss.path ? [${An(T)}, ...iss.path] : [${An(T)}]
45
- })));`),h.write(`newResult[${An(T)}] = ${R}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let P=h.compile();return(T,R)=>P(d,T,R)},o,i=$o,s=!ia.jitless,c=s&&Vu.value,u=t.catchall,l;e._zod.parse=(d,h)=>{l??(l=r.value);let m=d.value;if(!i(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;let p=[];if(s&&c&&h?.async===!1&&h.jitless!==!0)o||(o=n(t.shape)),d=o(d,h);else{d.value={};let R=l.shape;for(let I of l.keys){let C=R[I],Me=C._zod.run({value:m[I],issues:[]},h),de=C._zod.optin==="optional"&&C._zod.optout==="optional";Me instanceof Promise?p.push(Me.then(mt=>de?T_(mt,d,I,m):fa(mt,d,I))):de?T_(Me,d,I,m):fa(Me,d,I)}}if(!u)return p.length?Promise.all(p).then(()=>d):d;let y=[],v=l.keySet,P=u._zod,T=P.def.type;for(let R of Object.keys(m)){if(v.has(R))continue;if(T==="never"){y.push(R);continue}let I=P.run({value:m[R],issues:[]},h);I instanceof Promise?p.push(I.then(C=>fa(C,d,R))):fa(I,d,R)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:m,inst:e}),p.length?Promise.all(p).then(()=>d):d}});function z_(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=>Jt(i,n,Et())))}),t}var ha=x("$ZodUnion",(e,t)=>{ge.init(e,t),be(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),be(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),be(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),be(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=>Ci(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=>z_(s,r,e,n)):z_(i,r,e,n)}}),jl=x("$ZodDiscriminatedUnion",(e,t)=>{ha.init(e,t);let r=e._zod.parse;be(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=Ei(()=>{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(!$o(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)}}),Ml=x("$ZodIntersection",(e,t)=>{ge.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])=>R_(r,c,u)):R_(r,i,s)}});function al(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(So(e)&&So(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=al(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=al(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 R_(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),qn(e))return e;let n=al(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 Nl=x("$ZodRecord",(e,t)=>{ge.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!So(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(...lr(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...lr(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=>Jt(u,n,Et())),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(...lr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...lr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Il=x("$ZodEnum",(e,t)=>{ge.init(e,t);let r=Ri(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Hu.has(typeof n)).map(n=>typeof n=="string"?Hr(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}}),Dl=x("$ZodLiteral",(e,t)=>{ge.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hr(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 Al=x("$ZodTransform",(e,t)=>{ge.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 kr;return r.value=o,r}}),ql=x("$ZodOptional",(e,t)=>{ge.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),be(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ci(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)}),Zl=x("$ZodNullable",(e,t)=>{ge.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ci(r.source)}|null)$`):void 0}),be(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)}),Ll=x("$ZodDefault",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(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=>E_(i,t)):E_(o,t)}});function E_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Fl=x("$ZodPrefault",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(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))}),Ul=x("$ZodNonOptional",(e,t)=>{ge.init(e,t),be(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=>O_(i,e)):O_(o,e)}});function O_(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 Vl=x("$ZodCatch",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(e._zod,"optout",()=>t.innerType._zod.optout),be(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=>Jt(s,n,Et()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Jt(i,n,Et()))},input:r.value}),r.issues=[]),r)}});var Hl=x("$ZodPipe",(e,t)=>{ge.init(e,t),be(e._zod,"values",()=>t.in._zod.values),be(e._zod,"optin",()=>t.in._zod.optin),be(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=>C_(i,t,n)):C_(o,t,n)}});function C_(e,t,r){return qn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}var Bl=x("$ZodReadonly",(e,t)=>{ge.init(e,t),be(e._zod,"propValues",()=>t.innerType._zod.propValues),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"optin",()=>t.innerType._zod.optin),be(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(j_):j_(o)}});function j_(e){return e.value=Object.freeze(e.value),e}var Wl=x("$ZodCustom",(e,t)=>{Ye.init(e,t),ge.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=>M_(i,r,n,e));M_(o,r,n,e)}});function M_(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(Ju(o))}}var tz=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},rz=()=>{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 ${tz(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${ca(n.values[0])}`:`Invalid option: expected one of ${sa(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":""}: ${sa(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 Z_(){return{localeError:rz()}}var Di=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 L_(){return new Di}var Br=L_();function Jl(e,t){return new e({type:"string",...B(t)})}function Gl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...B(t)})}function ga(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...B(t)})}function Kl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...B(t)})}function Xl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...B(t)})}function Yl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...B(t)})}function Ql(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...B(t)})}function ed(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...B(t)})}function td(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...B(t)})}function rd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...B(t)})}function nd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...B(t)})}function od(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...B(t)})}function id(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...B(t)})}function sd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...B(t)})}function ad(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...B(t)})}function cd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...B(t)})}function ud(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...B(t)})}function ld(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...B(t)})}function dd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...B(t)})}function fd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...B(t)})}function pd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...B(t)})}function md(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...B(t)})}function hd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...B(t)})}function F_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...B(t)})}function U_(e,t){return new e({type:"string",format:"date",check:"string_format",...B(t)})}function V_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...B(t)})}function H_(e,t){return new e({type:"string",format:"duration",check:"string_format",...B(t)})}function gd(e,t){return new e({type:"number",checks:[],...B(t)})}function yd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...B(t)})}function _d(e,t){return new e({type:"boolean",...B(t)})}function vd(e,t){return new e({type:"null",...B(t)})}function bd(e){return new e({type:"unknown"})}function wd(e,t){return new e({type:"never",...B(t)})}function ya(e,t){return new il({check:"less_than",...B(t),value:e,inclusive:!1})}function Ai(e,t){return new il({check:"less_than",...B(t),value:e,inclusive:!0})}function _a(e,t){return new sl({check:"greater_than",...B(t),value:e,inclusive:!1})}function qi(e,t){return new sl({check:"greater_than",...B(t),value:e,inclusive:!0})}function va(e,t){return new f_({check:"multiple_of",...B(t),value:e})}function ba(e,t){return new m_({check:"max_length",...B(t),maximum:e})}function ko(e,t){return new h_({check:"min_length",...B(t),minimum:e})}function wa(e,t){return new g_({check:"length_equals",...B(t),length:e})}function xd(e,t){return new y_({check:"string_format",format:"regex",...B(t),pattern:e})}function $d(e){return new __({check:"string_format",format:"lowercase",...B(e)})}function Sd(e){return new v_({check:"string_format",format:"uppercase",...B(e)})}function kd(e,t){return new b_({check:"string_format",format:"includes",...B(t),includes:e})}function Pd(e,t){return new w_({check:"string_format",format:"starts_with",...B(t),prefix:e})}function Td(e,t){return new x_({check:"string_format",format:"ends_with",...B(t),suffix:e})}function Fn(e){return new $_({check:"overwrite",tx:e})}function zd(e){return Fn(t=>t.normalize(e))}function Rd(){return Fn(e=>e.trim())}function Ed(){return Fn(e=>e.toLowerCase())}function Od(){return Fn(e=>e.toUpperCase())}function B_(e,t,r){return new e({type:"array",element:t,...B(r)})}function Cd(e,t,r){let n=B(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function jd(e,t,r){return new e({type:"custom",check:"custom",fn:t,...B(r)})}var xa=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Br,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,t],path:r.path},h=t._zod.parent;if(h)a.ref=h,this.process(h,d),this.seen.get(h).isParent=!0;else{let m=a.schema;switch(o.type){case"string":{let p=m;p.type="string";let{minimum:y,maximum:v,format:P,patterns:T,contentEncoding:R}=t._zod.bag;if(typeof y=="number"&&(p.minLength=y),typeof v=="number"&&(p.maxLength=v),P&&(p.format=i[P]??P,p.format===""&&delete p.format),R&&(p.contentEncoding=R),T&&T.size>0){let I=[...T];I.length===1?p.pattern=I[0].source:I.length>1&&(a.schema.allOf=[...I.map(C=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))])}break}case"number":{let p=m,{minimum:y,maximum:v,format:P,multipleOf:T,exclusiveMaximum:R,exclusiveMinimum:I}=t._zod.bag;typeof P=="string"&&P.includes("int")?p.type="integer":p.type="number",typeof I=="number"&&(p.exclusiveMinimum=I),typeof y=="number"&&(p.minimum=y,typeof I=="number"&&(I>=y?delete p.minimum:delete p.exclusiveMinimum)),typeof R=="number"&&(p.exclusiveMaximum=R),typeof v=="number"&&(p.maximum=v,typeof R=="number"&&(R<=v?delete p.maximum:delete p.exclusiveMaximum)),typeof T=="number"&&(p.multipleOf=T);break}case"boolean":{let p=m;p.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{m.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let p=m,{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(p.minItems=y),typeof v=="number"&&(p.maxItems=v),p.type="array",p.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let p=m;p.type="object",p.properties={};let y=o.shape;for(let T in y)p.properties[T]=this.process(y[T],{...d,path:[...d.path,"properties",T]});let v=new Set(Object.keys(y)),P=new Set([...v].filter(T=>{let R=o.shape[T]._zod;return this.io==="input"?R.optin===void 0:R.optout===void 0}));P.size>0&&(p.required=Array.from(P)),o.catchall?._zod.def.type==="never"?p.additionalProperties=!1:o.catchall?o.catchall&&(p.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(p.additionalProperties=!1);break}case"union":{let p=m;p.anyOf=o.options.map((y,v)=>this.process(y,{...d,path:[...d.path,"anyOf",v]}));break}case"intersection":{let p=m,y=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),v=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),P=R=>"allOf"in R&&Object.keys(R).length===1,T=[...P(y)?y.allOf:[y],...P(v)?v.allOf:[v]];p.allOf=T;break}case"tuple":{let p=m;p.type="array";let y=o.items.map((T,R)=>this.process(T,{...d,path:[...d.path,"prefixItems",R]}));if(this.target==="draft-2020-12"?p.prefixItems=y:p.items=y,o.rest){let T=this.process(o.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?p.items=T:p.additionalItems=T}o.rest&&(p.items=this.process(o.rest,{...d,path:[...d.path,"items"]}));let{minimum:v,maximum:P}=t._zod.bag;typeof v=="number"&&(p.minItems=v),typeof P=="number"&&(p.maxItems=P);break}case"record":{let p=m;p.type="object",p.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]}),p.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let p=m,y=Ri(o.entries);y.every(v=>typeof v=="number")&&(p.type="number"),y.every(v=>typeof v=="string")&&(p.type="string"),p.enum=y;break}case"literal":{let p=m,y=[];for(let v of o.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(v))}else y.push(v);if(y.length!==0)if(y.length===1){let v=y[0];p.type=v===null?"null":typeof v,p.const=v}else y.every(v=>typeof v=="number")&&(p.type="number"),y.every(v=>typeof v=="string")&&(p.type="string"),y.every(v=>typeof v=="boolean")&&(p.type="string"),y.every(v=>v===null)&&(p.type="null"),p.enum=y;break}case"file":{let p=m,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:P,mime:T}=t._zod.bag;v!==void 0&&(y.minLength=v),P!==void 0&&(y.maxLength=P),T?T.length===1?(y.contentMediaType=T[0],Object.assign(p,y)):p.anyOf=T.map(R=>({...y,contentMediaType:R})):Object.assign(p,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(o.innerType,d);m.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"success":{let p=m;p.type="boolean";break}case"default":{this.process(o.innerType,d),a.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,d),a.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,d),a.ref=o.innerType;let p;try{p=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}m.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=m,y=t._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");p.type="string",p.pattern=y.source;break}case"pipe":{let p=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(p,d),a.ref=p;break}case"readonly":{this.process(o.innerType,d),a.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,d),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"lazy":{let p=t._zod.innerType;this.process(p,d),a.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Ue(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=l=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(l[0])?.id,v=n.external.uri??(T=>T);if(y)return{ref:v(y)};let P=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=P,{defId:P,ref:`${v("__shared")}#/${d}/${P}`}}if(l[1]===o)return{ref:"#"};let m=`#/${d}/`,p=l[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:m+p}},s=l=>{if(l[1].schema.$ref)return;let d=l[1],{ref:h,defId:m}=i(l);d.def={...d.schema},m&&(d.defId=m);let p=d.schema;for(let y in p)delete p[y];p.$ref=h};if(n.cycles==="throw")for(let l of this.seen.entries()){let d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
44
+ path: iss.path ? [${qn(T)}, ...iss.path] : [${qn(T)}]
45
+ })));`),h.write(`newResult[${qn(T)}] = ${z}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let P=h.compile();return(T,z)=>P(d,T,z)},o,i=So,s=!sa.jitless,c=s&&Bu.value,u=t.catchall,l;e._zod.parse=(d,h)=>{l??(l=r.value);let m=d.value;if(!i(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;let p=[];if(s&&c&&h?.async===!1&&h.jitless!==!0)o||(o=n(t.shape)),d=o(d,h);else{d.value={};let z=l.shape;for(let M of l.keys){let C=z[M],Ne=C._zod.run({value:m[M],issues:[]},h),de=C._zod.optin==="optional"&&C._zod.optout==="optional";Ne instanceof Promise?p.push(Ne.then(mt=>de?E_(mt,d,M,m):pa(mt,d,M))):de?E_(Ne,d,M,m):pa(Ne,d,M)}}if(!u)return p.length?Promise.all(p).then(()=>d):d;let y=[],v=l.keySet,P=u._zod,T=P.def.type;for(let z of Object.keys(m)){if(v.has(z))continue;if(T==="never"){y.push(z);continue}let M=P.run({value:m[z],issues:[]},h);M instanceof Promise?p.push(M.then(C=>pa(C,d,z))):pa(M,d,z)}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:m,inst:e}),p.length?Promise.all(p).then(()=>d):d}});function O_(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=>Jt(i,n,Et())))}),t}var ga=x("$ZodUnion",(e,t)=>{ge.init(e,t),be(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),be(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),be(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),be(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=>ji(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=>O_(s,r,e,n)):O_(i,r,e,n)}}),Il=x("$ZodDiscriminatedUnion",(e,t)=>{ga.init(e,t);let r=e._zod.parse;be(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=Oi(()=>{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(!So(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)}}),Ml=x("$ZodIntersection",(e,t)=>{ge.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])=>C_(r,c,u)):C_(r,i,s)}});function ul(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(ko(e)&&ko(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=ul(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=ul(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 C_(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Zn(e))return e;let n=ul(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 Dl=x("$ZodRecord",(e,t)=>{ge.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ko(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(...lr(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...lr(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=>Jt(u,n,Et())),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(...lr(s,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...lr(s,c.issues)),r.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Al=x("$ZodEnum",(e,t)=>{ge.init(e,t);let r=Ei(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Wu.has(typeof n)).map(n=>typeof n=="string"?Hr(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}}),ql=x("$ZodLiteral",(e,t)=>{ge.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Hr(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 Zl=x("$ZodTransform",(e,t)=>{ge.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 kr;return r.value=o,r}}),Ll=x("$ZodOptional",(e,t)=>{ge.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),be(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ji(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)}),Fl=x("$ZodNullable",(e,t)=>{ge.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ji(r.source)}|null)$`):void 0}),be(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)}),Ul=x("$ZodDefault",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(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=>j_(i,t)):j_(o,t)}});function j_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Vl=x("$ZodPrefault",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(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))}),Hl=x("$ZodNonOptional",(e,t)=>{ge.init(e,t),be(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=>N_(i,e)):N_(o,e)}});function N_(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 Bl=x("$ZodCatch",(e,t)=>{ge.init(e,t),e._zod.optin="optional",be(e._zod,"optout",()=>t.innerType._zod.optout),be(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=>Jt(s,n,Et()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>Jt(i,n,Et()))},input:r.value}),r.issues=[]),r)}});var Wl=x("$ZodPipe",(e,t)=>{ge.init(e,t),be(e._zod,"values",()=>t.in._zod.values),be(e._zod,"optin",()=>t.in._zod.optin),be(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=>I_(i,t,n)):I_(o,t,n)}});function I_(e,t,r){return Zn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}var Jl=x("$ZodReadonly",(e,t)=>{ge.init(e,t),be(e._zod,"propValues",()=>t.innerType._zod.propValues),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"optin",()=>t.innerType._zod.optin),be(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(M_):M_(o)}});function M_(e){return e.value=Object.freeze(e.value),e}var Gl=x("$ZodCustom",(e,t)=>{Ye.init(e,t),ge.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=>D_(i,r,n,e));D_(o,r,n,e)}});function D_(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(Ku(o))}}var sR=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},aR=()=>{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 ${sR(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${ua(n.values[0])}`:`Invalid option: expected one of ${aa(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":""}: ${aa(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 U_(){return{localeError:aR()}}var Ai=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 V_(){return new Ai}var Br=V_();function Kl(e,t){return new e({type:"string",...B(t)})}function Xl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...B(t)})}function ya(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...B(t)})}function Yl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...B(t)})}function Ql(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...B(t)})}function ed(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...B(t)})}function td(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...B(t)})}function rd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...B(t)})}function nd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...B(t)})}function od(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...B(t)})}function id(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...B(t)})}function sd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...B(t)})}function ad(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...B(t)})}function cd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...B(t)})}function ud(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...B(t)})}function ld(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...B(t)})}function dd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...B(t)})}function fd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...B(t)})}function pd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...B(t)})}function md(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...B(t)})}function hd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...B(t)})}function gd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...B(t)})}function yd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...B(t)})}function H_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...B(t)})}function B_(e,t){return new e({type:"string",format:"date",check:"string_format",...B(t)})}function W_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...B(t)})}function J_(e,t){return new e({type:"string",format:"duration",check:"string_format",...B(t)})}function _d(e,t){return new e({type:"number",checks:[],...B(t)})}function vd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...B(t)})}function bd(e,t){return new e({type:"boolean",...B(t)})}function wd(e,t){return new e({type:"null",...B(t)})}function xd(e){return new e({type:"unknown"})}function $d(e,t){return new e({type:"never",...B(t)})}function _a(e,t){return new al({check:"less_than",...B(t),value:e,inclusive:!1})}function qi(e,t){return new al({check:"less_than",...B(t),value:e,inclusive:!0})}function va(e,t){return new cl({check:"greater_than",...B(t),value:e,inclusive:!1})}function Zi(e,t){return new cl({check:"greater_than",...B(t),value:e,inclusive:!0})}function ba(e,t){return new h_({check:"multiple_of",...B(t),value:e})}function wa(e,t){return new y_({check:"max_length",...B(t),maximum:e})}function Po(e,t){return new __({check:"min_length",...B(t),minimum:e})}function xa(e,t){return new v_({check:"length_equals",...B(t),length:e})}function Sd(e,t){return new b_({check:"string_format",format:"regex",...B(t),pattern:e})}function kd(e){return new w_({check:"string_format",format:"lowercase",...B(e)})}function Pd(e){return new x_({check:"string_format",format:"uppercase",...B(e)})}function Td(e,t){return new $_({check:"string_format",format:"includes",...B(t),includes:e})}function Rd(e,t){return new S_({check:"string_format",format:"starts_with",...B(t),prefix:e})}function zd(e,t){return new k_({check:"string_format",format:"ends_with",...B(t),suffix:e})}function Un(e){return new P_({check:"overwrite",tx:e})}function Ed(e){return Un(t=>t.normalize(e))}function Od(){return Un(e=>e.trim())}function Cd(){return Un(e=>e.toLowerCase())}function jd(){return Un(e=>e.toUpperCase())}function G_(e,t,r){return new e({type:"array",element:t,...B(r)})}function Nd(e,t,r){let n=B(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Id(e,t,r){return new e({type:"custom",check:"custom",fn:t,...B(r)})}var $a=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Br,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,t],path:r.path},h=t._zod.parent;if(h)a.ref=h,this.process(h,d),this.seen.get(h).isParent=!0;else{let m=a.schema;switch(o.type){case"string":{let p=m;p.type="string";let{minimum:y,maximum:v,format:P,patterns:T,contentEncoding:z}=t._zod.bag;if(typeof y=="number"&&(p.minLength=y),typeof v=="number"&&(p.maxLength=v),P&&(p.format=i[P]??P,p.format===""&&delete p.format),z&&(p.contentEncoding=z),T&&T.size>0){let M=[...T];M.length===1?p.pattern=M[0].source:M.length>1&&(a.schema.allOf=[...M.map(C=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))])}break}case"number":{let p=m,{minimum:y,maximum:v,format:P,multipleOf:T,exclusiveMaximum:z,exclusiveMinimum:M}=t._zod.bag;typeof P=="string"&&P.includes("int")?p.type="integer":p.type="number",typeof M=="number"&&(p.exclusiveMinimum=M),typeof y=="number"&&(p.minimum=y,typeof M=="number"&&(M>=y?delete p.minimum:delete p.exclusiveMinimum)),typeof z=="number"&&(p.exclusiveMaximum=z),typeof v=="number"&&(p.maximum=v,typeof z=="number"&&(z<=v?delete p.maximum:delete p.exclusiveMaximum)),typeof T=="number"&&(p.multipleOf=T);break}case"boolean":{let p=m;p.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{m.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let p=m,{minimum:y,maximum:v}=t._zod.bag;typeof y=="number"&&(p.minItems=y),typeof v=="number"&&(p.maxItems=v),p.type="array",p.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let p=m;p.type="object",p.properties={};let y=o.shape;for(let T in y)p.properties[T]=this.process(y[T],{...d,path:[...d.path,"properties",T]});let v=new Set(Object.keys(y)),P=new Set([...v].filter(T=>{let z=o.shape[T]._zod;return this.io==="input"?z.optin===void 0:z.optout===void 0}));P.size>0&&(p.required=Array.from(P)),o.catchall?._zod.def.type==="never"?p.additionalProperties=!1:o.catchall?o.catchall&&(p.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(p.additionalProperties=!1);break}case"union":{let p=m;p.anyOf=o.options.map((y,v)=>this.process(y,{...d,path:[...d.path,"anyOf",v]}));break}case"intersection":{let p=m,y=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),v=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),P=z=>"allOf"in z&&Object.keys(z).length===1,T=[...P(y)?y.allOf:[y],...P(v)?v.allOf:[v]];p.allOf=T;break}case"tuple":{let p=m;p.type="array";let y=o.items.map((T,z)=>this.process(T,{...d,path:[...d.path,"prefixItems",z]}));if(this.target==="draft-2020-12"?p.prefixItems=y:p.items=y,o.rest){let T=this.process(o.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?p.items=T:p.additionalItems=T}o.rest&&(p.items=this.process(o.rest,{...d,path:[...d.path,"items"]}));let{minimum:v,maximum:P}=t._zod.bag;typeof v=="number"&&(p.minItems=v),typeof P=="number"&&(p.maxItems=P);break}case"record":{let p=m;p.type="object",p.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]}),p.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let p=m,y=Ei(o.entries);y.every(v=>typeof v=="number")&&(p.type="number"),y.every(v=>typeof v=="string")&&(p.type="string"),p.enum=y;break}case"literal":{let p=m,y=[];for(let v of o.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(v))}else y.push(v);if(y.length!==0)if(y.length===1){let v=y[0];p.type=v===null?"null":typeof v,p.const=v}else y.every(v=>typeof v=="number")&&(p.type="number"),y.every(v=>typeof v=="string")&&(p.type="string"),y.every(v=>typeof v=="boolean")&&(p.type="string"),y.every(v=>v===null)&&(p.type="null"),p.enum=y;break}case"file":{let p=m,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:P,mime:T}=t._zod.bag;v!==void 0&&(y.minLength=v),P!==void 0&&(y.maxLength=P),T?T.length===1?(y.contentMediaType=T[0],Object.assign(p,y)):p.anyOf=T.map(z=>({...y,contentMediaType:z})):Object.assign(p,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(o.innerType,d);m.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"success":{let p=m;p.type="boolean";break}case"default":{this.process(o.innerType,d),a.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,d),a.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,d),a.ref=o.innerType;let p;try{p=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}m.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=m,y=t._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");p.type="string",p.pattern=y.source;break}case"pipe":{let p=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(p,d),a.ref=p;break}case"readonly":{this.process(o.innerType,d),a.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,d),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"lazy":{let p=t._zod.innerType;this.process(p,d),a.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&Ue(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=l=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(l[0])?.id,v=n.external.uri??(T=>T);if(y)return{ref:v(y)};let P=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=P,{defId:P,ref:`${v("__shared")}#/${d}/${P}`}}if(l[1]===o)return{ref:"#"};let m=`#/${d}/`,p=l[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:m+p}},s=l=>{if(l[1].schema.$ref)return;let d=l[1],{ref:h,defId:m}=i(l);d.def={...d.schema},m&&(d.defId=m);let p=d.schema;for(let y in p)delete p[y];p.$ref=h};if(n.cycles==="throw")for(let l of this.seen.entries()){let d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
46
46
 
47
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let d=l[1];if(t===l[0]){s(l);continue}if(n.external){let m=n.external.registry.get(l[0])?.id;if(t!==l[0]&&m){s(l);continue}}if(this.metadataRegistry.get(l[0])?.id){s(l);continue}if(d.cycle){s(l);continue}if(d.count>1&&n.reused==="ref"){s(l);continue}}let a=(l,d)=>{let h=this.seen.get(l),m=h.def??h.schema,p={...m};if(h.ref===null)return;let y=h.ref;if(h.ref=null,y){a(y,d);let v=this.seen.get(y).schema;v.$ref&&d.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(v)):(Object.assign(m,v),Object.assign(m,p))}h.isParent||this.override({zodSchema:l,jsonSchema:m,path:h.path??[]})};for(let l of[...this.seen.entries()].reverse())a(l[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let l=n.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(l)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let l of this.seen.entries()){let d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}};function Md(e,t){if(e instanceof Di){let n=new xa(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new xa(t);return r.process(e),r.emit(e,t)}function Ue(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ue(o.element,r);case"object":{for(let i in o.shape)if(Ue(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Ue(i,r))return!0;return!1}case"intersection":return Ue(o.left,r)||Ue(o.right,r);case"tuple":{for(let i of o.items)if(Ue(i,r))return!0;return!!(o.rest&&Ue(o.rest,r))}case"record":return Ue(o.keyType,r)||Ue(o.valueType,r);case"map":return Ue(o.keyType,r)||Ue(o.valueType,r);case"set":return Ue(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ue(o.innerType,r);case"lazy":return Ue(o.getter(),r);case"default":return Ue(o.innerType,r);case"prefault":return Ue(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Ue(o.in,r)||Ue(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var Dz=x("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ge.init(e,t),e.def=t,e.parse=(r,n)=>Yu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Zn(e,r,n),e.parseAsync=async(r,n)=>el(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ln(e,r,n),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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e))});var Az=x("ZodMiniObject",(e,t)=>{ma.init(e,t),Dz.init(e,t),ne.defineLazy(e,"shape",()=>t.shape)});function Nd(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new Az(r)}function At(e){return!!e._zod}function Vn(e){let t=Object.values(e);if(t.length===0)return Nd({});let r=t.every(At),n=t.every(o=>!At(o));if(r)return Nd(e);if(n)return Au(e);throw new Error("Mixed Zod versions detected in object shape.")}function Wr(e,t){return At(e)?Zn(e,t):e.safeParse(t)}async function $a(e,t){return At(e)?await Ln(e,t):await e.safeParseAsync(t)}function Jr(e){if(!e)return;let t;if(At(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Po(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let n=Object.values(e);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return Vn(e)}}if(At(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function Sa(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function J_(e){return e.description}function G_(e){if(At(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function ka(e){if(At(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 Zi={};Ys(Zi,{ZodISODate:()=>X_,ZodISODateTime:()=>K_,ZodISODuration:()=>Q_,ZodISOTime:()=>Y_,date:()=>Dd,datetime:()=>Id,duration:()=>qd,time:()=>Ad});var K_=x("ZodISODateTime",(e,t)=>{N_.init(e,t),Ee.init(e,t)});function Id(e){return F_(K_,e)}var X_=x("ZodISODate",(e,t)=>{I_.init(e,t),Ee.init(e,t)});function Dd(e){return U_(X_,e)}var Y_=x("ZodISOTime",(e,t)=>{D_.init(e,t),Ee.init(e,t)});function Ad(e){return V_(Y_,e)}var Q_=x("ZodISODuration",(e,t)=>{A_.init(e,t),Ee.init(e,t)});function qd(e){return H_(Q_,e)}var ev=(e,t)=>{ua.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ku(e,r)},flatten:{value:r=>Gu(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},PZ=x("ZodError",ev),Li=x("ZodError",ev,{Parent:Error});var tv=Xu(Li),rv=Qu(Li),nv=tl(Li),ov=rl(Li);var Ie=x("ZodType",(e,t)=>(ge.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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>tv(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nv(e,r,n),e.parseAsync=async(r,n)=>rv(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ov(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(NR(r,n)),e.superRefine=r=>e.check(IR(r)),e.overwrite=r=>e.check(Fn(r)),e.optional=()=>Ce(e),e.nullable=()=>av(e),e.nullish=()=>Ce(av(e)),e.nonoptional=r=>zR(e,r),e.array=()=>oe(e),e.or=r=>ke([e,r]),e.and=r=>Ta(e,r),e.transform=r=>Ld(e,pv(r)),e.default=r=>kR(e,r),e.prefault=r=>TR(e,r),e.catch=r=>ER(e,r),e.pipe=r=>Ld(e,r),e.readonly=()=>jR(e),e.describe=r=>{let n=e.clone();return Br.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Br.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Br.get(e);let n=e.clone();return Br.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),cv=x("_ZodString",(e,t)=>{Ii.init(e,t),Ie.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(xd(...n)),e.includes=(...n)=>e.check(kd(...n)),e.startsWith=(...n)=>e.check(Pd(...n)),e.endsWith=(...n)=>e.check(Td(...n)),e.min=(...n)=>e.check(ko(...n)),e.max=(...n)=>e.check(ba(...n)),e.length=(...n)=>e.check(wa(...n)),e.nonempty=(...n)=>e.check(ko(1,...n)),e.lowercase=n=>e.check($d(n)),e.uppercase=n=>e.check(Sd(n)),e.trim=()=>e.check(Rd()),e.normalize=(...n)=>e.check(zd(...n)),e.toLowerCase=()=>e.check(Ed()),e.toUpperCase=()=>e.check(Od())}),Wz=x("ZodString",(e,t)=>{Ii.init(e,t),cv.init(e,t),e.email=r=>e.check(Gl(Jz,r)),e.url=r=>e.check(ed(Gz,r)),e.jwt=r=>e.check(hd(lR,r)),e.emoji=r=>e.check(td(Kz,r)),e.guid=r=>e.check(ga(iv,r)),e.uuid=r=>e.check(Kl(Pa,r)),e.uuidv4=r=>e.check(Xl(Pa,r)),e.uuidv6=r=>e.check(Yl(Pa,r)),e.uuidv7=r=>e.check(Ql(Pa,r)),e.nanoid=r=>e.check(rd(Xz,r)),e.guid=r=>e.check(ga(iv,r)),e.cuid=r=>e.check(nd(Yz,r)),e.cuid2=r=>e.check(od(Qz,r)),e.ulid=r=>e.check(id(eR,r)),e.base64=r=>e.check(fd(aR,r)),e.base64url=r=>e.check(pd(cR,r)),e.xid=r=>e.check(sd(tR,r)),e.ksuid=r=>e.check(ad(rR,r)),e.ipv4=r=>e.check(cd(nR,r)),e.ipv6=r=>e.check(ud(oR,r)),e.cidrv4=r=>e.check(ld(iR,r)),e.cidrv6=r=>e.check(dd(sR,r)),e.e164=r=>e.check(md(uR,r)),e.datetime=r=>e.check(Id(r)),e.date=r=>e.check(Dd(r)),e.time=r=>e.check(Ad(r)),e.duration=r=>e.check(qd(r))});function b(e){return Jl(Wz,e)}var Ee=x("ZodStringFormat",(e,t)=>{we.init(e,t),cv.init(e,t)}),Jz=x("ZodEmail",(e,t)=>{ll.init(e,t),Ee.init(e,t)});var iv=x("ZodGUID",(e,t)=>{cl.init(e,t),Ee.init(e,t)});var Pa=x("ZodUUID",(e,t)=>{ul.init(e,t),Ee.init(e,t)});var Gz=x("ZodURL",(e,t)=>{dl.init(e,t),Ee.init(e,t)});var Kz=x("ZodEmoji",(e,t)=>{fl.init(e,t),Ee.init(e,t)});var Xz=x("ZodNanoID",(e,t)=>{pl.init(e,t),Ee.init(e,t)});var Yz=x("ZodCUID",(e,t)=>{ml.init(e,t),Ee.init(e,t)});var Qz=x("ZodCUID2",(e,t)=>{hl.init(e,t),Ee.init(e,t)});var eR=x("ZodULID",(e,t)=>{gl.init(e,t),Ee.init(e,t)});var tR=x("ZodXID",(e,t)=>{yl.init(e,t),Ee.init(e,t)});var rR=x("ZodKSUID",(e,t)=>{_l.init(e,t),Ee.init(e,t)});var nR=x("ZodIPv4",(e,t)=>{vl.init(e,t),Ee.init(e,t)});var oR=x("ZodIPv6",(e,t)=>{bl.init(e,t),Ee.init(e,t)});var iR=x("ZodCIDRv4",(e,t)=>{wl.init(e,t),Ee.init(e,t)});var sR=x("ZodCIDRv6",(e,t)=>{xl.init(e,t),Ee.init(e,t)});var aR=x("ZodBase64",(e,t)=>{$l.init(e,t),Ee.init(e,t)});var cR=x("ZodBase64URL",(e,t)=>{Sl.init(e,t),Ee.init(e,t)});var uR=x("ZodE164",(e,t)=>{kl.init(e,t),Ee.init(e,t)});var lR=x("ZodJWT",(e,t)=>{Pl.init(e,t),Ee.init(e,t)});var uv=x("ZodNumber",(e,t)=>{pa.init(e,t),Ie.init(e,t),e.gt=(n,o)=>e.check(_a(n,o)),e.gte=(n,o)=>e.check(qi(n,o)),e.min=(n,o)=>e.check(qi(n,o)),e.lt=(n,o)=>e.check(ya(n,o)),e.lte=(n,o)=>e.check(Ai(n,o)),e.max=(n,o)=>e.check(Ai(n,o)),e.int=n=>e.check(sv(n)),e.safe=n=>e.check(sv(n)),e.positive=n=>e.check(_a(0,n)),e.nonnegative=n=>e.check(qi(0,n)),e.negative=n=>e.check(ya(0,n)),e.nonpositive=n=>e.check(Ai(0,n)),e.multipleOf=(n,o)=>e.check(va(n,o)),e.step=(n,o)=>e.check(va(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 me(e){return gd(uv,e)}var dR=x("ZodNumberFormat",(e,t)=>{Tl.init(e,t),uv.init(e,t)});function sv(e){return yd(dR,e)}var fR=x("ZodBoolean",(e,t)=>{zl.init(e,t),Ie.init(e,t)});function Be(e){return _d(fR,e)}var pR=x("ZodNull",(e,t)=>{Rl.init(e,t),Ie.init(e,t)});function lv(e){return vd(pR,e)}var mR=x("ZodUnknown",(e,t)=>{El.init(e,t),Ie.init(e,t)});function Oe(){return bd(mR)}var hR=x("ZodNever",(e,t)=>{Ol.init(e,t),Ie.init(e,t)});function gR(e){return wd(hR,e)}var yR=x("ZodArray",(e,t)=>{Cl.init(e,t),Ie.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ko(r,n)),e.nonempty=r=>e.check(ko(1,r)),e.max=(r,n)=>e.check(ba(r,n)),e.length=(r,n)=>e.check(wa(r,n)),e.unwrap=()=>e.element});function oe(e,t){return B_(yR,e,t)}var dv=x("ZodObject",(e,t)=>{ma.init(e,t),Ie.init(e,t),ne.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>xt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oe()}),e.strict=()=>e.clone({...e._zod.def,catchall:gR()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ne.extend(e,r),e.merge=r=>ne.merge(e,r),e.pick=r=>ne.pick(e,r),e.omit=r=>ne.omit(e,r),e.partial=(...r)=>ne.partial(mv,e,r[0]),e.required=(...r)=>ne.required(hv,e,r[0])});function N(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new dv(r)}function ht(e,t){return new dv({type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},catchall:Oe(),...ne.normalizeParams(t)})}var fv=x("ZodUnion",(e,t)=>{ha.init(e,t),Ie.init(e,t),e.options=t.options});function ke(e,t){return new fv({type:"union",options:e,...ne.normalizeParams(t)})}var _R=x("ZodDiscriminatedUnion",(e,t)=>{fv.init(e,t),jl.init(e,t)});function Fd(e,t,r){return new _R({type:"union",options:t,discriminator:e,...ne.normalizeParams(r)})}var vR=x("ZodIntersection",(e,t)=>{Ml.init(e,t),Ie.init(e,t)});function Ta(e,t){return new vR({type:"intersection",left:e,right:t})}var bR=x("ZodRecord",(e,t)=>{Nl.init(e,t),Ie.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function xe(e,t,r){return new bR({type:"record",keyType:e,valueType:t,...ne.normalizeParams(r)})}var Zd=x("ZodEnum",(e,t)=>{Il.init(e,t),Ie.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 Zd({...t,checks:[],...ne.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 Zd({...t,checks:[],...ne.normalizeParams(o),entries:i})}});function xt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Zd({type:"enum",entries:r,...ne.normalizeParams(t)})}var wR=x("ZodLiteral",(e,t)=>{Dl.init(e,t),Ie.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 L(e,t){return new wR({type:"literal",values:Array.isArray(e)?e:[e],...ne.normalizeParams(t)})}var xR=x("ZodTransform",(e,t)=>{Al.init(e,t),Ie.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(ne.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(ne.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 pv(e){return new xR({type:"transform",transform:e})}var mv=x("ZodOptional",(e,t)=>{ql.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ce(e){return new mv({type:"optional",innerType:e})}var $R=x("ZodNullable",(e,t)=>{Zl.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function av(e){return new $R({type:"nullable",innerType:e})}var SR=x("ZodDefault",(e,t)=>{Ll.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kR(e,t){return new SR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var PR=x("ZodPrefault",(e,t)=>{Fl.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function TR(e,t){return new PR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var hv=x("ZodNonOptional",(e,t)=>{Ul.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zR(e,t){return new hv({type:"nonoptional",innerType:e,...ne.normalizeParams(t)})}var RR=x("ZodCatch",(e,t)=>{Vl.init(e,t),Ie.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ER(e,t){return new RR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var OR=x("ZodPipe",(e,t)=>{Hl.init(e,t),Ie.init(e,t),e.in=t.in,e.out=t.out});function Ld(e,t){return new OR({type:"pipe",in:e,out:t})}var CR=x("ZodReadonly",(e,t)=>{Bl.init(e,t),Ie.init(e,t)});function jR(e){return new CR({type:"readonly",innerType:e})}var gv=x("ZodCustom",(e,t)=>{Wl.init(e,t),Ie.init(e,t)});function MR(e){let t=new Ye({check:"custom"});return t._zod.check=e,t}function yv(e,t){return Cd(gv,e??(()=>!0),t)}function NR(e,t={}){return jd(gv,e,t)}function IR(e){let t=MR(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ne.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(ne.issue(o))}},e(r.value,r)));return t}function Ud(e,t){return Ld(pv(e),t)}Et(Z_());var Hd="2025-11-25";var _v=[Hd,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Gr="io.modelcontextprotocol/related-task",Ra="2.0",Ve=yv(e=>e!==null&&(typeof e=="object"||typeof e=="function")),vv=ke([b(),me().int()]),bv=b(),ZZ=ht({ttl:me().optional(),pollInterval:me().optional()}),DR=N({ttl:me().optional()}),AR=N({taskId:b()}),Bd=ht({progressToken:vv.optional(),[Gr]:AR.optional()}),Ct=N({_meta:Bd.optional()}),Fi=Ct.extend({task:DR.optional()}),wv=e=>Fi.safeParse(e).success,Qe=N({method:b(),params:Ct.loose().optional()}),qt=N({_meta:Bd.optional()}),Zt=N({method:b(),params:qt.loose().optional()}),et=ht({_meta:Bd.optional()}),Ea=ke([b(),me().int()]),xv=N({jsonrpc:L(Ra),id:Ea,...Qe.shape}).strict(),Wd=e=>xv.safeParse(e).success,$v=N({jsonrpc:L(Ra),...Zt.shape}).strict(),Sv=e=>$v.safeParse(e).success,Jd=N({jsonrpc:L(Ra),id:Ea,result:et}).strict(),Ui=e=>Jd.safeParse(e).success;var U;(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"})(U||(U={}));var Gd=N({jsonrpc:L(Ra),id:Ea.optional(),error:N({code:me().int(),message:b(),data:Oe().optional()})}).strict();var kv=e=>Gd.safeParse(e).success;var Pv=ke([xv,$v,Jd,Gd]),LZ=ke([Jd,Gd]),Oa=et.strict(),qR=qt.extend({requestId:Ea.optional(),reason:b().optional()}),Ca=Zt.extend({method:L("notifications/cancelled"),params:qR}),ZR=N({src:b(),mimeType:b().optional(),sizes:oe(b()).optional(),theme:xt(["light","dark"]).optional()}),Vi=N({icons:oe(ZR).optional()}),To=N({name:b(),title:b().optional()}),Tv=To.extend({...To.shape,...Vi.shape,version:b(),websiteUrl:b().optional(),description:b().optional()}),LR=Ta(N({applyDefaults:Be().optional()}),xe(b(),Oe())),FR=Ud(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ta(N({form:LR.optional(),url:Ve.optional()}),xe(b(),Oe()).optional())),UR=ht({list:Ve.optional(),cancel:Ve.optional(),requests:ht({sampling:ht({createMessage:Ve.optional()}).optional(),elicitation:ht({create:Ve.optional()}).optional()}).optional()}),VR=ht({list:Ve.optional(),cancel:Ve.optional(),requests:ht({tools:ht({call:Ve.optional()}).optional()}).optional()}),HR=N({experimental:xe(b(),Ve).optional(),sampling:N({context:Ve.optional(),tools:Ve.optional()}).optional(),elicitation:FR.optional(),roots:N({listChanged:Be().optional()}).optional(),tasks:UR.optional(),extensions:xe(b(),Ve).optional()}),BR=Ct.extend({protocolVersion:b(),capabilities:HR,clientInfo:Tv}),Kd=Qe.extend({method:L("initialize"),params:BR});var WR=N({experimental:xe(b(),Ve).optional(),logging:Ve.optional(),completions:Ve.optional(),prompts:N({listChanged:Be().optional()}).optional(),resources:N({subscribe:Be().optional(),listChanged:Be().optional()}).optional(),tools:N({listChanged:Be().optional()}).optional(),tasks:VR.optional(),extensions:xe(b(),Ve).optional()}),JR=et.extend({protocolVersion:b(),capabilities:WR,serverInfo:Tv,instructions:b().optional()}),Xd=Zt.extend({method:L("notifications/initialized"),params:qt.optional()});var ja=Qe.extend({method:L("ping"),params:Ct.optional()}),GR=N({progress:me(),total:Ce(me()),message:Ce(b())}),KR=N({...qt.shape,...GR.shape,progressToken:vv}),Ma=Zt.extend({method:L("notifications/progress"),params:KR}),XR=Ct.extend({cursor:bv.optional()}),Hi=Qe.extend({params:XR.optional()}),Bi=et.extend({nextCursor:bv.optional()}),YR=xt(["working","input_required","completed","failed","cancelled"]),Wi=N({taskId:b(),status:YR,ttl:ke([me(),lv()]),createdAt:b(),lastUpdatedAt:b(),pollInterval:Ce(me()),statusMessage:Ce(b())}),zo=et.extend({task:Wi}),QR=qt.merge(Wi),Ji=Zt.extend({method:L("notifications/tasks/status"),params:QR}),Na=Qe.extend({method:L("tasks/get"),params:Ct.extend({taskId:b()})}),Ia=et.merge(Wi),Da=Qe.extend({method:L("tasks/result"),params:Ct.extend({taskId:b()})}),FZ=et.loose(),Aa=Hi.extend({method:L("tasks/list")}),qa=Bi.extend({tasks:oe(Wi)}),Za=Qe.extend({method:L("tasks/cancel"),params:Ct.extend({taskId:b()})}),zv=et.merge(Wi),Rv=N({uri:b(),mimeType:Ce(b()),_meta:xe(b(),Oe()).optional()}),Ev=Rv.extend({text:b()}),Yd=b().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ov=Rv.extend({blob:Yd}),Gi=xt(["user","assistant"]),Ro=N({audience:oe(Gi).optional(),priority:me().min(0).max(1).optional(),lastModified:Zi.datetime({offset:!0}).optional()}),Cv=N({...To.shape,...Vi.shape,uri:b(),description:Ce(b()),mimeType:Ce(b()),size:Ce(me()),annotations:Ro.optional(),_meta:Ce(ht({}))}),eE=N({...To.shape,...Vi.shape,uriTemplate:b(),description:Ce(b()),mimeType:Ce(b()),annotations:Ro.optional(),_meta:Ce(ht({}))}),La=Hi.extend({method:L("resources/list")}),tE=Bi.extend({resources:oe(Cv)}),Fa=Hi.extend({method:L("resources/templates/list")}),rE=Bi.extend({resourceTemplates:oe(eE)}),Qd=Ct.extend({uri:b()}),nE=Qd,Ua=Qe.extend({method:L("resources/read"),params:nE}),oE=et.extend({contents:oe(ke([Ev,Ov]))}),iE=Zt.extend({method:L("notifications/resources/list_changed"),params:qt.optional()}),sE=Qd,aE=Qe.extend({method:L("resources/subscribe"),params:sE}),cE=Qd,uE=Qe.extend({method:L("resources/unsubscribe"),params:cE}),lE=qt.extend({uri:b()}),dE=Zt.extend({method:L("notifications/resources/updated"),params:lE}),fE=N({name:b(),description:Ce(b()),required:Ce(Be())}),pE=N({...To.shape,...Vi.shape,description:Ce(b()),arguments:Ce(oe(fE)),_meta:Ce(ht({}))}),Va=Hi.extend({method:L("prompts/list")}),mE=Bi.extend({prompts:oe(pE)}),hE=Ct.extend({name:b(),arguments:xe(b(),b()).optional()}),Ha=Qe.extend({method:L("prompts/get"),params:hE}),ef=N({type:L("text"),text:b(),annotations:Ro.optional(),_meta:xe(b(),Oe()).optional()}),tf=N({type:L("image"),data:Yd,mimeType:b(),annotations:Ro.optional(),_meta:xe(b(),Oe()).optional()}),rf=N({type:L("audio"),data:Yd,mimeType:b(),annotations:Ro.optional(),_meta:xe(b(),Oe()).optional()}),gE=N({type:L("tool_use"),name:b(),id:b(),input:xe(b(),Oe()),_meta:xe(b(),Oe()).optional()}),yE=N({type:L("resource"),resource:ke([Ev,Ov]),annotations:Ro.optional(),_meta:xe(b(),Oe()).optional()}),_E=Cv.extend({type:L("resource_link")}),nf=ke([ef,tf,rf,_E,yE]),vE=N({role:Gi,content:nf}),bE=et.extend({description:b().optional(),messages:oe(vE)}),wE=Zt.extend({method:L("notifications/prompts/list_changed"),params:qt.optional()}),xE=N({title:b().optional(),readOnlyHint:Be().optional(),destructiveHint:Be().optional(),idempotentHint:Be().optional(),openWorldHint:Be().optional()}),$E=N({taskSupport:xt(["required","optional","forbidden"]).optional()}),jv=N({...To.shape,...Vi.shape,description:b().optional(),inputSchema:N({type:L("object"),properties:xe(b(),Ve).optional(),required:oe(b()).optional()}).catchall(Oe()),outputSchema:N({type:L("object"),properties:xe(b(),Ve).optional(),required:oe(b()).optional()}).catchall(Oe()).optional(),annotations:xE.optional(),execution:$E.optional(),_meta:xe(b(),Oe()).optional()}),Ba=Hi.extend({method:L("tools/list")}),SE=Bi.extend({tools:oe(jv)}),Wa=et.extend({content:oe(nf).default([]),structuredContent:xe(b(),Oe()).optional(),isError:Be().optional()}),UZ=Wa.or(et.extend({toolResult:Oe()})),kE=Fi.extend({name:b(),arguments:xe(b(),Oe()).optional()}),Eo=Qe.extend({method:L("tools/call"),params:kE}),PE=Zt.extend({method:L("notifications/tools/list_changed"),params:qt.optional()}),VZ=N({autoRefresh:Be().default(!0),debounceMs:me().int().nonnegative().default(300)}),Ki=xt(["debug","info","notice","warning","error","critical","alert","emergency"]),TE=Ct.extend({level:Ki}),of=Qe.extend({method:L("logging/setLevel"),params:TE}),zE=qt.extend({level:Ki,logger:b().optional(),data:Oe()}),RE=Zt.extend({method:L("notifications/message"),params:zE}),EE=N({name:b().optional()}),OE=N({hints:oe(EE).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),CE=N({mode:xt(["auto","required","none"]).optional()}),jE=N({type:L("tool_result"),toolUseId:b().describe("The unique identifier for the corresponding tool call."),content:oe(nf).default([]),structuredContent:N({}).loose().optional(),isError:Be().optional(),_meta:xe(b(),Oe()).optional()}),ME=Fd("type",[ef,tf,rf]),za=Fd("type",[ef,tf,rf,gE,jE]),NE=N({role:Gi,content:ke([za,oe(za)]),_meta:xe(b(),Oe()).optional()}),IE=Fi.extend({messages:oe(NE),modelPreferences:OE.optional(),systemPrompt:b().optional(),includeContext:xt(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:oe(b()).optional(),metadata:Ve.optional(),tools:oe(jv).optional(),toolChoice:CE.optional()}),DE=Qe.extend({method:L("sampling/createMessage"),params:IE}),Xi=et.extend({model:b(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens"]).or(b())),role:Gi,content:ME}),sf=et.extend({model:b(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens","toolUse"]).or(b())),role:Gi,content:ke([za,oe(za)])}),AE=N({type:L("boolean"),title:b().optional(),description:b().optional(),default:Be().optional()}),qE=N({type:L("string"),title:b().optional(),description:b().optional(),minLength:me().optional(),maxLength:me().optional(),format:xt(["email","uri","date","date-time"]).optional(),default:b().optional()}),ZE=N({type:xt(["number","integer"]),title:b().optional(),description:b().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),LE=N({type:L("string"),title:b().optional(),description:b().optional(),enum:oe(b()),default:b().optional()}),FE=N({type:L("string"),title:b().optional(),description:b().optional(),oneOf:oe(N({const:b(),title:b()})),default:b().optional()}),UE=N({type:L("string"),title:b().optional(),description:b().optional(),enum:oe(b()),enumNames:oe(b()).optional(),default:b().optional()}),VE=ke([LE,FE]),HE=N({type:L("array"),title:b().optional(),description:b().optional(),minItems:me().optional(),maxItems:me().optional(),items:N({type:L("string"),enum:oe(b())}),default:oe(b()).optional()}),BE=N({type:L("array"),title:b().optional(),description:b().optional(),minItems:me().optional(),maxItems:me().optional(),items:N({anyOf:oe(N({const:b(),title:b()}))}),default:oe(b()).optional()}),WE=ke([HE,BE]),JE=ke([UE,VE,WE]),GE=ke([JE,AE,qE,ZE]),KE=Fi.extend({mode:L("form").optional(),message:b(),requestedSchema:N({type:L("object"),properties:xe(b(),GE),required:oe(b()).optional()})}),XE=Fi.extend({mode:L("url"),message:b(),elicitationId:b(),url:b().url()}),YE=ke([KE,XE]),QE=Qe.extend({method:L("elicitation/create"),params:YE}),eO=qt.extend({elicitationId:b()}),tO=Zt.extend({method:L("notifications/elicitation/complete"),params:eO}),Oo=et.extend({action:xt(["accept","decline","cancel"]),content:Ud(e=>e===null?void 0:e,xe(b(),ke([b(),me(),Be(),oe(b())])).optional())}),rO=N({type:L("ref/resource"),uri:b()});var nO=N({type:L("ref/prompt"),name:b()}),oO=Ct.extend({ref:ke([nO,rO]),argument:N({name:b(),value:b()}),context:N({arguments:xe(b(),b()).optional()}).optional()}),Ja=Qe.extend({method:L("completion/complete"),params:oO});function Mv(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Nv(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var iO=et.extend({completion:ht({values:oe(b()).max(100),total:Ce(me().int()),hasMore:Ce(Be())})}),sO=N({uri:b().startsWith("file://"),name:b().optional(),_meta:xe(b(),Oe()).optional()}),aO=Qe.extend({method:L("roots/list"),params:Ct.optional()}),af=et.extend({roots:oe(sO)}),cO=Zt.extend({method:L("notifications/roots/list_changed"),params:qt.optional()}),HZ=ke([ja,Kd,Ja,of,Ha,Va,La,Fa,Ua,aE,uE,Eo,Ba,Na,Da,Aa,Za]),BZ=ke([Ca,Ma,Xd,cO,Ji]),WZ=ke([Oa,Xi,sf,Oo,af,Ia,qa,zo]),JZ=ke([ja,DE,QE,aO,Na,Da,Aa,Za]),GZ=ke([Ca,Ma,RE,dE,iE,PE,wE,Ji,tO]),KZ=ke([Oa,JR,iO,bE,mE,tE,rE,oE,Wa,SE,Ia,qa,zo]),Z=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===U.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Vd(o.elicitations,r)}return new e(t,r,n)}},Vd=class extends Z{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(U.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function Kr(e){return e==="completed"||e==="failed"||e==="cancelled"}var Dv=Symbol("Let zodToJsonSchema decide on which parser to use");var Iv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Av=e=>typeof e=="string"?{...Iv,name:e}:{...Iv,...e};var qv=e=>{let t=Av(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function cf(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function ie(e,t,r,n,o){e[t]=r,cf(e,t,n,o)}var Ga=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function je(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Ga(t,e.currentPath):t.join("/")}}function Zv(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==E.ZodAny&&(r.items=W(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&ie(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&ie(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(ie(r,"minItems",e.exactLength.value,e.exactLength.message,t),ie(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function Lv(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ie(r,"minimum",n.value,n.message,t):ie(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ie(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ie(r,"maximum",n.value,n.message,t):ie(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ie(r,"maximum",n.value,n.message,t));break;case"multipleOf":ie(r,"multipleOf",n.value,n.message,t);break}return r}function Fv(){return{type:"boolean"}}function Ka(e,t){return W(e.type._def,t)}var Uv=(e,t)=>W(e.innerType._def,t);function uf(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>uf(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return uO(e,t)}}var uO=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":ie(r,"minimum",n.value,n.message,t);break;case"max":ie(r,"maximum",n.value,n.message,t);break}return r};function Vv(e,t){return{...W(e.innerType._def,t),default:e.defaultValue()}}function Hv(e,t){return t.effectStrategy==="input"?W(e.schema._def,t):je(t)}function Bv(e){return{type:"string",enum:Array.from(e.values)}}var lO=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Wv(e,t){let r=[W(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),W(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(lO(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}function Jv(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var lf,Gt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(lf===void 0&&(lf=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),lf),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Xa(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Kt(r,"email",n.message,t);break;case"format:idn-email":Kt(r,"idn-email",n.message,t);break;case"pattern:zod":gt(r,Gt.email,n.message,t);break}break;case"url":Kt(r,"uri",n.message,t);break;case"uuid":Kt(r,"uuid",n.message,t);break;case"regex":gt(r,n.regex,n.message,t);break;case"cuid":gt(r,Gt.cuid,n.message,t);break;case"cuid2":gt(r,Gt.cuid2,n.message,t);break;case"startsWith":gt(r,RegExp(`^${df(n.value,t)}`),n.message,t);break;case"endsWith":gt(r,RegExp(`${df(n.value,t)}$`),n.message,t);break;case"datetime":Kt(r,"date-time",n.message,t);break;case"date":Kt(r,"date",n.message,t);break;case"time":Kt(r,"time",n.message,t);break;case"duration":Kt(r,"duration",n.message,t);break;case"length":ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{gt(r,RegExp(df(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Kt(r,"ipv4",n.message,t),n.version!=="v4"&&Kt(r,"ipv6",n.message,t);break}case"base64url":gt(r,Gt.base64url,n.message,t);break;case"jwt":gt(r,Gt.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&gt(r,Gt.ipv4Cidr,n.message,t),n.version!=="v4"&&gt(r,Gt.ipv6Cidr,n.message,t);break}case"emoji":gt(r,Gt.emoji(),n.message,t);break;case"ulid":{gt(r,Gt.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Kt(r,"binary",n.message,t);break}case"contentEncoding:base64":{ie(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{gt(r,Gt.base64,n.message,t);break}}break}case"nanoid":gt(r,Gt.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function df(e,t){return t.patternStrategy==="escape"?fO(e):e}var dO=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function fO(e){let t="";for(let r=0;r<e.length;r++)dO.has(e[r])||(t+="\\"),t+=e[r];return t}function Kt(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):ie(e,"format",t,r,n)}function gt(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Gv(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ie(e,"pattern",Gv(t,n),r,n)}function Gv(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
47
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let d=l[1];if(t===l[0]){s(l);continue}if(n.external){let m=n.external.registry.get(l[0])?.id;if(t!==l[0]&&m){s(l);continue}}if(this.metadataRegistry.get(l[0])?.id){s(l);continue}if(d.cycle){s(l);continue}if(d.count>1&&n.reused==="ref"){s(l);continue}}let a=(l,d)=>{let h=this.seen.get(l),m=h.def??h.schema,p={...m};if(h.ref===null)return;let y=h.ref;if(h.ref=null,y){a(y,d);let v=this.seen.get(y).schema;v.$ref&&d.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(v)):(Object.assign(m,v),Object.assign(m,p))}h.isParent||this.override({zodSchema:l,jsonSchema:m,path:h.path??[]})};for(let l of[...this.seen.entries()].reverse())a(l[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let l=n.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(l)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let l of this.seen.entries()){let d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}};function Md(e,t){if(e instanceof Ai){let n=new $a(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri,defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new $a(t);return r.process(e),r.emit(e,t)}function Ue(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ue(o.element,r);case"object":{for(let i in o.shape)if(Ue(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(Ue(i,r))return!0;return!1}case"intersection":return Ue(o.left,r)||Ue(o.right,r);case"tuple":{for(let i of o.items)if(Ue(i,r))return!0;return!!(o.rest&&Ue(o.rest,r))}case"record":return Ue(o.keyType,r)||Ue(o.valueType,r);case"map":return Ue(o.keyType,r)||Ue(o.valueType,r);case"set":return Ue(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ue(o.innerType,r);case"lazy":return Ue(o.getter(),r);case"default":return Ue(o.innerType,r);case"prefault":return Ue(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Ue(o.in,r)||Ue(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var FR=x("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ge.init(e,t),e.def=t,e.parse=(r,n)=>el(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ln(e,r,n),e.parseAsync=async(r,n)=>rl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Fn(e,r,n),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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e))});var UR=x("ZodMiniObject",(e,t)=>{ha.init(e,t),FR.init(e,t),ne.defineLazy(e,"shape",()=>t.shape)});function Dd(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new UR(r)}function At(e){return!!e._zod}function Hn(e){let t=Object.values(e);if(t.length===0)return Dd({});let r=t.every(At),n=t.every(o=>!At(o));if(r)return Dd(e);if(n)return Zu(e);throw new Error("Mixed Zod versions detected in object shape.")}function Wr(e,t){return At(e)?Ln(e,t):e.safeParse(t)}async function Sa(e,t){return At(e)?await Fn(e,t):await e.safeParseAsync(t)}function Jr(e){if(!e)return;let t;if(At(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function To(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let n=Object.values(e);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return Hn(e)}}if(At(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function ka(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function X_(e){return e.description}function Y_(e){if(At(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function Pa(e){if(At(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 Li={};Qs(Li,{ZodISODate:()=>ev,ZodISODateTime:()=>Q_,ZodISODuration:()=>rv,ZodISOTime:()=>tv,date:()=>qd,datetime:()=>Ad,duration:()=>Ld,time:()=>Zd});var Q_=x("ZodISODateTime",(e,t)=>{A_.init(e,t),Ee.init(e,t)});function Ad(e){return H_(Q_,e)}var ev=x("ZodISODate",(e,t)=>{q_.init(e,t),Ee.init(e,t)});function qd(e){return B_(ev,e)}var tv=x("ZodISOTime",(e,t)=>{Z_.init(e,t),Ee.init(e,t)});function Zd(e){return W_(tv,e)}var rv=x("ZodISODuration",(e,t)=>{L_.init(e,t),Ee.init(e,t)});function Ld(e){return J_(rv,e)}var nv=(e,t)=>{la.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Yu(e,r)},flatten:{value:r=>Xu(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},DZ=x("ZodError",nv),Fi=x("ZodError",nv,{Parent:Error});var ov=Qu(Fi),iv=tl(Fi),sv=nl(Fi),av=ol(Fi);var Me=x("ZodType",(e,t)=>(ge.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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>ov(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>sv(e,r,n),e.parseAsync=async(r,n)=>iv(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>av(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(Zz(r,n)),e.superRefine=r=>e.check(Lz(r)),e.overwrite=r=>e.check(Un(r)),e.optional=()=>Ce(e),e.nullable=()=>lv(e),e.nullish=()=>Ce(lv(e)),e.nonoptional=r=>jz(e,r),e.array=()=>oe(e),e.or=r=>ke([e,r]),e.and=r=>Ra(e,r),e.transform=r=>Ud(e,gv(r)),e.default=r=>Ez(e,r),e.prefault=r=>Cz(e,r),e.catch=r=>Iz(e,r),e.pipe=r=>Ud(e,r),e.readonly=()=>Az(e),e.describe=r=>{let n=e.clone();return Br.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Br.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Br.get(e);let n=e.clone();return Br.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),dv=x("_ZodString",(e,t)=>{Di.init(e,t),Me.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(Sd(...n)),e.includes=(...n)=>e.check(Td(...n)),e.startsWith=(...n)=>e.check(Rd(...n)),e.endsWith=(...n)=>e.check(zd(...n)),e.min=(...n)=>e.check(Po(...n)),e.max=(...n)=>e.check(wa(...n)),e.length=(...n)=>e.check(xa(...n)),e.nonempty=(...n)=>e.check(Po(1,...n)),e.lowercase=n=>e.check(kd(n)),e.uppercase=n=>e.check(Pd(n)),e.trim=()=>e.check(Od()),e.normalize=(...n)=>e.check(Ed(...n)),e.toLowerCase=()=>e.check(Cd()),e.toUpperCase=()=>e.check(jd())}),YR=x("ZodString",(e,t)=>{Di.init(e,t),dv.init(e,t),e.email=r=>e.check(Xl(QR,r)),e.url=r=>e.check(rd(ez,r)),e.jwt=r=>e.check(yd(hz,r)),e.emoji=r=>e.check(nd(tz,r)),e.guid=r=>e.check(ya(cv,r)),e.uuid=r=>e.check(Yl(Ta,r)),e.uuidv4=r=>e.check(Ql(Ta,r)),e.uuidv6=r=>e.check(ed(Ta,r)),e.uuidv7=r=>e.check(td(Ta,r)),e.nanoid=r=>e.check(od(rz,r)),e.guid=r=>e.check(ya(cv,r)),e.cuid=r=>e.check(id(nz,r)),e.cuid2=r=>e.check(sd(oz,r)),e.ulid=r=>e.check(ad(iz,r)),e.base64=r=>e.check(md(fz,r)),e.base64url=r=>e.check(hd(pz,r)),e.xid=r=>e.check(cd(sz,r)),e.ksuid=r=>e.check(ud(az,r)),e.ipv4=r=>e.check(ld(cz,r)),e.ipv6=r=>e.check(dd(uz,r)),e.cidrv4=r=>e.check(fd(lz,r)),e.cidrv6=r=>e.check(pd(dz,r)),e.e164=r=>e.check(gd(mz,r)),e.datetime=r=>e.check(Ad(r)),e.date=r=>e.check(qd(r)),e.time=r=>e.check(Zd(r)),e.duration=r=>e.check(Ld(r))});function b(e){return Kl(YR,e)}var Ee=x("ZodStringFormat",(e,t)=>{we.init(e,t),dv.init(e,t)}),QR=x("ZodEmail",(e,t)=>{fl.init(e,t),Ee.init(e,t)});var cv=x("ZodGUID",(e,t)=>{ll.init(e,t),Ee.init(e,t)});var Ta=x("ZodUUID",(e,t)=>{dl.init(e,t),Ee.init(e,t)});var ez=x("ZodURL",(e,t)=>{pl.init(e,t),Ee.init(e,t)});var tz=x("ZodEmoji",(e,t)=>{ml.init(e,t),Ee.init(e,t)});var rz=x("ZodNanoID",(e,t)=>{hl.init(e,t),Ee.init(e,t)});var nz=x("ZodCUID",(e,t)=>{gl.init(e,t),Ee.init(e,t)});var oz=x("ZodCUID2",(e,t)=>{yl.init(e,t),Ee.init(e,t)});var iz=x("ZodULID",(e,t)=>{_l.init(e,t),Ee.init(e,t)});var sz=x("ZodXID",(e,t)=>{vl.init(e,t),Ee.init(e,t)});var az=x("ZodKSUID",(e,t)=>{bl.init(e,t),Ee.init(e,t)});var cz=x("ZodIPv4",(e,t)=>{wl.init(e,t),Ee.init(e,t)});var uz=x("ZodIPv6",(e,t)=>{xl.init(e,t),Ee.init(e,t)});var lz=x("ZodCIDRv4",(e,t)=>{$l.init(e,t),Ee.init(e,t)});var dz=x("ZodCIDRv6",(e,t)=>{Sl.init(e,t),Ee.init(e,t)});var fz=x("ZodBase64",(e,t)=>{kl.init(e,t),Ee.init(e,t)});var pz=x("ZodBase64URL",(e,t)=>{Pl.init(e,t),Ee.init(e,t)});var mz=x("ZodE164",(e,t)=>{Tl.init(e,t),Ee.init(e,t)});var hz=x("ZodJWT",(e,t)=>{Rl.init(e,t),Ee.init(e,t)});var fv=x("ZodNumber",(e,t)=>{ma.init(e,t),Me.init(e,t),e.gt=(n,o)=>e.check(va(n,o)),e.gte=(n,o)=>e.check(Zi(n,o)),e.min=(n,o)=>e.check(Zi(n,o)),e.lt=(n,o)=>e.check(_a(n,o)),e.lte=(n,o)=>e.check(qi(n,o)),e.max=(n,o)=>e.check(qi(n,o)),e.int=n=>e.check(uv(n)),e.safe=n=>e.check(uv(n)),e.positive=n=>e.check(va(0,n)),e.nonnegative=n=>e.check(Zi(0,n)),e.negative=n=>e.check(_a(0,n)),e.nonpositive=n=>e.check(qi(0,n)),e.multipleOf=(n,o)=>e.check(ba(n,o)),e.step=(n,o)=>e.check(ba(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 me(e){return _d(fv,e)}var gz=x("ZodNumberFormat",(e,t)=>{zl.init(e,t),fv.init(e,t)});function uv(e){return vd(gz,e)}var yz=x("ZodBoolean",(e,t)=>{El.init(e,t),Me.init(e,t)});function Be(e){return bd(yz,e)}var _z=x("ZodNull",(e,t)=>{Ol.init(e,t),Me.init(e,t)});function pv(e){return wd(_z,e)}var vz=x("ZodUnknown",(e,t)=>{Cl.init(e,t),Me.init(e,t)});function Oe(){return xd(vz)}var bz=x("ZodNever",(e,t)=>{jl.init(e,t),Me.init(e,t)});function wz(e){return $d(bz,e)}var xz=x("ZodArray",(e,t)=>{Nl.init(e,t),Me.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Po(r,n)),e.nonempty=r=>e.check(Po(1,r)),e.max=(r,n)=>e.check(wa(r,n)),e.length=(r,n)=>e.check(xa(r,n)),e.unwrap=()=>e.element});function oe(e,t){return G_(xz,e,t)}var mv=x("ZodObject",(e,t)=>{ha.init(e,t),Me.init(e,t),ne.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>xt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oe()}),e.strict=()=>e.clone({...e._zod.def,catchall:wz()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ne.extend(e,r),e.merge=r=>ne.merge(e,r),e.pick=r=>ne.pick(e,r),e.omit=r=>ne.omit(e,r),e.partial=(...r)=>ne.partial(yv,e,r[0]),e.required=(...r)=>ne.required(_v,e,r[0])});function I(e,t){let r={type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},...ne.normalizeParams(t)};return new mv(r)}function ht(e,t){return new mv({type:"object",get shape(){return ne.assignProp(this,"shape",{...e}),this.shape},catchall:Oe(),...ne.normalizeParams(t)})}var hv=x("ZodUnion",(e,t)=>{ga.init(e,t),Me.init(e,t),e.options=t.options});function ke(e,t){return new hv({type:"union",options:e,...ne.normalizeParams(t)})}var $z=x("ZodDiscriminatedUnion",(e,t)=>{hv.init(e,t),Il.init(e,t)});function Vd(e,t,r){return new $z({type:"union",options:t,discriminator:e,...ne.normalizeParams(r)})}var Sz=x("ZodIntersection",(e,t)=>{Ml.init(e,t),Me.init(e,t)});function Ra(e,t){return new Sz({type:"intersection",left:e,right:t})}var kz=x("ZodRecord",(e,t)=>{Dl.init(e,t),Me.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function xe(e,t,r){return new kz({type:"record",keyType:e,valueType:t,...ne.normalizeParams(r)})}var Fd=x("ZodEnum",(e,t)=>{Al.init(e,t),Me.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 Fd({...t,checks:[],...ne.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 Fd({...t,checks:[],...ne.normalizeParams(o),entries:i})}});function xt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Fd({type:"enum",entries:r,...ne.normalizeParams(t)})}var Pz=x("ZodLiteral",(e,t)=>{ql.init(e,t),Me.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 L(e,t){return new Pz({type:"literal",values:Array.isArray(e)?e:[e],...ne.normalizeParams(t)})}var Tz=x("ZodTransform",(e,t)=>{Zl.init(e,t),Me.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(ne.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(ne.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 gv(e){return new Tz({type:"transform",transform:e})}var yv=x("ZodOptional",(e,t)=>{Ll.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ce(e){return new yv({type:"optional",innerType:e})}var Rz=x("ZodNullable",(e,t)=>{Fl.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lv(e){return new Rz({type:"nullable",innerType:e})}var zz=x("ZodDefault",(e,t)=>{Ul.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ez(e,t){return new zz({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var Oz=x("ZodPrefault",(e,t)=>{Vl.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cz(e,t){return new Oz({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var _v=x("ZodNonOptional",(e,t)=>{Hl.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jz(e,t){return new _v({type:"nonoptional",innerType:e,...ne.normalizeParams(t)})}var Nz=x("ZodCatch",(e,t)=>{Bl.init(e,t),Me.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iz(e,t){return new Nz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Mz=x("ZodPipe",(e,t)=>{Wl.init(e,t),Me.init(e,t),e.in=t.in,e.out=t.out});function Ud(e,t){return new Mz({type:"pipe",in:e,out:t})}var Dz=x("ZodReadonly",(e,t)=>{Jl.init(e,t),Me.init(e,t)});function Az(e){return new Dz({type:"readonly",innerType:e})}var vv=x("ZodCustom",(e,t)=>{Gl.init(e,t),Me.init(e,t)});function qz(e){let t=new Ye({check:"custom"});return t._zod.check=e,t}function bv(e,t){return Nd(vv,e??(()=>!0),t)}function Zz(e,t={}){return Id(vv,e,t)}function Lz(e){let t=qz(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ne.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(ne.issue(o))}},e(r.value,r)));return t}function Hd(e,t){return Ud(gv(e),t)}Et(U_());var Wd="2025-11-25";var wv=[Wd,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Gr="io.modelcontextprotocol/related-task",Ea="2.0",Ve=bv(e=>e!==null&&(typeof e=="object"||typeof e=="function")),xv=ke([b(),me().int()]),$v=b(),XZ=ht({ttl:me().optional(),pollInterval:me().optional()}),Fz=I({ttl:me().optional()}),Uz=I({taskId:b()}),Jd=ht({progressToken:xv.optional(),[Gr]:Uz.optional()}),Ct=I({_meta:Jd.optional()}),Ui=Ct.extend({task:Fz.optional()}),Sv=e=>Ui.safeParse(e).success,Qe=I({method:b(),params:Ct.loose().optional()}),qt=I({_meta:Jd.optional()}),Zt=I({method:b(),params:qt.loose().optional()}),et=ht({_meta:Jd.optional()}),Oa=ke([b(),me().int()]),kv=I({jsonrpc:L(Ea),id:Oa,...Qe.shape}).strict(),Gd=e=>kv.safeParse(e).success,Pv=I({jsonrpc:L(Ea),...Zt.shape}).strict(),Tv=e=>Pv.safeParse(e).success,Kd=I({jsonrpc:L(Ea),id:Oa,result:et}).strict(),Vi=e=>Kd.safeParse(e).success;var U;(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"})(U||(U={}));var Xd=I({jsonrpc:L(Ea),id:Oa.optional(),error:I({code:me().int(),message:b(),data:Oe().optional()})}).strict();var Rv=e=>Xd.safeParse(e).success;var zv=ke([kv,Pv,Kd,Xd]),YZ=ke([Kd,Xd]),Ca=et.strict(),Vz=qt.extend({requestId:Oa.optional(),reason:b().optional()}),ja=Zt.extend({method:L("notifications/cancelled"),params:Vz}),Hz=I({src:b(),mimeType:b().optional(),sizes:oe(b()).optional(),theme:xt(["light","dark"]).optional()}),Hi=I({icons:oe(Hz).optional()}),Ro=I({name:b(),title:b().optional()}),Ev=Ro.extend({...Ro.shape,...Hi.shape,version:b(),websiteUrl:b().optional(),description:b().optional()}),Bz=Ra(I({applyDefaults:Be().optional()}),xe(b(),Oe())),Wz=Hd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ra(I({form:Bz.optional(),url:Ve.optional()}),xe(b(),Oe()).optional())),Jz=ht({list:Ve.optional(),cancel:Ve.optional(),requests:ht({sampling:ht({createMessage:Ve.optional()}).optional(),elicitation:ht({create:Ve.optional()}).optional()}).optional()}),Gz=ht({list:Ve.optional(),cancel:Ve.optional(),requests:ht({tools:ht({call:Ve.optional()}).optional()}).optional()}),Kz=I({experimental:xe(b(),Ve).optional(),sampling:I({context:Ve.optional(),tools:Ve.optional()}).optional(),elicitation:Wz.optional(),roots:I({listChanged:Be().optional()}).optional(),tasks:Jz.optional(),extensions:xe(b(),Ve).optional()}),Xz=Ct.extend({protocolVersion:b(),capabilities:Kz,clientInfo:Ev}),Yd=Qe.extend({method:L("initialize"),params:Xz});var Yz=I({experimental:xe(b(),Ve).optional(),logging:Ve.optional(),completions:Ve.optional(),prompts:I({listChanged:Be().optional()}).optional(),resources:I({subscribe:Be().optional(),listChanged:Be().optional()}).optional(),tools:I({listChanged:Be().optional()}).optional(),tasks:Gz.optional(),extensions:xe(b(),Ve).optional()}),Qz=et.extend({protocolVersion:b(),capabilities:Yz,serverInfo:Ev,instructions:b().optional()}),Qd=Zt.extend({method:L("notifications/initialized"),params:qt.optional()});var Na=Qe.extend({method:L("ping"),params:Ct.optional()}),eE=I({progress:me(),total:Ce(me()),message:Ce(b())}),tE=I({...qt.shape,...eE.shape,progressToken:xv}),Ia=Zt.extend({method:L("notifications/progress"),params:tE}),rE=Ct.extend({cursor:$v.optional()}),Bi=Qe.extend({params:rE.optional()}),Wi=et.extend({nextCursor:$v.optional()}),nE=xt(["working","input_required","completed","failed","cancelled"]),Ji=I({taskId:b(),status:nE,ttl:ke([me(),pv()]),createdAt:b(),lastUpdatedAt:b(),pollInterval:Ce(me()),statusMessage:Ce(b())}),zo=et.extend({task:Ji}),oE=qt.merge(Ji),Gi=Zt.extend({method:L("notifications/tasks/status"),params:oE}),Ma=Qe.extend({method:L("tasks/get"),params:Ct.extend({taskId:b()})}),Da=et.merge(Ji),Aa=Qe.extend({method:L("tasks/result"),params:Ct.extend({taskId:b()})}),QZ=et.loose(),qa=Bi.extend({method:L("tasks/list")}),Za=Wi.extend({tasks:oe(Ji)}),La=Qe.extend({method:L("tasks/cancel"),params:Ct.extend({taskId:b()})}),Ov=et.merge(Ji),Cv=I({uri:b(),mimeType:Ce(b()),_meta:xe(b(),Oe()).optional()}),jv=Cv.extend({text:b()}),ef=b().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Nv=Cv.extend({blob:ef}),Ki=xt(["user","assistant"]),Eo=I({audience:oe(Ki).optional(),priority:me().min(0).max(1).optional(),lastModified:Li.datetime({offset:!0}).optional()}),Iv=I({...Ro.shape,...Hi.shape,uri:b(),description:Ce(b()),mimeType:Ce(b()),size:Ce(me()),annotations:Eo.optional(),_meta:Ce(ht({}))}),iE=I({...Ro.shape,...Hi.shape,uriTemplate:b(),description:Ce(b()),mimeType:Ce(b()),annotations:Eo.optional(),_meta:Ce(ht({}))}),Fa=Bi.extend({method:L("resources/list")}),sE=Wi.extend({resources:oe(Iv)}),Ua=Bi.extend({method:L("resources/templates/list")}),aE=Wi.extend({resourceTemplates:oe(iE)}),tf=Ct.extend({uri:b()}),cE=tf,Va=Qe.extend({method:L("resources/read"),params:cE}),uE=et.extend({contents:oe(ke([jv,Nv]))}),lE=Zt.extend({method:L("notifications/resources/list_changed"),params:qt.optional()}),dE=tf,fE=Qe.extend({method:L("resources/subscribe"),params:dE}),pE=tf,mE=Qe.extend({method:L("resources/unsubscribe"),params:pE}),hE=qt.extend({uri:b()}),gE=Zt.extend({method:L("notifications/resources/updated"),params:hE}),yE=I({name:b(),description:Ce(b()),required:Ce(Be())}),_E=I({...Ro.shape,...Hi.shape,description:Ce(b()),arguments:Ce(oe(yE)),_meta:Ce(ht({}))}),Ha=Bi.extend({method:L("prompts/list")}),vE=Wi.extend({prompts:oe(_E)}),bE=Ct.extend({name:b(),arguments:xe(b(),b()).optional()}),Ba=Qe.extend({method:L("prompts/get"),params:bE}),rf=I({type:L("text"),text:b(),annotations:Eo.optional(),_meta:xe(b(),Oe()).optional()}),nf=I({type:L("image"),data:ef,mimeType:b(),annotations:Eo.optional(),_meta:xe(b(),Oe()).optional()}),of=I({type:L("audio"),data:ef,mimeType:b(),annotations:Eo.optional(),_meta:xe(b(),Oe()).optional()}),wE=I({type:L("tool_use"),name:b(),id:b(),input:xe(b(),Oe()),_meta:xe(b(),Oe()).optional()}),xE=I({type:L("resource"),resource:ke([jv,Nv]),annotations:Eo.optional(),_meta:xe(b(),Oe()).optional()}),$E=Iv.extend({type:L("resource_link")}),sf=ke([rf,nf,of,$E,xE]),SE=I({role:Ki,content:sf}),kE=et.extend({description:b().optional(),messages:oe(SE)}),PE=Zt.extend({method:L("notifications/prompts/list_changed"),params:qt.optional()}),TE=I({title:b().optional(),readOnlyHint:Be().optional(),destructiveHint:Be().optional(),idempotentHint:Be().optional(),openWorldHint:Be().optional()}),RE=I({taskSupport:xt(["required","optional","forbidden"]).optional()}),Mv=I({...Ro.shape,...Hi.shape,description:b().optional(),inputSchema:I({type:L("object"),properties:xe(b(),Ve).optional(),required:oe(b()).optional()}).catchall(Oe()),outputSchema:I({type:L("object"),properties:xe(b(),Ve).optional(),required:oe(b()).optional()}).catchall(Oe()).optional(),annotations:TE.optional(),execution:RE.optional(),_meta:xe(b(),Oe()).optional()}),Wa=Bi.extend({method:L("tools/list")}),zE=Wi.extend({tools:oe(Mv)}),Ja=et.extend({content:oe(sf).default([]),structuredContent:xe(b(),Oe()).optional(),isError:Be().optional()}),eL=Ja.or(et.extend({toolResult:Oe()})),EE=Ui.extend({name:b(),arguments:xe(b(),Oe()).optional()}),Oo=Qe.extend({method:L("tools/call"),params:EE}),OE=Zt.extend({method:L("notifications/tools/list_changed"),params:qt.optional()}),tL=I({autoRefresh:Be().default(!0),debounceMs:me().int().nonnegative().default(300)}),Xi=xt(["debug","info","notice","warning","error","critical","alert","emergency"]),CE=Ct.extend({level:Xi}),af=Qe.extend({method:L("logging/setLevel"),params:CE}),jE=qt.extend({level:Xi,logger:b().optional(),data:Oe()}),NE=Zt.extend({method:L("notifications/message"),params:jE}),IE=I({name:b().optional()}),ME=I({hints:oe(IE).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),DE=I({mode:xt(["auto","required","none"]).optional()}),AE=I({type:L("tool_result"),toolUseId:b().describe("The unique identifier for the corresponding tool call."),content:oe(sf).default([]),structuredContent:I({}).loose().optional(),isError:Be().optional(),_meta:xe(b(),Oe()).optional()}),qE=Vd("type",[rf,nf,of]),za=Vd("type",[rf,nf,of,wE,AE]),ZE=I({role:Ki,content:ke([za,oe(za)]),_meta:xe(b(),Oe()).optional()}),LE=Ui.extend({messages:oe(ZE),modelPreferences:ME.optional(),systemPrompt:b().optional(),includeContext:xt(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:oe(b()).optional(),metadata:Ve.optional(),tools:oe(Mv).optional(),toolChoice:DE.optional()}),FE=Qe.extend({method:L("sampling/createMessage"),params:LE}),Yi=et.extend({model:b(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens"]).or(b())),role:Ki,content:qE}),cf=et.extend({model:b(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens","toolUse"]).or(b())),role:Ki,content:ke([za,oe(za)])}),UE=I({type:L("boolean"),title:b().optional(),description:b().optional(),default:Be().optional()}),VE=I({type:L("string"),title:b().optional(),description:b().optional(),minLength:me().optional(),maxLength:me().optional(),format:xt(["email","uri","date","date-time"]).optional(),default:b().optional()}),HE=I({type:xt(["number","integer"]),title:b().optional(),description:b().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),BE=I({type:L("string"),title:b().optional(),description:b().optional(),enum:oe(b()),default:b().optional()}),WE=I({type:L("string"),title:b().optional(),description:b().optional(),oneOf:oe(I({const:b(),title:b()})),default:b().optional()}),JE=I({type:L("string"),title:b().optional(),description:b().optional(),enum:oe(b()),enumNames:oe(b()).optional(),default:b().optional()}),GE=ke([BE,WE]),KE=I({type:L("array"),title:b().optional(),description:b().optional(),minItems:me().optional(),maxItems:me().optional(),items:I({type:L("string"),enum:oe(b())}),default:oe(b()).optional()}),XE=I({type:L("array"),title:b().optional(),description:b().optional(),minItems:me().optional(),maxItems:me().optional(),items:I({anyOf:oe(I({const:b(),title:b()}))}),default:oe(b()).optional()}),YE=ke([KE,XE]),QE=ke([JE,GE,YE]),eO=ke([QE,UE,VE,HE]),tO=Ui.extend({mode:L("form").optional(),message:b(),requestedSchema:I({type:L("object"),properties:xe(b(),eO),required:oe(b()).optional()})}),rO=Ui.extend({mode:L("url"),message:b(),elicitationId:b(),url:b().url()}),nO=ke([tO,rO]),oO=Qe.extend({method:L("elicitation/create"),params:nO}),iO=qt.extend({elicitationId:b()}),sO=Zt.extend({method:L("notifications/elicitation/complete"),params:iO}),Co=et.extend({action:xt(["accept","decline","cancel"]),content:Hd(e=>e===null?void 0:e,xe(b(),ke([b(),me(),Be(),oe(b())])).optional())}),aO=I({type:L("ref/resource"),uri:b()});var cO=I({type:L("ref/prompt"),name:b()}),uO=Ct.extend({ref:ke([cO,aO]),argument:I({name:b(),value:b()}),context:I({arguments:xe(b(),b()).optional()}).optional()}),Ga=Qe.extend({method:L("completion/complete"),params:uO});function Dv(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Av(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var lO=et.extend({completion:ht({values:oe(b()).max(100),total:Ce(me().int()),hasMore:Ce(Be())})}),dO=I({uri:b().startsWith("file://"),name:b().optional(),_meta:xe(b(),Oe()).optional()}),fO=Qe.extend({method:L("roots/list"),params:Ct.optional()}),uf=et.extend({roots:oe(dO)}),pO=Zt.extend({method:L("notifications/roots/list_changed"),params:qt.optional()}),rL=ke([Na,Yd,Ga,af,Ba,Ha,Fa,Ua,Va,fE,mE,Oo,Wa,Ma,Aa,qa,La]),nL=ke([ja,Ia,Qd,pO,Gi]),oL=ke([Ca,Yi,cf,Co,uf,Da,Za,zo]),iL=ke([Na,FE,oO,fO,Ma,Aa,qa,La]),sL=ke([ja,Ia,NE,gE,lE,OE,PE,Gi,sO]),aL=ke([Ca,Qz,lO,kE,vE,sE,aE,uE,Ja,zE,Da,Za,zo]),Z=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===U.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Bd(o.elicitations,r)}return new e(t,r,n)}},Bd=class extends Z{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(U.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function Kr(e){return e==="completed"||e==="failed"||e==="cancelled"}var Zv=Symbol("Let zodToJsonSchema decide on which parser to use");var qv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Lv=e=>typeof e=="string"?{...qv,name:e}:{...qv,...e};var Fv=e=>{let t=Lv(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function lf(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function ie(e,t,r,n,o){e[t]=r,lf(e,t,n,o)}var Ka=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function je(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Ka(t,e.currentPath):t.join("/")}}function Uv(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==E.ZodAny&&(r.items=W(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&ie(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&ie(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(ie(r,"minItems",e.exactLength.value,e.exactLength.message,t),ie(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function Vv(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ie(r,"minimum",n.value,n.message,t):ie(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ie(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ie(r,"maximum",n.value,n.message,t):ie(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ie(r,"maximum",n.value,n.message,t));break;case"multipleOf":ie(r,"multipleOf",n.value,n.message,t);break}return r}function Hv(){return{type:"boolean"}}function Xa(e,t){return W(e.type._def,t)}var Bv=(e,t)=>W(e.innerType._def,t);function df(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>df(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return mO(e,t)}}var mO=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":ie(r,"minimum",n.value,n.message,t);break;case"max":ie(r,"maximum",n.value,n.message,t);break}return r};function Wv(e,t){return{...W(e.innerType._def,t),default:e.defaultValue()}}function Jv(e,t){return t.effectStrategy==="input"?W(e.schema._def,t):je(t)}function Gv(e){return{type:"string",enum:Array.from(e.values)}}var hO=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Kv(e,t){let r=[W(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),W(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(hO(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:a,...c}=i;s=c}else n=void 0;o.push(s)}}),o.length?{allOf:o,...n}:void 0}function Xv(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var ff,Gt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ff===void 0&&(ff=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ff),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ya(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Kt(r,"email",n.message,t);break;case"format:idn-email":Kt(r,"idn-email",n.message,t);break;case"pattern:zod":gt(r,Gt.email,n.message,t);break}break;case"url":Kt(r,"uri",n.message,t);break;case"uuid":Kt(r,"uuid",n.message,t);break;case"regex":gt(r,n.regex,n.message,t);break;case"cuid":gt(r,Gt.cuid,n.message,t);break;case"cuid2":gt(r,Gt.cuid2,n.message,t);break;case"startsWith":gt(r,RegExp(`^${pf(n.value,t)}`),n.message,t);break;case"endsWith":gt(r,RegExp(`${pf(n.value,t)}$`),n.message,t);break;case"datetime":Kt(r,"date-time",n.message,t);break;case"date":Kt(r,"date",n.message,t);break;case"time":Kt(r,"time",n.message,t);break;case"duration":Kt(r,"duration",n.message,t);break;case"length":ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{gt(r,RegExp(pf(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Kt(r,"ipv4",n.message,t),n.version!=="v4"&&Kt(r,"ipv6",n.message,t);break}case"base64url":gt(r,Gt.base64url,n.message,t);break;case"jwt":gt(r,Gt.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&gt(r,Gt.ipv4Cidr,n.message,t),n.version!=="v4"&&gt(r,Gt.ipv6Cidr,n.message,t);break}case"emoji":gt(r,Gt.emoji(),n.message,t);break;case"ulid":{gt(r,Gt.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Kt(r,"binary",n.message,t);break}case"contentEncoding:base64":{ie(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{gt(r,Gt.base64,n.message,t);break}}break}case"nanoid":gt(r,Gt.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function pf(e,t){return t.patternStrategy==="escape"?yO(e):e}var gO=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function yO(e){let t="";for(let r=0;r<e.length;r++)gO.has(e[r])||(t+="\\"),t+=e[r];return t}function Kt(e,t,r,n){e.format||e.anyOf?.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):ie(e,"format",t,r,n)}function gt(e,t,r,n){e.pattern||e.allOf?.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Yv(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ie(e,"pattern",Yv(t,n),r,n)}function Yv(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,a=!1;for(let c=0;c<n.length;c++){if(i){o+=n[c],i=!1;continue}if(r.i){if(s){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
48
48
  ]))`;continue}else if(n[c]==="$"){o+=`($|(?=[\r
49
49
  ]))`;continue}}if(r.s&&n[c]==="."){o+=s?`${n[c]}\r
50
50
  `:`[${n[c]}\r
51
- ]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function Ya(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===E.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??je(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===E.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Xa(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===E.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===E.ZodBranded&&e.keyType._def.type._def.typeName===E.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=Ka(e.keyType._def,t);return{...r,propertyNames:o}}}return r}function Kv(e,t){if(t.mapStrategy==="record")return Ya(e,t);let r=W(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||je(t),n=W(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||je(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Xv(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}function Yv(e){return e.target==="openAi"?void 0:{not:je({...e,currentPath:[...e.currentPath,"not"]})}}function Qv(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Yi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function tb(e,t){if(t.target==="openApi3")return eb(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Yi&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=Yi[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return eb(e,t)}var eb=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>W(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function rb(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Yi[e.innerType._def.typeName],nullable:!0}:{type:[Yi[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=W(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=W(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function nb(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",cf(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?ie(r,"minimum",n.value,n.message,t):ie(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ie(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ie(r,"maximum",n.value,n.message,t):ie(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ie(r,"maximum",n.value,n.message,t));break;case"multipleOf":ie(r,"multipleOf",n.value,n.message,t);break}return r}function ob(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=mO(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=W(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||o.push(a))}o.length&&(n.required=o);let s=pO(e,t);return s!==void 0&&(n.additionalProperties=s),n}function pO(e,t){if(e.catchall._def.typeName!=="ZodNever")return W(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function mO(e){try{return e.isOptional()}catch{return!0}}var ib=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return W(e.innerType._def,t);let r=W(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:je(t)},r]}:je(t)};var sb=(e,t)=>{if(t.pipeStrategy==="input")return W(e.in._def,t);if(t.pipeStrategy==="output")return W(e.out._def,t);let r=W(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=W(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}};function ab(e,t){return W(e.type._def,t)}function cb(e,t){let n={type:"array",uniqueItems:!0,items:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&ie(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&ie(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function ub(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>W(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:W(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>W(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function lb(e){return{not:je(e)}}function db(e){return je(e)}var fb=(e,t)=>W(e.innerType._def,t);var pb=(e,t,r)=>{switch(t){case E.ZodString:return Xa(e,r);case E.ZodNumber:return nb(e,r);case E.ZodObject:return ob(e,r);case E.ZodBigInt:return Lv(e,r);case E.ZodBoolean:return Fv();case E.ZodDate:return uf(e,r);case E.ZodUndefined:return lb(r);case E.ZodNull:return Qv(r);case E.ZodArray:return Zv(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return tb(e,r);case E.ZodIntersection:return Wv(e,r);case E.ZodTuple:return ub(e,r);case E.ZodRecord:return Ya(e,r);case E.ZodLiteral:return Jv(e,r);case E.ZodEnum:return Bv(e);case E.ZodNativeEnum:return Xv(e);case E.ZodNullable:return rb(e,r);case E.ZodOptional:return ib(e,r);case E.ZodMap:return Kv(e,r);case E.ZodSet:return cb(e,r);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return ab(e,r);case E.ZodNaN:case E.ZodNever:return Yv(r);case E.ZodEffects:return Hv(e,r);case E.ZodAny:return je(r);case E.ZodUnknown:return db(r);case E.ZodDefault:return Vv(e,r);case E.ZodBranded:return Ka(e,r);case E.ZodReadonly:return fb(e,r);case E.ZodCatch:return Uv(e,r);case E.ZodPipeline:return sb(e,r);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(n=>{})(t)}};function W(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==Dv)return a}if(n&&!r){let a=hO(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=pb(e,e.typeName,t),s=typeof i=="function"?W(i(),t):i;if(s&&gO(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var hO=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ga(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),je(t)):t.$refStrategy==="seen"?je(t):void 0}},gO=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var ff=(e,t)=>{let r=qv(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,l])=>({...c,[u]:W(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??je(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=W(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??je(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a};function yO(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function pf(e,t){return At(e)?Md(e,{target:yO(t?.target),io:t?.pipeStrategy??"input"}):ff(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function mf(e){let r=Jr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=ka(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function hf(e,t){let r=Wr(e,t);if(!r.success)throw r.error;return r.data}var _O=6e4,Qa=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(Ca,r=>{this._oncancel(r)}),this.setNotificationHandler(Ma,r=>{this._onprogress(r)}),this.setRequestHandler(ja,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Na,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(U.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Da,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,h=new Z(d.error.code,d.error.message,d.error.data);l(h)}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 Z(U.InvalidParams,`Task not found: ${i}`);if(!Kr(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Kr(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Gr]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(Aa,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 Z(U.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Za,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(U.InvalidParams,`Task not found: ${r.params.taskId}`);if(Kr(o.status))throw new Z(U.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 Z(U.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof Z?o:new Z(U.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),Z.fromError(U.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),Ui(i)||kv(i)?this._onresponse(i):Wd(i)?this._onrequest(i,s):Sv(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=Z.fromError(U.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?.[Gr]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:U.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=wv(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,h)=>{if(s.signal.aborted)throw new Z(U.ConnectionClosed,"Request was cancelled");let m={...h,relatedRequestId:t.id};i&&!m.relatedTask&&(m.relatedTask={taskId:i});let p=m.relatedTask?.taskId??i;return p&&c&&await c.updateTaskStatus(p,"input_required"),await this.request(l,d,m)},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:U.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),Ui(t))n(t);else{let s=new Z(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(Ui(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),Ui(t))o(t);else{let s=Z.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 Z?s:new Z(U.InternalError,String(s))}}return}let i;try{let s=await this.request(t,zo,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new Z(U.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Kr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new Z(U.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Z(U.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 Z?s:new Z(U.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=T=>{l(T)};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(T){d(T);return}n?.signal?.throwIfAborted();let h=this._requestMessageId++,m={...t,jsonrpc:"2.0",id:h};n?.onprogress&&(this._progressHandlers.set(h,n.onprogress),m.params={...t.params,_meta:{...t.params?._meta||{},progressToken:h}}),a&&(m.params={...m.params,task:a}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[Gr]:c}});let p=T=>{this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(T)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(I=>this._onerror(new Error(`Failed to send cancellation: ${I}`)));let R=T instanceof Z?T:new Z(U.RequestTimeout,String(T));l(R)};this._responseHandlers.set(h,T=>{if(!n?.signal?.aborted){if(T instanceof Error)return l(T);try{let R=Wr(r,T.result);R.success?u(R.data):l(R.error)}catch(R){l(R)}}}),n?.signal?.addEventListener("abort",()=>{p(n?.signal?.reason)});let y=n?.timeout??_O,v=()=>p(Z.fromError(U.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(h,y,n?.maxTotalTimeout,v,n?.resetTimeoutOnProgress??!1);let P=c?.taskId;if(P){let T=R=>{let I=this._responseHandlers.get(h);I?I(R):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,T),this._enqueueTaskMessage(P,{type:"request",message:m,timestamp:Date.now()}).catch(R=>{this._cleanupTimeout(h),l(R)})}else this._transport.send(m,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(T=>{this._cleanupTimeout(h),l(T)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ia,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},qa,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},zv,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||{},[Gr]: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||{},[Gr]: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||{},[Gr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=mf(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=hf(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=mf(t);this._notificationHandlers.set(n,o=>{let i=hf(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"&&Wd(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new Z(U.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 Z(U.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new Z(U.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 Z(U.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=Ji.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Kr(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 Z(U.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Kr(a.status))throw new Z(U.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=Ji.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Kr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function mb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function hb(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];mb(s)&&mb(i)?r[o]={...s,...i}:r[o]=i}return r}var s$=Qs(tm(),1),a$=Qs(i$(),1);function w1(){let e=new s$.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,a$.default)(e),e}var Mc=class{constructor(t){this._ajv=t??w1()}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 Nc=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(h=>h.type==="tool_use").map(h=>h.id)),d=new Set(i.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(l.size!==d.size||![...l].every(h=>d.has(h)))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},Xi,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},Oo,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 c$(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 u$(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 Ic=class extends Qa{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ki.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 Mc,this.setRequestHandler(Kd,n=>this._oninitialize(n)),this.setNotificationHandler(Xd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(of,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Ki.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Nc(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=hb(this._capabilities,t)}setRequestHandler(t,r){let o=Jr(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(At(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=Wr(Eo,c);if(!l.success){let p=l.error instanceof Error?l.error.message:String(l.error);throw new Z(U.InvalidParams,`Invalid tools/call request: ${p}`)}let{params:d}=l.data,h=await Promise.resolve(r(c,u));if(d.task){let p=Wr(zo,h);if(!p.success){let y=p.error instanceof Error?p.error.message:String(p.error);throw new Z(U.InvalidParams,`Invalid task creation result: ${y}`)}return p.data}let m=Wr(Wa,h);if(!m.success){let p=m.error instanceof Error?m.error.message:String(m.error);throw new Z(U.InvalidParams,`Invalid tools/call result: ${p}`)}return m.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){u$(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&c$(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:_v.includes(r)?r:Hd,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"},Oa)}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},sf,r):this.request({method:"sampling/createMessage",params:t},Xi,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},Oo,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},Oo,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new Z(U.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof Z?s:new Z(U.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},af,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"})}};var d$=Symbol.for("mcp.completable");function um(e){return!!e&&typeof e=="object"&&d$ in e}function f$(e){return e[d$]?.complete}var l$;(function(e){e.Completable="McpCompletable"})(l$||(l$={}));var x1=/^[A-Za-z0-9._-]{1,128}$/;function $1(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!x1.test(e)){let r=e.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,i)=>i.indexOf(n)===o);return t.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function S1(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function lm(e){let t=$1(e);return S1(e,t.warnings),t.isValid}var Dc=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}};var Ac=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Ic(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Dc(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(Ba)),this.server.assertCanSetRequestHandler(sn(Eo)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Ba,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let n={name:t,title:r.title,description:r.description,inputSchema:(()=>{let o=Po(r.inputSchema);return o?pf(o,{strictUnions:!0,pipeStrategy:"input"}):k1})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=Po(r.outputSchema);o&&(n.outputSchema=pf(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Eo,async(t,r)=>{try{let n=this._registeredTools[t.params.name];if(!n)throw new Z(U.InvalidParams,`Tool ${t.params.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Tool ${t.params.name} disabled`);let o=!!t.params.task,i=n.execution?.taskSupport,s="createTask"in n.handler;if((i==="required"||i==="optional")&&!s)throw new Z(U.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!o)throw new Z(U.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!o&&s)return await this.handleAutomaticTaskPolling(n,t,r);let a=await this.validateToolInput(n,t.params.arguments,t.params.name),c=await this.executeToolHandler(n,a,r);return o||await this.validateToolOutput(n,c,t.params.name),c}catch(n){if(n instanceof Z&&n.code===U.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,n){if(!t.inputSchema)return;let i=Po(t.inputSchema)??t.inputSchema,s=await $a(i,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=Sa(a);throw new Z(U.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(t,r,n){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new Z(U.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=Po(t.outputSchema),i=await $a(o,r.structuredContent);if(!i.success){let s="error"in i?i.error:"Unknown error",a=Sa(s);throw new Z(U.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(t,r,n){let o=t.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(t.inputSchema){let a=o;return await Promise.resolve(a.createTask(r,s))}else{let a=o;return await Promise.resolve(a.createTask(s))}}if(t.inputSchema){let s=o;return await Promise.resolve(s(r,n))}else{let s=o;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(t,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(t,r.params.arguments,r.params.name),i=t.handler,s={...n,taskStore:n.taskStore},a=o?await Promise.resolve(i.createTask(o,s)):await Promise.resolve(i.createTask(s)),c=a.task.taskId,u=a.task,l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(h=>setTimeout(h,l));let d=await n.taskStore.getTask(c);if(!d)throw new Z(U.InternalError,`Task ${c} not found during polling`);u=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(sn(Ja)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Ja,async t=>{switch(t.params.ref.type){case"ref/prompt":return Mv(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Nv(t),this.handleResourceCompletion(t,t.params.ref);default:throw new Z(U.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let n=this._registeredPrompts[r.name];if(!n)throw new Z(U.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return zs;let i=Jr(n.argsSchema)?.[t.params.argument.name];if(!um(i))return zs;let s=f$(i);if(!s)return zs;let a=await s(t.params.argument.value,t.params.context);return m$(a)}async handleResourceCompletion(t,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return zs;throw new Z(U.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(t.params.argument.name);if(!o)return zs;let i=await o(t.params.argument.value,t.params.context);return m$(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(La)),this.server.assertCanSetRequestHandler(sn(Fa)),this.server.assertCanSetRequestHandler(sn(Ua)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(La,async(t,r)=>{let n=Object.entries(this._registeredResources).filter(([i,s])=>s.enabled).map(([i,s])=>({uri:i,name:s.name,...s.metadata})),o=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let s=await i.resourceTemplate.listCallback(r);for(let a of s.resources)o.push({...i.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Fa,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(Ua,async(t,r)=>{let n=new URL(t.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new Z(U.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let i of Object.values(this._registeredResourceTemplates)){let s=i.resourceTemplate.uriTemplate.match(n.toString());if(s)return i.readCallback(n,s,r)}throw new Z(U.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(Va)),this.server.assertCanSetRequestHandler(sn(Ha)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Va,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?P1(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ha,async(t,r)=>{let n=this._registeredPrompts[t.params.name];if(!n)throw new Z(U.InvalidParams,`Prompt ${t.params.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Prompt ${t.params.name} disabled`);if(n.argsSchema){let o=Po(n.argsSchema),i=await $a(o,t.params.arguments);if(!i.success){let c="error"in i?i.error:"Unknown error",u=Sa(c);throw new Z(U.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let s=i.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let i=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let s=this._createRegisteredResourceTemplate(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(t,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let i=this._createRegisteredResourceTemplate(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(t,r,n,o,i){let s={name:t,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(t,r,n,o,i){let s={resourceTemplate:n,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=s)),typeof u.title<"u"&&(s.title=u.title),typeof u.template<"u"&&(s.resourceTemplate=u.template),typeof u.metadata<"u"&&(s.metadata=u.metadata),typeof u.callback<"u"&&(s.readCallback=u.callback),typeof u.enabled<"u"&&(s.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,r,n,o,i){let s={title:r,description:n,argsSchema:o===void 0?void 0:Vn(o),callback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==t&&(delete this._registeredPrompts[t],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Vn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=s,o&&Object.values(o).some(c=>{let u=c instanceof bt?c._def?.innerType:c;return um(u)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(t,r,n,o,i,s,a,c,u){lm(t);let l={title:r,description:n,inputSchema:p$(o),outputSchema:p$(i),annotations:s,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==t&&(typeof d.name=="string"&&lm(d.name),delete this._registeredTools[t],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=Vn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=Vn(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let n,o,i,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(dm(c))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!dm(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${t} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(t,void 0,n,o,i,s,{taskSupport:"forbidden"},void 0,a)}registerTool(t,r,n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:o,description:i,inputSchema:s,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,o,i,s,a,c,{taskSupport:"forbidden"},u,n)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let i=r[0],s=this._createRegisteredPrompt(t,void 0,n,o,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(t,r,n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:o,description:i,argsSchema:s}=r,a=this._createRegisteredPrompt(t,o,i,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var k1={type:"object",properties:{}};function h$(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function g$(e){return"_def"in e||"_zod"in e||h$(e)}function dm(e){return typeof e!="object"||e===null||g$(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(h$)}function p$(e){if(e){if(dm(e))return Vn(e);if(!g$(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function P1(e){let t=Jr(e);return t?Object.entries(t).map(([r,n])=>{let o=J_(n),i=G_(n);return{name:r,description:o,required:!i}}):[]}function sn(e){let r=Jr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=ka(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function m$(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var zs={completion:{values:[],hasMore:!1}};import _$ from"node:process";var qc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
52
- `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),T1(r)}clear(){this._buffer=void 0}};function T1(e){return Pv.parse(JSON.parse(e))}function y$(e){return JSON.stringify(e)+`
53
- `}var Zc=class{constructor(t=_$.stdin,r=_$.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new qc,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=y$(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};function fm(e){let t={app:e,version:z1(Ko("__RED_BUILD_VERSION__",()=>"3.19.4")??"0.0.0-dev"),gitSha:Ko("__RED_BUILD_GIT_SHA__",()=>"cbccb19444939c8c3079b4d6bbfe0109662235e7")??"unknown",buildTime:Ko("__RED_BUILD_TIME__",()=>"2026-08-18T09:27:29-03:00")??"unknown",bundleAsset:Ko("__RED_BUNDLE_ASSET__",()=>"code-nav.bundle.min.mjs")??"unknown"},r=Ko("__REDDB_SDK_VERSION__",()=>""),n=Ko("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function z1(e){return e.startsWith("v")?e.slice(1):e}function v$(e){return`${e.app} ${e.version} ${e.gitSha}`}function Ko(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var b$={"=":"data",":=":{to:"data",typed:!0},":":"meta"},R1=/^[a-z][a-z0-9+.-]*:\/\//i;function E1(e,t){return typeof t=="string"?{separator:e,to:t,typed:!1,prefix:!1}:{separator:e,to:t.to,typed:t.typed??!1,prefix:t.prefix??!1}}function O1(e=b$){return Object.entries(e).map(([t,r])=>E1(t,r)).sort((t,r)=>r.separator.length-t.separator.length)}function C1(e){return/^-\d+(\.\d+)?$/.test(e)}function Rs(e){return!(!e||e.startsWith("-")&&!C1(e))}function Lc(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e}function w$(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e.includes(",")?e.split(",").map(r=>w$(r.trim())):e}function ro(e,t){switch(t){case"boolean":return j1(e);case"number":return M1(e);case"array":return e.split(",").map(r=>Lc(r.trim()));default:return e}}function j1(e){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"}function M1(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let t=Number(e);if(Number.isNaN(t))throw new TypeError(`Cannot convert "${e}" to number`);return t}function an(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function N1(e,t={}){return e.map(r=>{let n=t[r.type];return n?n(r.value):r.value}).join("")}function $e(e,t){return{type:e,value:t}}function I1(e){let t=[],r=A1(e);if(t.push($e("section-header","Usage:"),$e("text"," "),$e("usage-text",r),$e("newline",`
51
+ ]`;continue}o+=n[c],n[c]==="\\"?i=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function Qa(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===E.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,o)=>({...n,[o]:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??je(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===E.ZodString&&e.keyType._def.checks?.length){let{type:n,...o}=Ya(e.keyType._def,t);return{...r,propertyNames:o}}else{if(e.keyType?._def.typeName===E.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===E.ZodBranded&&e.keyType._def.type._def.typeName===E.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...o}=Xa(e.keyType._def,t);return{...r,propertyNames:o}}}return r}function Qv(e,t){if(t.mapStrategy==="record")return Qa(e,t);let r=W(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||je(t),n=W(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||je(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function eb(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}function tb(e){return e.target==="openAi"?void 0:{not:je({...e,currentPath:[...e.currentPath,"not"]})}}function rb(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Qi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ob(e,t){if(t.target==="openApi3")return nb(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Qi&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let s=Qi[i._def.typeName];return s&&!o.includes(s)?[...o,s]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...o,s];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((i,s,a)=>a.indexOf(i)===s);return{type:o.length>1?o:o[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return nb(e,t)}var nb=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>W(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function ib(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Qi[e.innerType._def.typeName],nullable:!0}:{type:[Qi[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=W(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=W(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function sb(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",lf(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?ie(r,"minimum",n.value,n.message,t):ie(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ie(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ie(r,"maximum",n.value,n.message,t):ie(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ie(r,"maximum",n.value,n.message,t));break;case"multipleOf":ie(r,"multipleOf",n.value,n.message,t);break}return r}function ab(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},o=[],i=e.shape();for(let a in i){let c=i[a];if(c===void 0||c._def===void 0)continue;let u=vO(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=W(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||o.push(a))}o.length&&(n.required=o);let s=_O(e,t);return s!==void 0&&(n.additionalProperties=s),n}function _O(e,t){if(e.catchall._def.typeName!=="ZodNever")return W(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function vO(e){try{return e.isOptional()}catch{return!0}}var cb=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return W(e.innerType._def,t);let r=W(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:je(t)},r]}:je(t)};var ub=(e,t)=>{if(t.pipeStrategy==="input")return W(e.in._def,t);if(t.pipeStrategy==="output")return W(e.out._def,t);let r=W(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=W(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}};function lb(e,t){return W(e.type._def,t)}function db(e,t){let n={type:"array",uniqueItems:!0,items:W(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&ie(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&ie(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function fb(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>W(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:W(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>W(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function pb(e){return{not:je(e)}}function mb(e){return je(e)}var hb=(e,t)=>W(e.innerType._def,t);var gb=(e,t,r)=>{switch(t){case E.ZodString:return Ya(e,r);case E.ZodNumber:return sb(e,r);case E.ZodObject:return ab(e,r);case E.ZodBigInt:return Vv(e,r);case E.ZodBoolean:return Hv();case E.ZodDate:return df(e,r);case E.ZodUndefined:return pb(r);case E.ZodNull:return rb(r);case E.ZodArray:return Uv(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return ob(e,r);case E.ZodIntersection:return Kv(e,r);case E.ZodTuple:return fb(e,r);case E.ZodRecord:return Qa(e,r);case E.ZodLiteral:return Xv(e,r);case E.ZodEnum:return Gv(e);case E.ZodNativeEnum:return eb(e);case E.ZodNullable:return ib(e,r);case E.ZodOptional:return cb(e,r);case E.ZodMap:return Qv(e,r);case E.ZodSet:return db(e,r);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return lb(e,r);case E.ZodNaN:case E.ZodNever:return tb(r);case E.ZodEffects:return Jv(e,r);case E.ZodAny:return je(r);case E.ZodUnknown:return mb(r);case E.ZodDefault:return Wv(e,r);case E.ZodBranded:return Xa(e,r);case E.ZodReadonly:return hb(e,r);case E.ZodCatch:return Bv(e,r);case E.ZodPipeline:return ub(e,r);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(n=>{})(t)}};function W(e,t,r=!1){let n=t.seen.get(e);if(t.override){let a=t.override?.(e,t,n,r);if(a!==Zv)return a}if(n&&!r){let a=bO(n,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=gb(e,e.typeName,t),s=typeof i=="function"?W(i(),t):i;if(s&&wO(e,t,s),t.postProcess){let a=t.postProcess(s,e,t);return o.jsonSchema=s,a}return o.jsonSchema=s,s}var bO=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ka(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),je(t)):t.$refStrategy==="seen"?je(t):void 0}},wO=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var mf=(e,t)=>{let r=Fv(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,l])=>({...c,[u]:W(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??je(r)}),{}):void 0,o=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=W(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??je(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a};function xO(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function hf(e,t){return At(e)?Md(e,{target:xO(t?.target),io:t?.pipeStrategy??"input"}):mf(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function gf(e){let r=Jr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Pa(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function yf(e,t){let r=Wr(e,t);if(!r.success)throw r.error;return r.data}var $O=6e4,ec=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(ja,r=>{this._oncancel(r)}),this.setNotificationHandler(Ia,r=>{this._onprogress(r)}),this.setRequestHandler(Na,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ma,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(U.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Aa,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,h=new Z(d.error.code,d.error.message,d.error.data);l(h)}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 Z(U.InvalidParams,`Task not found: ${i}`);if(!Kr(s.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Kr(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Gr]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(qa,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 Z(U.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(La,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(U.InvalidParams,`Task not found: ${r.params.taskId}`);if(Kr(o.status))throw new Z(U.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 Z(U.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof Z?o:new Z(U.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),Z.fromError(U.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),Vi(i)||Rv(i)?this._onresponse(i):Gd(i)?this._onrequest(i,s):Tv(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=Z.fromError(U.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?.[Gr]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:U.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=Sv(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,h)=>{if(s.signal.aborted)throw new Z(U.ConnectionClosed,"Request was cancelled");let m={...h,relatedRequestId:t.id};i&&!m.relatedTask&&(m.relatedTask={taskId:i});let p=m.relatedTask?.taskId??i;return p&&c&&await c.updateTaskStatus(p,"input_required"),await this.request(l,d,m)},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:U.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),Vi(t))n(t);else{let s=new Z(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(Vi(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),Vi(t))o(t);else{let s=Z.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 Z?s:new Z(U.InternalError,String(s))}}return}let i;try{let s=await this.request(t,zo,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new Z(U.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},Kr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new Z(U.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Z(U.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 Z?s:new Z(U.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=T=>{l(T)};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(T){d(T);return}n?.signal?.throwIfAborted();let h=this._requestMessageId++,m={...t,jsonrpc:"2.0",id:h};n?.onprogress&&(this._progressHandlers.set(h,n.onprogress),m.params={...t.params,_meta:{...t.params?._meta||{},progressToken:h}}),a&&(m.params={...m.params,task:a}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[Gr]:c}});let p=T=>{this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(T)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(M=>this._onerror(new Error(`Failed to send cancellation: ${M}`)));let z=T instanceof Z?T:new Z(U.RequestTimeout,String(T));l(z)};this._responseHandlers.set(h,T=>{if(!n?.signal?.aborted){if(T instanceof Error)return l(T);try{let z=Wr(r,T.result);z.success?u(z.data):l(z.error)}catch(z){l(z)}}}),n?.signal?.addEventListener("abort",()=>{p(n?.signal?.reason)});let y=n?.timeout??$O,v=()=>p(Z.fromError(U.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(h,y,n?.maxTotalTimeout,v,n?.resetTimeoutOnProgress??!1);let P=c?.taskId;if(P){let T=z=>{let M=this._responseHandlers.get(h);M?M(z):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,T),this._enqueueTaskMessage(P,{type:"request",message:m,timestamp:Date.now()}).catch(z=>{this._cleanupTimeout(h),l(z)})}else this._transport.send(m,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(T=>{this._cleanupTimeout(h),l(T)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Da,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},Za,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Ov,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||{},[Gr]: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||{},[Gr]: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||{},[Gr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=gf(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=yf(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=gf(t);this._notificationHandlers.set(n,o=>{let i=yf(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"&&Gd(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new Z(U.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 Z(U.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(s),i(new Z(U.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 Z(U.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=Gi.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Kr(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 Z(U.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Kr(a.status))throw new Z(U.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=Gi.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Kr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function yb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _b(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];yb(s)&&yb(i)?r[o]={...s,...i}:r[o]=i}return r}var u$=ea(nm(),1),l$=ea(c$(),1);function P1(){let e=new u$.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,l$.default)(e),e}var Ic=class{constructor(t){this._ajv=t??P1()}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 Mc=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(h=>h.type==="tool_use").map(h=>h.id)),d=new Set(i.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(l.size!==d.size||![...l].every(h=>d.has(h)))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},Yi,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},Co,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 d$(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 f$(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 Dc=class extends ec{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Xi.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 Ic,this.setRequestHandler(Yd,n=>this._oninitialize(n)),this.setNotificationHandler(Qd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(af,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Xi.safeParse(s);return a.success&&this._loggingLevels.set(i,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Mc(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=_b(this._capabilities,t)}setRequestHandler(t,r){let o=Jr(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(At(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=Wr(Oo,c);if(!l.success){let p=l.error instanceof Error?l.error.message:String(l.error);throw new Z(U.InvalidParams,`Invalid tools/call request: ${p}`)}let{params:d}=l.data,h=await Promise.resolve(r(c,u));if(d.task){let p=Wr(zo,h);if(!p.success){let y=p.error instanceof Error?p.error.message:String(p.error);throw new Z(U.InvalidParams,`Invalid task creation result: ${y}`)}return p.data}let m=Wr(Ja,h);if(!m.success){let p=m.error instanceof Error?m.error.message:String(m.error);throw new Z(U.InvalidParams,`Invalid tools/call result: ${p}`)}return m.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){f$(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&d$(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:wv.includes(r)?r:Wd,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"},Ca)}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},cf,r):this.request({method:"sampling/createMessage",params:t},Yi,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},Co,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},Co,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!a.valid)throw new Z(U.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof Z?s:new Z(U.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},uf,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"})}};var m$=Symbol.for("mcp.completable");function dm(e){return!!e&&typeof e=="object"&&m$ in e}function h$(e){return e[m$]?.complete}var p$;(function(e){e.Completable="McpCompletable"})(p$||(p$={}));var T1=/^[A-Za-z0-9._-]{1,128}$/;function R1(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!T1.test(e)){let r=e.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,i)=>i.indexOf(n)===o);return t.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function z1(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function fm(e){let t=R1(e);return z1(e,t.warnings),t.isValid}var Ac=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}};var qc=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Dc(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Ac(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(Wa)),this.server.assertCanSetRequestHandler(sn(Oo)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Wa,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let n={name:t,title:r.title,description:r.description,inputSchema:(()=>{let o=To(r.inputSchema);return o?hf(o,{strictUnions:!0,pipeStrategy:"input"}):E1})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=To(r.outputSchema);o&&(n.outputSchema=hf(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Oo,async(t,r)=>{try{let n=this._registeredTools[t.params.name];if(!n)throw new Z(U.InvalidParams,`Tool ${t.params.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Tool ${t.params.name} disabled`);let o=!!t.params.task,i=n.execution?.taskSupport,s="createTask"in n.handler;if((i==="required"||i==="optional")&&!s)throw new Z(U.InternalError,`Tool ${t.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!o)throw new Z(U.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!o&&s)return await this.handleAutomaticTaskPolling(n,t,r);let a=await this.validateToolInput(n,t.params.arguments,t.params.name),c=await this.executeToolHandler(n,a,r);return o||await this.validateToolOutput(n,c,t.params.name),c}catch(n){if(n instanceof Z&&n.code===U.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,n){if(!t.inputSchema)return;let i=To(t.inputSchema)??t.inputSchema,s=await Sa(i,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=ka(a);throw new Z(U.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(t,r,n){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new Z(U.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=To(t.outputSchema),i=await Sa(o,r.structuredContent);if(!i.success){let s="error"in i?i.error:"Unknown error",a=ka(s);throw new Z(U.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(t,r,n){let o=t.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(t.inputSchema){let a=o;return await Promise.resolve(a.createTask(r,s))}else{let a=o;return await Promise.resolve(a.createTask(s))}}if(t.inputSchema){let s=o;return await Promise.resolve(s(r,n))}else{let s=o;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(t,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(t,r.params.arguments,r.params.name),i=t.handler,s={...n,taskStore:n.taskStore},a=o?await Promise.resolve(i.createTask(o,s)):await Promise.resolve(i.createTask(s)),c=a.task.taskId,u=a.task,l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(h=>setTimeout(h,l));let d=await n.taskStore.getTask(c);if(!d)throw new Z(U.InternalError,`Task ${c} not found during polling`);u=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(sn(Ga)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Ga,async t=>{switch(t.params.ref.type){case"ref/prompt":return Dv(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return Av(t),this.handleResourceCompletion(t,t.params.ref);default:throw new Z(U.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let n=this._registeredPrompts[r.name];if(!n)throw new Z(U.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return zs;let i=Jr(n.argsSchema)?.[t.params.argument.name];if(!dm(i))return zs;let s=h$(i);if(!s)return zs;let a=await s(t.params.argument.value,t.params.context);return y$(a)}async handleResourceCompletion(t,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return zs;throw new Z(U.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(t.params.argument.name);if(!o)return zs;let i=await o(t.params.argument.value,t.params.context);return y$(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(Fa)),this.server.assertCanSetRequestHandler(sn(Ua)),this.server.assertCanSetRequestHandler(sn(Va)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Fa,async(t,r)=>{let n=Object.entries(this._registeredResources).filter(([i,s])=>s.enabled).map(([i,s])=>({uri:i,name:s.name,...s.metadata})),o=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let s=await i.resourceTemplate.listCallback(r);for(let a of s.resources)o.push({...i.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Ua,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(Va,async(t,r)=>{let n=new URL(t.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new Z(U.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let i of Object.values(this._registeredResourceTemplates)){let s=i.resourceTemplate.uriTemplate.match(n.toString());if(s)return i.readCallback(n,s,r)}throw new Z(U.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(sn(Ha)),this.server.assertCanSetRequestHandler(sn(Ba)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Ha,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?O1(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ba,async(t,r)=>{let n=this._registeredPrompts[t.params.name];if(!n)throw new Z(U.InvalidParams,`Prompt ${t.params.name} not found`);if(!n.enabled)throw new Z(U.InvalidParams,`Prompt ${t.params.name} disabled`);if(n.argsSchema){let o=To(n.argsSchema),i=await Sa(o,t.params.arguments);if(!i.success){let c="error"in i?i.error:"Unknown error",u=ka(c);throw new Z(U.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let s=i.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let i=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let s=this._createRegisteredResourceTemplate(t,void 0,r,o,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(t,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let i=this._createRegisteredResourceTemplate(t,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(t,r,n,o,i){let s={name:t,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(t,r,n,o,i){let s={resourceTemplate:n,title:r,metadata:o,readCallback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=s)),typeof u.title<"u"&&(s.title=u.title),typeof u.template<"u"&&(s.resourceTemplate=u.template),typeof u.metadata<"u"&&(s.metadata=u.metadata),typeof u.callback<"u"&&(s.readCallback=u.callback),typeof u.enabled<"u"&&(s.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,r,n,o,i){let s={title:r,description:n,argsSchema:o===void 0?void 0:Hn(o),callback:i,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==t&&(delete this._registeredPrompts[t],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Hn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=s,o&&Object.values(o).some(c=>{let u=c instanceof bt?c._def?.innerType:c;return dm(u)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(t,r,n,o,i,s,a,c,u){fm(t);let l={title:r,description:n,inputSchema:g$(o),outputSchema:g$(i),annotations:s,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==t&&(typeof d.name=="string"&&fm(d.name),delete this._registeredTools[t],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=Hn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=Hn(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let n,o,i,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(pm(c))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!pm(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${t} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(t,void 0,n,o,i,s,{taskSupport:"forbidden"},void 0,a)}registerTool(t,r,n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:o,description:i,inputSchema:s,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,o,i,s,a,c,{taskSupport:"forbidden"},u,n)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let i=r[0],s=this._createRegisteredPrompt(t,void 0,n,o,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(t,r,n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:o,description:i,argsSchema:s}=r,a=this._createRegisteredPrompt(t,o,i,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var E1={type:"object",properties:{}};function _$(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function v$(e){return"_def"in e||"_zod"in e||_$(e)}function pm(e){return typeof e!="object"||e===null||v$(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(_$)}function g$(e){if(e){if(pm(e))return Hn(e);if(!v$(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function O1(e){let t=Jr(e);return t?Object.entries(t).map(([r,n])=>{let o=X_(n),i=Y_(n);return{name:r,description:o,required:!i}}):[]}function sn(e){let r=Jr(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Pa(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function y$(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var zs={completion:{values:[],hasMore:!1}};import w$ from"node:process";var Zc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
52
+ `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),C1(r)}clear(){this._buffer=void 0}};function C1(e){return zv.parse(JSON.parse(e))}function b$(e){return JSON.stringify(e)+`
53
+ `}var Lc=class{constructor(t=w$.stdin,r=w$.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Zc,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=b$(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};function mm(e){let t={app:e,version:j1(Xo("__RED_BUILD_VERSION__",()=>"3.20.0")??"0.0.0-dev"),gitSha:Xo("__RED_BUILD_GIT_SHA__",()=>"f870feffaadff0d5b2795b4a9f26d6f183eea5c8")??"unknown",buildTime:Xo("__RED_BUILD_TIME__",()=>"2026-08-18T23:01:46-03:00")??"unknown",bundleAsset:Xo("__RED_BUNDLE_ASSET__",()=>"code-nav.bundle.min.mjs")??"unknown"},r=Xo("__REDDB_SDK_VERSION__",()=>""),n=Xo("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function j1(e){return e.startsWith("v")?e.slice(1):e}function x$(e){return`${e.app} ${e.version} ${e.gitSha}`}function Xo(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var $$={"=":"data",":=":{to:"data",typed:!0},":":"meta"},N1=/^[a-z][a-z0-9+.-]*:\/\//i;function I1(e,t){return typeof t=="string"?{separator:e,to:t,typed:!1,prefix:!1}:{separator:e,to:t.to,typed:t.typed??!1,prefix:t.prefix??!1}}function M1(e=$$){return Object.entries(e).map(([t,r])=>I1(t,r)).sort((t,r)=>r.separator.length-t.separator.length)}function D1(e){return/^-\d+(\.\d+)?$/.test(e)}function Es(e){return!(!e||e.startsWith("-")&&!D1(e))}function Fc(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e}function S$(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e.includes(",")?e.split(",").map(r=>S$(r.trim())):e}function no(e,t){switch(t){case"boolean":return A1(e);case"number":return q1(e);case"array":return e.split(",").map(r=>Fc(r.trim()));default:return e}}function A1(e){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"}function q1(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let t=Number(e);if(Number.isNaN(t))throw new TypeError(`Cannot convert "${e}" to number`);return t}function an(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Z1(e,t={}){return e.map(r=>{let n=t[r.type];return n?n(r.value):r.value}).join("")}function $e(e,t){return{type:e,value:t}}function L1(e){let t=[],r=U1(e);if(t.push($e("section-header","Usage:"),$e("text"," "),$e("usage-text",r),$e("newline",`
54
54
  `),$e("newline",`
55
55
  `)),e.positional&&e.positional.length>0){t.push($e("section-header","Arguments:"),$e("newline",`
56
56
  `));for(let n of e.positional)if(n.description){let o=n.variadic?`${n.name}...`:n.name;t.push($e("indent"," "),$e("positional-name",`<${o}>`)),n.required||t.push($e("positional-optional"," (optional)")),t.push($e("newline",`
57
57
  `),$e("indent"," "),$e("option-description",n.description),$e("newline",`
58
58
  `))}t.push($e("newline",`
59
59
  `))}if(e.options&&Object.keys(e.options).length>0){t.push($e("section-header","Options:"),$e("newline",`
60
- `));let n=q1(e.options);t.push(...n)}return t}function D1(e,t){let r=I1(e);return N1(r,t)}function A1(e){let t=["[options]"];if(e.positional)for(let r of e.positional)r.variadic?t.push(r.required?`<${r.name}...>`:`[${r.name}...]`):t.push(r.required?`<${r.name}>`:`[${r.name}]`);return t.join(" ")}function q1(e,t=!1){let r=[],n=[],o=t?"global-option-flag":"option-flag",i=t?"global-option-type":"option-type",s=t?"global-option-default":"option-default",a=t?"global-option-description":"option-description";for(let[u,l]of Object.entries(e)){if(l.hidden)continue;let d=[],h=y=>{d.includes(y)||d.push(y)};l.short&&h(`-${l.short}`),h(`--${u}`);for(let y of l.aliases??[])y.length===1?h(`-${y}`):h(`--${y}`);let m=d.join(", "),p=l.type&&l.type!=="boolean"?`<${l.type}>`:void 0;n.push({flags:m,type:p,desc:l.description??"",default:l.default!==void 0?String(l.default):void 0})}let c=Math.max(...n.map(u=>u.flags.length+(u.type?u.type.length+1:0)),20);for(let u of n){let l=u.flags.length+(u.type?u.type.length+1:0),d=" ".repeat(c-l+2);r.push($e("indent"," ")),r.push($e(o,u.flags)),u.type&&(r.push($e("text"," ")),r.push($e(i,u.type))),r.push($e("text",d)),r.push($e(a,u.desc)),u.default!==void 0&&(r.push($e("text"," ")),r.push($e(s,`(default: ${u.default})`))),r.push($e("newline",`
61
- `))}return r}function x$(e){let t=B1(e.options??{},e.autoShort??!1),r=O1(e.separators??b$);return{schema:e,parse(n){return Z1(n,e,t,r)},help(){return D1(e,e.formatter)}}}function Z1(e,t,r,n){let o={positional:{},options:{},errors:[],rest:[]},i=new Set(n.map(l=>l.to));for(let l of i)o[l]={};let s=0,a=t.positional??[],c=0,u=!1;for(;c<e.length;){let l=e[c];if(t.stopEarly&&s>0){o.rest=e.slice(c);break}if(l==="--"&&!u){u=!0,c++;continue}if(u){if(s<a.length){let h=a[s];if(h.variadic){let m=[];for(;c<e.length;){let p=e[c];m.push(h.type?ro(p,h.type):p),c++}o.positional[h.name]=m,s++}else{let m=h.type?ro(l,h.type):l;o.positional[h.name]=m,s++,c++}}else t.allowUnknown!==!1&&(o.rest=o.rest??[],o.rest.push(l)),c++;continue}if(l.startsWith("--")){c=V1(l,c,e,o,r,t);continue}if(l.startsWith("-")&&l.length>1&&!X1(l)){c=H1(l,c,e,o,r,t);continue}let d=L1(l,n);if(d){let{key:h,value:m,config:p}=d,y=o,v=y[p.to]??(y[p.to]={});v[h]=p.typed?w$(m):an(m),c++;continue}if(s<a.length){let h=a[s];if(h.variadic){let p=[];for(;c<e.length&&!e[c].startsWith("-");){let y=e[c];p.push(h.type?ro(y,h.type):y),c++}o.positional[h.name]=p,s++;continue}let m=h.type?ro(l,h.type):l;o.positional[h.name]=m,s++}else t.allowUnknown!==!1?o.rest.push(l):o.errors.push(`Unexpected positional argument: ${l}`);c++}return J1(o,t,r),G1(o,t,a),K1(o,t,r),o}function L1(e,t){if(R1.test(e))return null;for(let r of t){if(r.prefix&&e.startsWith(r.separator)){let o=e.slice(r.separator.length),i=o.indexOf(":");if(i>0){let s=o.slice(0,i),a=o.slice(i+1);if(F1(s))return{key:s,value:a,config:r}}continue}let n=e.indexOf(r.separator);if(n>0){let o=e.slice(0,n),i=e.slice(n+r.separator.length);if(U1(o,i,r))return{key:o,value:i,config:r}}}return null}function F1(e){return e?/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e):!1}function U1(e,t,r){return e?r.separator===":"?e.includes("/")||e.includes(".")||/^\d+$/.test(t)?!1:/^[A-Z][a-zA-Z0-9-]*$/.test(e):!((r.separator==="="||r.separator===":=")&&e.includes("/")):!1}function V1(e,t,r,n,o,i){let s=e.slice(2);if(s.startsWith("no-")){let c=s.slice(3),u=o.get(c);if(u?.negatable!==!1&&u?.type==="boolean")return n.options[u.name]=!1,t+1}if(s.includes("=")){let c=s.indexOf("="),u=s.slice(0,c),l=s.slice(c+1);return Fc(u,l,t+1,n,o,i)}let a=o.get(s);if(a){if(a.type!=="boolean"){let c=r[t+1];return Rs(c)?Fc(a.name,c,t+2,n,o,i):(n.errors.push(`Option --${s} requires a value`),t+1)}return n.options[a.name]=!0,t+1}return i.strict?n.errors.push(`Unknown option: --${s}`):i.allowUnknown!==!1&&(n.options[s]=!0),t+1}function H1(e,t,r,n,o,i){let s=e.slice(1);if(s.includes("=")){let a=s.indexOf("="),c=s.slice(0,a),u=s.slice(a+1),l=pm(c,o);return l?Fc(l.name,u,t+1,n,o,i):(i.strict?n.errors.push(`Unknown option: -${c}`):i.allowUnknown!==!1&&(n.options[c]=Lc(an(u))),t+1)}if(s.length===1){let a=pm(s,o);if(a){if(a.type!=="boolean"){let c=r[t+1];return Rs(c)?Fc(a.name,c,t+2,n,o,i):(n.errors.push(`Option -${s} requires a value`),t+1)}return n.options[a.name]=!0,t+1}if(i.strict)n.errors.push(`Unknown option: -${s}`);else if(i.allowUnknown!==!1){let c=r[t+1];if(Rs(c))return n.options[s]=Lc(an(c)),t+2;n.options[s]=!0}return t+1}for(let a of s){let c=pm(a,o);c?c.type==="boolean"?n.options[c.name]=!0:n.errors.push(`Option -${a} requires a value`):i.strict?n.errors.push(`Unknown option: -${a}`):i.allowUnknown!==!1&&(n.options[a]=!0)}return t+1}function Fc(e,t,r,n,o,i){let s=o.get(e);if(s){if(s.choices){let c=s.type?ro(an(t),s.type):an(t);if(!s.choices.includes(c))return n.errors.push(`Invalid value for '${e}': '${t}'. Allowed: ${s.choices.join(", ")}`),r}let a=s.type?ro(an(t),s.type):an(t);if(s.type==="array"){let c=n.options[e];Array.isArray(c)?c.push(...a):n.options[e]=a}else n.options[e]=a}else i.strict?n.errors.push(`Unknown option: --${e}`):i.allowUnknown!==!1&&(n.options[e]=Lc(an(t)));return r}function B1(e,t=!1){let r=new Map,n=Object.entries(e).sort(([i],[s])=>i.localeCompare(s)),o=new Set;for(let[,i]of n)i.short&&o.add(i.short);for(let[i,s]of n){let a=s.short??"";t&&!a&&(a=W1(i,o),a&&o.add(a));let c={name:i,short:a,aliases:s.aliases??[],type:s.type??"string",description:s.description??"",required:s.required??!1,hidden:s.hidden??!1,negatable:s.negatable??!0,default:s.default,choices:s.choices,env:s.env,validate:s.validate};r.set(i,c);for(let u of c.aliases)r.set(u,c)}return r}function W1(e,t){for(let r of e){if(!/[a-zA-Z]/.test(r))continue;let n=r.toLowerCase();if(!t.has(n))return n;let o=r.toUpperCase();if(!t.has(o))return o}return""}function pm(e,t){for(let r of t.values())if(r.short===e||r.aliases.includes(e))return r}function J1(e,t,r){for(let n of r.values())if(e.options[n.name]===void 0)if(n.env&&process.env[n.env]!==void 0){let o=process.env[n.env];e.options[n.name]=n.type?ro(o,n.type):o}else n.default!==void 0&&(e.options[n.name]=n.default);for(let n of t.positional??[])e.positional[n.name]===void 0&&n.default!==void 0&&(e.positional[n.name]=n.default)}function G1(e,t,r){if(t.options)for(let[n,o]of Object.entries(t.options))o.required&&e.options[n]===void 0&&e.errors.push(`Missing required option: --${n}`);for(let n of r)n.required&&e.positional[n.name]===void 0&&e.errors.push(`Missing required argument: <${n.name}>`)}function K1(e,t,r){for(let n of r.values()){let o=e.options[n.name];if(n.validate&&o!==void 0){let i=n.validate(o);i!==!0&&e.errors.push(i)}}for(let n of t.positional??[]){let o=e.positional[n.name];if(n.validate&&o!==void 0){let i=n.validate(o);i!==!0&&e.errors.push(i)}}}function X1(e){return/^-\d+(\.\d+)?$/.test(e)}var mm=class extends Error{flag;known;constructor(t,r){super(`unknown flag '${t}'; expected one of: ${r.join(", ")}`),this.name="UnknownFlagError",this.flag=t,this.known=r}};function Y1(e){let t={};for(let[r,n]of Object.entries(e))t[r]={type:n.kind==="boolean"?"boolean":"string",...r.length===1?{short:r}:{},...n.aliases===void 0?{}:{aliases:n.aliases}};return t}function Q1(e,t){let r=new Map;for(let[o,i]of Object.entries(t))if(!(i.kind!=="value"||i.type!=="array")){r.set(o,o);for(let s of i.aliases??[])r.set(s,o)}let n=new Map;for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="--")break;let s=i.match(/^--([^=]+)(?:=(.*))?$/)??i.match(/^-([^=])(?:=(.*))?$/);if(s===null)continue;let a=r.get(s[1]);if(a===void 0)continue;let c=s[2];if(c===void 0&&Rs(e[o+1])&&(c=e[o+1],o+=1),c===void 0)continue;let u=n.get(a)??[];u.push(c),n.set(a,u)}return n}function $$(e,t,r={}){let o=x$({options:Y1(t),separators:{},allowUnknown:!0}).parse([...e]),i={},s=Q1(e,t),a=o.errors.find(c=>/^Option --?\S+ requires a value$/.test(c));if(a!==void 0)throw new Error(a.replace(/^Option /,""));if(o.errors.length>0)throw new Error(o.errors[0]);if(r.unknownFlags==="error"){let c=new Set(Object.keys(t));for(let u of Object.keys(o.options))if(!c.has(u))throw new mm(u.length===1?`-${u}`:`--${u}`,Object.keys(t).map(l=>l.length===1?`-${l}`:`--${l}`))}for(let[c,u]of Object.entries(t)){let l=o.options[c];l!==void 0&&(u.kind==="boolean"?i[c]=l:u.type==="array"?i[c]=(s.get(c)??[]).map(d=>u.coerce(d)):i[c]=u.coerce(String(l)))}return{values:i,positionals:o.rest}}var Es=class extends Error{token;known;constructor(t,r){super(`unknown command '${t}'; expected one of: ${r.join(", ")}`),this.name="UnknownCommandError",this.token=t,this.known=r}};function S$(e,t){let[r,...n]=e;if(r!==void 0){for(let[i,s]of Object.entries(t.commands))if(r===i||(s.aliases??[]).includes(r))return{command:i,args:n};if(t.errorOnUnknownCommand&&!r.startsWith("-"))throw new Es(r,Object.keys(t.commands))}let o=t.keepArgvOnDefault??!0;return{command:t.default,args:o?[...e]:n}}var eD={help:{kind:"boolean",aliases:["h"]},version:{kind:"boolean",aliases:["v"]},json:{kind:"boolean"}},no=class extends Error{constructor(t){super(t),this.name="CodeNavUsageError"}};function k$(e){return e[0]==="--version"||e[0]==="-v"||e[0]==="version"}function P$(e){let t;try{t=S$(e,{commands:{serve:{},version:{}},default:"serve",errorOnUnknownCommand:!0})}catch(i){throw i instanceof Es?new no(i.message):i}let r;try{r=$$(t.args,eD,{unknownFlags:"error"})}catch(i){throw new no(i.message)}let n=r.positionals[0];if(n!==void 0)throw new no(`unexpected argument '${n}'`);let{values:o}=r;return{command:t.command,showHelp:o.help??!1,showVersion:t.command==="version"||(o.version??!1),versionJson:o.json??!1}}function T$(){return`code-nav \u2014 LSP-backed code navigation as an MCP server
60
+ `));let n=V1(e.options);t.push(...n)}return t}function F1(e,t){let r=L1(e);return Z1(r,t)}function U1(e){let t=["[options]"];if(e.positional)for(let r of e.positional)r.variadic?t.push(r.required?`<${r.name}...>`:`[${r.name}...]`):t.push(r.required?`<${r.name}>`:`[${r.name}]`);return t.join(" ")}function V1(e,t=!1){let r=[],n=[],o=t?"global-option-flag":"option-flag",i=t?"global-option-type":"option-type",s=t?"global-option-default":"option-default",a=t?"global-option-description":"option-description";for(let[u,l]of Object.entries(e)){if(l.hidden)continue;let d=[],h=y=>{d.includes(y)||d.push(y)};l.short&&h(`-${l.short}`),h(`--${u}`);for(let y of l.aliases??[])y.length===1?h(`-${y}`):h(`--${y}`);let m=d.join(", "),p=l.type&&l.type!=="boolean"?`<${l.type}>`:void 0;n.push({flags:m,type:p,desc:l.description??"",default:l.default!==void 0?String(l.default):void 0})}let c=Math.max(...n.map(u=>u.flags.length+(u.type?u.type.length+1:0)),20);for(let u of n){let l=u.flags.length+(u.type?u.type.length+1:0),d=" ".repeat(c-l+2);r.push($e("indent"," ")),r.push($e(o,u.flags)),u.type&&(r.push($e("text"," ")),r.push($e(i,u.type))),r.push($e("text",d)),r.push($e(a,u.desc)),u.default!==void 0&&(r.push($e("text"," ")),r.push($e(s,`(default: ${u.default})`))),r.push($e("newline",`
61
+ `))}return r}function k$(e){let t=X1(e.options??{},e.autoShort??!1),r=M1(e.separators??$$);return{schema:e,parse(n){return H1(n,e,t,r)},help(){return F1(e,e.formatter)}}}function H1(e,t,r,n){let o={positional:{},options:{},errors:[],rest:[]},i=new Set(n.map(l=>l.to));for(let l of i)o[l]={};let s=0,a=t.positional??[],c=0,u=!1;for(;c<e.length;){let l=e[c];if(t.stopEarly&&s>0){o.rest=e.slice(c);break}if(l==="--"&&!u){u=!0,c++;continue}if(u){if(s<a.length){let h=a[s];if(h.variadic){let m=[];for(;c<e.length;){let p=e[c];m.push(h.type?no(p,h.type):p),c++}o.positional[h.name]=m,s++}else{let m=h.type?no(l,h.type):l;o.positional[h.name]=m,s++,c++}}else t.allowUnknown!==!1&&(o.rest=o.rest??[],o.rest.push(l)),c++;continue}if(l.startsWith("--")){c=G1(l,c,e,o,r,t);continue}if(l.startsWith("-")&&l.length>1&&!rD(l)){c=K1(l,c,e,o,r,t);continue}let d=B1(l,n);if(d){let{key:h,value:m,config:p}=d,y=o,v=y[p.to]??(y[p.to]={});v[h]=p.typed?S$(m):an(m),c++;continue}if(s<a.length){let h=a[s];if(h.variadic){let p=[];for(;c<e.length&&!e[c].startsWith("-");){let y=e[c];p.push(h.type?no(y,h.type):y),c++}o.positional[h.name]=p,s++;continue}let m=h.type?no(l,h.type):l;o.positional[h.name]=m,s++}else t.allowUnknown!==!1?o.rest.push(l):o.errors.push(`Unexpected positional argument: ${l}`);c++}return Q1(o,t,r),eD(o,t,a),tD(o,t,r),o}function B1(e,t){if(N1.test(e))return null;for(let r of t){if(r.prefix&&e.startsWith(r.separator)){let o=e.slice(r.separator.length),i=o.indexOf(":");if(i>0){let s=o.slice(0,i),a=o.slice(i+1);if(W1(s))return{key:s,value:a,config:r}}continue}let n=e.indexOf(r.separator);if(n>0){let o=e.slice(0,n),i=e.slice(n+r.separator.length);if(J1(o,i,r))return{key:o,value:i,config:r}}}return null}function W1(e){return e?/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e):!1}function J1(e,t,r){return e?r.separator===":"?e.includes("/")||e.includes(".")||/^\d+$/.test(t)?!1:/^[A-Z][a-zA-Z0-9-]*$/.test(e):!((r.separator==="="||r.separator===":=")&&e.includes("/")):!1}function G1(e,t,r,n,o,i){let s=e.slice(2);if(s.startsWith("no-")){let c=s.slice(3),u=o.get(c);if(u?.negatable!==!1&&u?.type==="boolean")return n.options[u.name]=!1,t+1}if(s.includes("=")){let c=s.indexOf("="),u=s.slice(0,c),l=s.slice(c+1);return Uc(u,l,t+1,n,o,i)}let a=o.get(s);if(a){if(a.type!=="boolean"){let c=r[t+1];return Es(c)?Uc(a.name,c,t+2,n,o,i):(n.errors.push(`Option --${s} requires a value`),t+1)}return n.options[a.name]=!0,t+1}return i.strict?n.errors.push(`Unknown option: --${s}`):i.allowUnknown!==!1&&(n.options[s]=!0),t+1}function K1(e,t,r,n,o,i){let s=e.slice(1);if(s.includes("=")){let a=s.indexOf("="),c=s.slice(0,a),u=s.slice(a+1),l=hm(c,o);return l?Uc(l.name,u,t+1,n,o,i):(i.strict?n.errors.push(`Unknown option: -${c}`):i.allowUnknown!==!1&&(n.options[c]=Fc(an(u))),t+1)}if(s.length===1){let a=hm(s,o);if(a){if(a.type!=="boolean"){let c=r[t+1];return Es(c)?Uc(a.name,c,t+2,n,o,i):(n.errors.push(`Option -${s} requires a value`),t+1)}return n.options[a.name]=!0,t+1}if(i.strict)n.errors.push(`Unknown option: -${s}`);else if(i.allowUnknown!==!1){let c=r[t+1];if(Es(c))return n.options[s]=Fc(an(c)),t+2;n.options[s]=!0}return t+1}for(let a of s){let c=hm(a,o);c?c.type==="boolean"?n.options[c.name]=!0:n.errors.push(`Option -${a} requires a value`):i.strict?n.errors.push(`Unknown option: -${a}`):i.allowUnknown!==!1&&(n.options[a]=!0)}return t+1}function Uc(e,t,r,n,o,i){let s=o.get(e);if(s){if(s.choices){let c=s.type?no(an(t),s.type):an(t);if(!s.choices.includes(c))return n.errors.push(`Invalid value for '${e}': '${t}'. Allowed: ${s.choices.join(", ")}`),r}let a=s.type?no(an(t),s.type):an(t);if(s.type==="array"){let c=n.options[e];Array.isArray(c)?c.push(...a):n.options[e]=a}else n.options[e]=a}else i.strict?n.errors.push(`Unknown option: --${e}`):i.allowUnknown!==!1&&(n.options[e]=Fc(an(t)));return r}function X1(e,t=!1){let r=new Map,n=Object.entries(e).sort(([i],[s])=>i.localeCompare(s)),o=new Set;for(let[,i]of n)i.short&&o.add(i.short);for(let[i,s]of n){let a=s.short??"";t&&!a&&(a=Y1(i,o),a&&o.add(a));let c={name:i,short:a,aliases:s.aliases??[],type:s.type??"string",description:s.description??"",required:s.required??!1,hidden:s.hidden??!1,negatable:s.negatable??!0,default:s.default,choices:s.choices,env:s.env,validate:s.validate};r.set(i,c);for(let u of c.aliases)r.set(u,c)}return r}function Y1(e,t){for(let r of e){if(!/[a-zA-Z]/.test(r))continue;let n=r.toLowerCase();if(!t.has(n))return n;let o=r.toUpperCase();if(!t.has(o))return o}return""}function hm(e,t){for(let r of t.values())if(r.short===e||r.aliases.includes(e))return r}function Q1(e,t,r){for(let n of r.values())if(e.options[n.name]===void 0)if(n.env&&process.env[n.env]!==void 0){let o=process.env[n.env];e.options[n.name]=n.type?no(o,n.type):o}else n.default!==void 0&&(e.options[n.name]=n.default);for(let n of t.positional??[])e.positional[n.name]===void 0&&n.default!==void 0&&(e.positional[n.name]=n.default)}function eD(e,t,r){if(t.options)for(let[n,o]of Object.entries(t.options))o.required&&e.options[n]===void 0&&e.errors.push(`Missing required option: --${n}`);for(let n of r)n.required&&e.positional[n.name]===void 0&&e.errors.push(`Missing required argument: <${n.name}>`)}function tD(e,t,r){for(let n of r.values()){let o=e.options[n.name];if(n.validate&&o!==void 0){let i=n.validate(o);i!==!0&&e.errors.push(i)}}for(let n of t.positional??[]){let o=e.positional[n.name];if(n.validate&&o!==void 0){let i=n.validate(o);i!==!0&&e.errors.push(i)}}}function rD(e){return/^-\d+(\.\d+)?$/.test(e)}var gm=class extends Error{flag;known;constructor(t,r){super(`unknown flag '${t}'; expected one of: ${r.join(", ")}`),this.name="UnknownFlagError",this.flag=t,this.known=r}};function nD(e){let t={};for(let[r,n]of Object.entries(e))t[r]={type:n.kind==="boolean"?"boolean":"string",...r.length===1?{short:r}:{},...n.aliases===void 0?{}:{aliases:n.aliases}};return t}function oD(e,t){let r=new Map;for(let[o,i]of Object.entries(t))if(!(i.kind!=="value"||i.type!=="array")){r.set(o,o);for(let s of i.aliases??[])r.set(s,o)}let n=new Map;for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="--")break;let s=i.match(/^--([^=]+)(?:=(.*))?$/)??i.match(/^-([^=])(?:=(.*))?$/);if(s===null)continue;let a=r.get(s[1]);if(a===void 0)continue;let c=s[2];if(c===void 0&&Es(e[o+1])&&(c=e[o+1],o+=1),c===void 0)continue;let u=n.get(a)??[];u.push(c),n.set(a,u)}return n}function P$(e,t,r={}){let o=k$({options:nD(t),separators:{},allowUnknown:!0}).parse([...e]),i={},s=oD(e,t),a=o.errors.find(c=>/^Option --?\S+ requires a value$/.test(c));if(a!==void 0)throw new Error(a.replace(/^Option /,""));if(o.errors.length>0)throw new Error(o.errors[0]);if(r.unknownFlags==="error"){let c=new Set(Object.keys(t));for(let u of Object.keys(o.options))if(!c.has(u))throw new gm(u.length===1?`-${u}`:`--${u}`,Object.keys(t).map(l=>l.length===1?`-${l}`:`--${l}`))}for(let[c,u]of Object.entries(t)){let l=o.options[c];l!==void 0&&(u.kind==="boolean"?i[c]=l:u.type==="array"?i[c]=(s.get(c)??[]).map(d=>u.coerce(d)):i[c]=u.coerce(String(l)))}return{values:i,positionals:o.rest}}var Os=class extends Error{token;known;constructor(t,r){super(`unknown command '${t}'; expected one of: ${r.join(", ")}`),this.name="UnknownCommandError",this.token=t,this.known=r}};function T$(e,t){let[r,...n]=e;if(r!==void 0){for(let[i,s]of Object.entries(t.commands))if(r===i||(s.aliases??[]).includes(r))return{command:i,args:n};if(t.errorOnUnknownCommand&&!r.startsWith("-"))throw new Os(r,Object.keys(t.commands))}let o=t.keepArgvOnDefault??!0;return{command:t.default,args:o?[...e]:n}}var iD={help:{kind:"boolean",aliases:["h"]},version:{kind:"boolean",aliases:["v"]},json:{kind:"boolean"}},oo=class extends Error{constructor(t){super(t),this.name="CodeNavUsageError"}};function R$(e){return e[0]==="--version"||e[0]==="-v"||e[0]==="version"}function z$(e){let t;try{t=T$(e,{commands:{serve:{},version:{}},default:"serve",errorOnUnknownCommand:!0})}catch(i){throw i instanceof Os?new oo(i.message):i}let r;try{r=P$(t.args,iD,{unknownFlags:"error"})}catch(i){throw new oo(i.message)}let n=r.positionals[0];if(n!==void 0)throw new oo(`unexpected argument '${n}'`);let{values:o}=r;return{command:t.command,showHelp:o.help??!1,showVersion:t.command==="version"||(o.version??!1),versionJson:o.json??!1}}function E$(){return`code-nav \u2014 LSP-backed code navigation as an MCP server
62
62
 
63
63
  Serves goto-definition, find-references, document/workspace symbols and hover
64
64
  over stdio, so a code agent resolves symbols instead of grepping for names.
@@ -74,7 +74,11 @@ Options:
74
74
  -h, --help show this help
75
75
 
76
76
  Environment:
77
- CODE_NAV_ROOT workspace root the language servers index (default: cwd)
77
+ CODE_NAV_ROOT workspace root the language servers index. Absent, the root
78
+ follows the project the host announces (RED_SKILLS_PROJECT_ROOT,
79
+ CLAUDE_PROJECT_DIR, CODEX_PROJECT_DIR, OPENCODE_PROJECT_DIR),
80
+ then the cwd. A plugin installation directory is never the
81
+ root unless nothing else is available.
78
82
  CODE_NAV_SERVERS JSON registry overriding the default language servers, e.g.
79
83
  '{"go":{"command":"gopls","args":[],"extensions":[".go"],"languageId":"go"}}'
80
84
 
@@ -82,17 +86,18 @@ Exit codes:
82
86
  0 served until the transport closed, or printed the version/help
83
87
  1 fatal error while serving
84
88
  2 usage error
85
- `}var hm={typescript:{command:"typescript-language-server",args:["--stdio"],extensions:[".ts",".tsx",".js",".jsx",".mts",".cts",".mjs",".cjs"],languageId:"typescript"},go:{command:"gopls",args:[],extensions:[".go"],languageId:"go"},rust:{command:"rust-analyzer",args:[],extensions:[".rs"],languageId:"rust"},python:{command:"pyright-langserver",args:["--stdio"],extensions:[".py",".pyi"],languageId:"python"}};function z$(){let e=process.env.CODE_NAV_SERVERS;if(!e)return hm;try{let t=JSON.parse(e),r={...hm};for(let[n,o]of Object.entries(t))r[n]={...r[n]??{},...o};return r}catch(t){return process.stderr.write(`navigator: failed to parse CODE_NAV_SERVERS, using defaults: ${String(t)}
86
- `),hm}}function R$(e){let t=new Map;for(let[r,n]of Object.entries(e))for(let o of n.extensions)t.set(o,r);return t}var vi=Qs(Kk(),1),pt=Qs(uy(),1);import{spawn as qA}from"node:child_process";import{readFile as ZA}from"node:fs/promises";import{pathToFileURL as Xk,fileURLToPath as LA}from"node:url";import{resolve as FA}from"node:path";var Ks=class{constructor(t,r){this.spec=t;this.rootPath=r}spec;rootPath;proc;conn;ready;openDocs=new Set;async ensureStarted(){return this.ready?this.ready:(this.ready=this.start(),this.ready)}async start(){let t=qA(this.spec.command,this.spec.args,{cwd:this.rootPath,stdio:["pipe","pipe","pipe"]});this.proc=t,await new Promise((i,s)=>{t.once("spawn",()=>i()),t.once("error",a=>s(new Error(`failed to spawn '${this.spec.command}': ${a.message}`)))}),t.stderr.on("data",i=>{process.stderr.write(`[${this.spec.command}] ${i.toString()}`)}),t.once("exit",()=>{try{this.conn?.dispose()}catch{}});let r=(0,vi.createProtocolConnection)(new vi.StreamMessageReader(t.stdout),new vi.StreamMessageWriter(t.stdin));this.conn=r,r.listen();let n=Xk(this.rootPath).toString(),o={processId:process.pid,rootUri:n,workspaceFolders:[{uri:n,name:"workspace"}],capabilities:{textDocument:{definition:{linkSupport:!0},references:{},documentSymbol:{hierarchicalDocumentSymbolSupport:!0},hover:{contentFormat:["markdown","plaintext"]}},workspace:{symbol:{}}}};await r.sendRequest(pt.InitializeRequest.type,o),await r.sendNotification(pt.InitializedNotification.type,{})}async ensureOpen(t){let r=FA(this.rootPath,t),n=Xk(r).toString();if(this.openDocs.has(n))return n;let o=await ZA(r,"utf8");return await this.conn.sendNotification(pt.DidOpenTextDocumentNotification.type,{textDocument:{uri:n,languageId:this.spec.languageId,version:1,text:o}}),this.openDocs.add(n),n}async definition(t,r,n){await this.ensureStarted();let o=await this.ensureOpen(t),i=await this.conn.sendRequest(pt.DefinitionRequest.type,{textDocument:{uri:o},position:{line:r,character:n}});return UA(i)}async references(t,r,n,o){await this.ensureStarted();let i=await this.ensureOpen(t);return await this.conn.sendRequest(pt.ReferencesRequest.type,{textDocument:{uri:i},position:{line:r,character:n},context:{includeDeclaration:o}})??[]}async documentSymbols(t){await this.ensureStarted();let r=await this.ensureOpen(t);return await this.conn.sendRequest(pt.DocumentSymbolRequest.type,{textDocument:{uri:r}})??[]}async hover(t,r,n){await this.ensureStarted();let o=await this.ensureOpen(t);return this.conn.sendRequest(pt.HoverRequest.type,{textDocument:{uri:o},position:{line:r,character:n}})}async workspaceSymbols(t){return await this.ensureStarted(),await this.conn.sendRequest(pt.WorkspaceSymbolRequest.type,{query:t})??[]}dispose(){try{this.conn?.dispose()}catch{}this.proc?.kill()}};function UA(e){return e?(Array.isArray(e)?e:[e]).map(r=>"targetUri"in r?{uri:r.targetUri,range:r.targetSelectionRange}:r):[]}function ly(e,t){try{let r=LA(e);return(r.startsWith(t)?r.slice(t.length).replace(/^[/\\]/,""):r)||r}catch{return e}}var Ru={file:Vr.string().describe("Workspace-relative path to the source file."),line:Vr.number().int().describe("Zero-based line number."),character:Vr.number().int().describe("Zero-based character offset on the line.")};function HA(){let e=process.env.CODE_NAV_ROOT??process.cwd(),t=z$(),r=R$(t),n=new Map;function o(u){let l=VA(u),d=r.get(l);if(!d)throw new Error(`no language server configured for '${l}'. Configured extensions: ${[...r.keys()].join(", ")||"(none)"}.`);let h=n.get(d);return h||(h=new Ks(t[d],e),n.set(d,h)),h}function i(){for(let u of Object.keys(t))n.has(u)||n.set(u,new Ks(t[u],e));return[...n.values()]}function s(u,l){return`${ly(u,e)}:${l.start.line+1}:${l.start.character+1}`}let a=fm("navigator"),c=new Ac({name:"navigator",version:a.version});return c.registerTool("goto_definition",{title:"Go to definition",description:"Resolve the symbol at a file position to its definition(s). Returns file:line:column locations. Use this instead of grepping for a name.",inputSchema:Ru},async({file:u,line:l,character:d})=>{let h=await o(u).definition(u,l,d);return h.length===0?vr("No definition found."):vr(h.map(m=>s(m.uri,m.range)).join(`
87
- `))}),c.registerTool("find_references",{title:"Find references",description:"Find every reference to the symbol at a file position across the workspace. Semantic \u2014 matches the actual symbol, not text.",inputSchema:{...Ru,includeDeclaration:Vr.boolean().optional().describe("Include the declaration itself (default true).")}},async({file:u,line:l,character:d,includeDeclaration:h})=>{let m=await o(u).references(u,l,d,h??!0);return m.length===0?vr("No references found."):vr(`${m.length} reference(s):
88
- `+m.map(p=>s(p.uri,p.range)).join(`
89
- `))}),c.registerTool("document_symbols",{title:"Document symbols",description:"List the symbols (functions, types, methods, \u2026) defined in a file, with their positions. A semantic outline of the file.",inputSchema:{file:Ru.file}},async({file:u})=>{let l=await o(u).documentSymbols(u);return l.length===0?vr("No symbols found."):vr(Qk(l))}),c.registerTool("hover",{title:"Hover (type / docs)",description:"Get the type signature and documentation for the symbol at a file position, as the IDE hover card would show.",inputSchema:Ru},async({file:u,line:l,character:d})=>{let h=await o(u).hover(u,l,d);if(!h||!h.contents)return vr("No hover information.");let m=h.contents,p=typeof m=="string"?m:Array.isArray(m)?m.map(y=>typeof y=="string"?y:y.value).join(`
90
- `):m.value;return vr(p)}),c.registerTool("workspace_symbols",{title:"Search symbols by name",description:"Find symbols by name across the whole workspace. Start here when you know a name but not where it lives, then use goto_definition / find_references from the returned position.",inputSchema:{query:Vr.string().describe("Symbol name or fragment to search for.")}},async({query:u})=>{let d=(await Promise.all(i().map(m=>m.workspaceSymbols(u).catch(()=>[])))).flat();if(d.length===0)return vr(`No symbols matching '${u}'.`);let h=d.slice(0,100).map(m=>{let p=m.location,y=p?.range?s(p.uri,p.range):ly(p?.uri??"",e);return`${m.name} ${y}`});return vr(h.join(`
91
- `))}),{server:c,root:e,languages:Object.keys(t),dispose:()=>{for(let u of n.values())u.dispose()}}}function vr(e){return{content:[{type:"text",text:e}]}}function Qk(e,t=0){let r=" ".repeat(t);return e.map(n=>{let o=n.selectionRange??n.range??n.location?.range,i=o?`:${o.start.line+1}`:"",s=`${r}${n.name}${i}`,a=n.children?.length?`
92
- `+Qk(n.children,t+1):"";return s+a}).join(`
93
- `)}function Yk(e){let t=fm("navigator");process.stdout.write(e?`${JSON.stringify(t)}
94
- `:`${v$(t)}
95
- `)}async function BA(){let e=HA();for(let r of["SIGINT","SIGTERM"])process.on(r,()=>{e.dispose(),process.exit(0)});let t=new Zc;await e.server.connect(t),process.stderr.write(`navigator MCP ready (root=${e.root}, languages=${e.languages.join(",")})
96
- `)}async function WA(e){if(k$(e)){Yk(e.includes("--json"));return}let t;try{t=P$(e)}catch(r){throw r instanceof no&&(process.stderr.write(`code-nav: ${r.message}
97
- `),process.exit(2)),r}if(t.showVersion){Yk(t.versionJson);return}if(t.showHelp){process.stdout.write(T$());return}await BA()}WA(process.argv.slice(2)).catch(e=>{process.stderr.write(`navigator fatal: ${String(e)}
89
+ `}var ym={typescript:{command:"typescript-language-server",args:["--stdio"],extensions:[".ts",".tsx",".js",".jsx",".mts",".cts",".mjs",".cjs"],languageId:"typescript"},go:{command:"gopls",args:[],extensions:[".go"],languageId:"go"},rust:{command:"rust-analyzer",args:[],extensions:[".rs"],languageId:"rust"},python:{command:"pyright-langserver",args:["--stdio"],extensions:[".py",".pyi"],languageId:"python"}};function O$(){let e=process.env.CODE_NAV_SERVERS;if(!e)return ym;try{let t=JSON.parse(e),r={...ym};for(let[n,o]of Object.entries(t))r[n]={...r[n]??{},...o};return r}catch(t){return process.stderr.write(`navigator: failed to parse CODE_NAV_SERVERS, using defaults: ${String(t)}
90
+ `),ym}}function C$(e){let t=new Map;for(let[r,n]of Object.entries(e))for(let o of n.extensions)t.set(o,r);return t}var bi=ea(Qk(),1),pt=ea(dy(),1);import{spawn as VA}from"node:child_process";import{readFile as HA}from"node:fs/promises";import{pathToFileURL as eP,fileURLToPath as BA}from"node:url";import{resolve as WA}from"node:path";var Xs=class{constructor(t,r){this.spec=t;this.rootPath=r}spec;rootPath;proc;conn;ready;openDocs=new Set;async ensureStarted(){return this.ready?this.ready:(this.ready=this.start(),this.ready)}async start(){let t=VA(this.spec.command,this.spec.args,{cwd:this.rootPath,stdio:["pipe","pipe","pipe"]});this.proc=t,await new Promise((i,s)=>{t.once("spawn",()=>i()),t.once("error",a=>s(new Error(`failed to spawn '${this.spec.command}': ${a.message}`)))}),t.stderr.on("data",i=>{process.stderr.write(`[${this.spec.command}] ${i.toString()}`)}),t.once("exit",()=>{try{this.conn?.dispose()}catch{}});let r=(0,bi.createProtocolConnection)(new bi.StreamMessageReader(t.stdout),new bi.StreamMessageWriter(t.stdin));this.conn=r,r.listen();let n=eP(this.rootPath).toString(),o={processId:process.pid,rootUri:n,workspaceFolders:[{uri:n,name:"workspace"}],capabilities:{textDocument:{definition:{linkSupport:!0},references:{},documentSymbol:{hierarchicalDocumentSymbolSupport:!0},hover:{contentFormat:["markdown","plaintext"]}},workspace:{symbol:{}}}};await r.sendRequest(pt.InitializeRequest.type,o),await r.sendNotification(pt.InitializedNotification.type,{})}async ensureOpen(t){let r=WA(this.rootPath,t),n=eP(r).toString();if(this.openDocs.has(n))return n;let o=await HA(r,"utf8");return await this.conn.sendNotification(pt.DidOpenTextDocumentNotification.type,{textDocument:{uri:n,languageId:this.spec.languageId,version:1,text:o}}),this.openDocs.add(n),n}async definition(t,r,n){await this.ensureStarted();let o=await this.ensureOpen(t),i=await this.conn.sendRequest(pt.DefinitionRequest.type,{textDocument:{uri:o},position:{line:r,character:n}});return JA(i)}async references(t,r,n,o){await this.ensureStarted();let i=await this.ensureOpen(t);return await this.conn.sendRequest(pt.ReferencesRequest.type,{textDocument:{uri:i},position:{line:r,character:n},context:{includeDeclaration:o}})??[]}async documentSymbols(t){await this.ensureStarted();let r=await this.ensureOpen(t);return await this.conn.sendRequest(pt.DocumentSymbolRequest.type,{textDocument:{uri:r}})??[]}async hover(t,r,n){await this.ensureStarted();let o=await this.ensureOpen(t);return this.conn.sendRequest(pt.HoverRequest.type,{textDocument:{uri:o},position:{line:r,character:n}})}async workspaceSymbols(t){return await this.ensureStarted(),await this.conn.sendRequest(pt.WorkspaceSymbolRequest.type,{query:t})??[]}dispose(){try{this.conn?.dispose()}catch{}this.proc?.kill()}};function JA(e){return e?(Array.isArray(e)?e:[e]).map(r=>"targetUri"in r?{uri:r.targetUri,range:r.targetSelectionRange}:r):[]}function fy(e,t){try{let r=BA(e);return(r.startsWith(t)?r.slice(t.length).replace(/^[/\\]/,""):r)||r}catch{return e}}import{existsSync as GA}from"node:fs";import{join as vn,resolve as Eu,sep as py}from"node:path";var KA=["CODE_NAV_ROOT","RED_SKILLS_PROJECT_ROOT","CLAUDE_PROJECT_DIR","CODEX_PROJECT_DIR","OPENCODE_PROJECT_DIR"],XA=["CLAUDE_PLUGIN_ROOT","CODEX_PLUGIN_ROOT"],YA=[vn(".claude-plugin","plugin.json"),vn(".codex-plugin","plugin.json"),vn(".gemini-plugin","plugin.json")],QA=[vn(".claude","plugins"),vn(".codex","plugins"),vn(".codex",".tmp","marketplaces"),vn(".gemini","plugins")];function eq(e){let t=`${e}${py}`;return QA.some(r=>t.includes(`${py}${r}${py}`))}function tP(e,t=process.env){let r=Eu(e);for(let n of XA){let o=(t[n]??"").trim();if(o!==""&&Eu(o)===r)return!0}return eq(r)?!0:YA.some(n=>GA(vn(r,n)))}function rP(e=process.env,t=process.cwd()){for(let n of KA){let o=(e[n]??"").trim();if(o==="")continue;let i=Eu(o);if(n==="CODE_NAV_ROOT"||!tP(i,e))return{root:i,source:n}}let r=Eu(t);return tP(r,e)?{root:r,source:"cwd",warning:`workspace root fell back to the plugin installation at ${r} \u2014 no project directory was announced. Set CODE_NAV_ROOT to the repository you want indexed.`}:{root:r,source:"cwd"}}var Ou={file:Vr.string().describe("Workspace-relative path to the source file."),line:Vr.number().int().describe("Zero-based line number."),character:Vr.number().int().describe("Zero-based character offset on the line.")};function rq(){let e=rP(),t=e.root,r=O$(),n=C$(r),o=new Map;function i(l){let d=tq(l),h=n.get(d);if(!h)throw new Error(`no language server configured for '${d}'. Configured extensions: ${[...n.keys()].join(", ")||"(none)"}.`);let m=o.get(h);return m||(m=new Xs(r[h],t),o.set(h,m)),m}function s(){for(let l of Object.keys(r))o.has(l)||o.set(l,new Xs(r[l],t));return[...o.values()]}function a(l,d){return`${fy(l,t)}:${d.start.line+1}:${d.start.character+1}`}let c=mm("navigator"),u=new qc({name:"navigator",version:c.version});return u.registerTool("goto_definition",{title:"Go to definition",description:"Resolve the symbol at a file position to its definition(s). Returns file:line:column locations. Use this instead of grepping for a name.",inputSchema:Ou},async({file:l,line:d,character:h})=>{let m=await i(l).definition(l,d,h);return m.length===0?vr("No definition found."):vr(m.map(p=>a(p.uri,p.range)).join(`
91
+ `))}),u.registerTool("find_references",{title:"Find references",description:"Find every reference to the symbol at a file position across the workspace. Semantic \u2014 matches the actual symbol, not text.",inputSchema:{...Ou,includeDeclaration:Vr.boolean().optional().describe("Include the declaration itself (default true).")}},async({file:l,line:d,character:h,includeDeclaration:m})=>{let p=await i(l).references(l,d,h,m??!0);return p.length===0?vr("No references found."):vr(`${p.length} reference(s):
92
+ `+p.map(y=>a(y.uri,y.range)).join(`
93
+ `))}),u.registerTool("document_symbols",{title:"Document symbols",description:"List the symbols (functions, types, methods, \u2026) defined in a file, with their positions. A semantic outline of the file.",inputSchema:{file:Ou.file}},async({file:l})=>{let d=await i(l).documentSymbols(l);return d.length===0?vr("No symbols found."):vr(oP(d))}),u.registerTool("hover",{title:"Hover (type / docs)",description:"Get the type signature and documentation for the symbol at a file position, as the IDE hover card would show.",inputSchema:Ou},async({file:l,line:d,character:h})=>{let m=await i(l).hover(l,d,h);if(!m||!m.contents)return vr("No hover information.");let p=m.contents,y=typeof p=="string"?p:Array.isArray(p)?p.map(v=>typeof v=="string"?v:v.value).join(`
94
+ `):p.value;return vr(y)}),u.registerTool("workspace_symbols",{title:"Search symbols by name",description:"Find symbols by name across the whole workspace. Start here when you know a name but not where it lives, then use goto_definition / find_references from the returned position.",inputSchema:{query:Vr.string().describe("Symbol name or fragment to search for.")}},async({query:l})=>{let h=(await Promise.all(s().map(p=>p.workspaceSymbols(l).catch(()=>[])))).flat();if(h.length===0)return vr(`No symbols matching '${l}'.`);let m=h.slice(0,100).map(p=>{let y=p.location,v=y?.range?a(y.uri,y.range):fy(y?.uri??"",t);return`${p.name} ${v}`});return vr(m.join(`
95
+ `))}),{server:u,root:t,rootSource:e.source,...e.warning===void 0?{}:{rootWarning:e.warning},languages:Object.keys(r),dispose:()=>{for(let l of o.values())l.dispose()}}}function vr(e){return{content:[{type:"text",text:e}]}}function oP(e,t=0){let r=" ".repeat(t);return e.map(n=>{let o=n.selectionRange??n.range??n.location?.range,i=o?`:${o.start.line+1}`:"",s=`${r}${n.name}${i}`,a=n.children?.length?`
96
+ `+oP(n.children,t+1):"";return s+a}).join(`
97
+ `)}function nP(e){let t=mm("navigator");process.stdout.write(e?`${JSON.stringify(t)}
98
+ `:`${x$(t)}
99
+ `)}async function nq(){let e=rq();for(let r of["SIGINT","SIGTERM"])process.on(r,()=>{e.dispose(),process.exit(0)});let t=new Lc;await e.server.connect(t),e.rootWarning!==void 0&&process.stderr.write(`navigator: ${e.rootWarning}
100
+ `),process.stderr.write(`navigator MCP ready (root=${e.root}, root-source=${e.rootSource}, languages=${e.languages.join(",")})
101
+ `)}async function oq(e){if(R$(e)){nP(e.includes("--json"));return}let t;try{t=z$(e)}catch(r){throw r instanceof oo&&(process.stderr.write(`code-nav: ${r.message}
102
+ `),process.exit(2)),r}if(t.showVersion){nP(t.versionJson);return}if(t.showHelp){process.stdout.write(E$());return}await nq()}oq(process.argv.slice(2)).catch(e=>{process.stderr.write(`navigator fatal: ${String(e)}
98
103
  `),process.exit(1)});