nagoc-zerowork 1.1.2 → 1.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,53 +1,53 @@
1
1
  #!/usr/bin/env node
2
- var ih=Object.create;var jn=Object.defineProperty;var ah=Object.getOwnPropertyDescriptor;var ch=Object.getOwnPropertyNames;var uh=Object.getPrototypeOf,lh=Object.prototype.hasOwnProperty;var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ja=(t,e)=>{for(var r in e)jn(t,r,{get:e[r],enumerable:!0})},dh=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ch(e))!lh.call(t,n)&&n!==r&&jn(t,n,{get:()=>e[n],enumerable:!(o=ah(e,n))||o.enumerable});return t};var Ha=(t,e,r)=>(r=t!=null?ih(uh(t)):{},dh(e||!t||!t.__esModule?jn(r,"default",{value:t,enumerable:!0}):r,t));var Cr=b(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.regexpCode=L.getEsmExportName=L.getProperty=L.safeStringify=L.stringify=L.strConcat=L.addCodeArg=L.str=L._=L.nil=L._Code=L.Name=L.IDENTIFIER=L._CodeOrName=void 0;var Zr=class{};L._CodeOrName=Zr;L.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var bt=class extends Zr{constructor(e){if(super(),!L.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};L.Name=bt;var Ie=class extends Zr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof bt&&(r[o.str]=(r[o.str]||0)+1),r),{})}};L._Code=Ie;L.nil=new Ie("");function cp(t,...e){let r=[t[0]],o=0;for(;o<e.length;)Ys(r,e[o]),r.push(t[++o]);return new Ie(r)}L._=cp;var Gs=new Ie("+");function up(t,...e){let r=[jr(t[0])],o=0;for(;o<e.length;)r.push(Gs),Ys(r,e[o]),r.push(Gs,jr(t[++o]));return Ry(r),new Ie(r)}L.str=up;function Ys(t,e){e instanceof Ie?t.push(...e._items):e instanceof bt?t.push(e):t.push(Ny(e))}L.addCodeArg=Ys;function Ry(t){let e=1;for(;e<t.length-1;){if(t[e]===Gs){let r=Oy(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Oy(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof bt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof bt))return`"${t}${e.slice(1)}`}function Iy(t,e){return e.emptyStr()?t:t.emptyStr()?e:up`${t}${e}`}L.strConcat=Iy;function Ny(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:jr(Array.isArray(t)?t.join(","):t)}function Ay(t){return new Ie(jr(t))}L.stringify=Ay;function jr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}L.safeStringify=jr;function Zy(t){return typeof t=="string"&&L.IDENTIFIER.test(t)?new Ie(`.${t}`):cp`[${t}]`}L.getProperty=Zy;function jy(t){if(typeof t=="string"&&L.IDENTIFIER.test(t))return new Ie(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}L.getEsmExportName=jy;function Cy(t){return new Ie(t.toString())}L.regexpCode=Cy});var ei=b($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.ValueScope=$e.ValueScopeName=$e.Scope=$e.varKinds=$e.UsedValueState=void 0;var be=Cr(),Qs=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Wo;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Wo||($e.UsedValueState=Wo={}));$e.varKinds={const:new be.Name("const"),let:new be.Name("let"),var:new be.Name("var")};var Ko=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof be.Name?e:this.name(e)}name(e){return new be.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$e.Scope=Ko;var Go=class extends be.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,be._)`.${new be.Name(r)}[${o}]`}};$e.ValueScopeName=Go;var Dy=(0,be._)`\n`,Xs=class extends Ko{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Dy:be.nil}}get(){return this._scope}name(e){return new Go(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,i=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,n);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:s,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,be._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let s=be.nil;for(let i in e){let a=e[i];if(!a)continue;let c=o[i]=o[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Wo.Started);let l=r(u);if(l){let d=this.opts.es5?$e.varKinds.var:$e.varKinds.const;s=(0,be._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))s=(0,be._)`${s}${l}${this.opts._n}`;else throw new Qs(u);c.set(u,Wo.Completed)})}return s}};$e.ValueScope=Xs});var I=b(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.or=N.and=N.not=N.CodeGen=N.operators=N.varKinds=N.ValueScopeName=N.ValueScope=N.Scope=N.Name=N.regexpCode=N.stringify=N.getProperty=N.nil=N.strConcat=N.str=N._=void 0;var C=Cr(),De=ei(),lt=Cr();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return lt._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return lt.str}});Object.defineProperty(N,"strConcat",{enumerable:!0,get:function(){return lt.strConcat}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return lt.nil}});Object.defineProperty(N,"getProperty",{enumerable:!0,get:function(){return lt.getProperty}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return lt.stringify}});Object.defineProperty(N,"regexpCode",{enumerable:!0,get:function(){return lt.regexpCode}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return lt.Name}});var en=ei();Object.defineProperty(N,"Scope",{enumerable:!0,get:function(){return en.Scope}});Object.defineProperty(N,"ValueScope",{enumerable:!0,get:function(){return en.ValueScope}});Object.defineProperty(N,"ValueScopeName",{enumerable:!0,get:function(){return en.ValueScopeName}});Object.defineProperty(N,"varKinds",{enumerable:!0,get:function(){return en.varKinds}});N.operators={GT:new C._Code(">"),GTE:new C._Code(">="),LT:new C._Code("<"),LTE:new C._Code("<="),EQ:new C._Code("==="),NEQ:new C._Code("!=="),NOT:new C._Code("!"),OR:new C._Code("||"),AND:new C._Code("&&"),ADD:new C._Code("+")};var Xe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ti=class extends Xe{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?De.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ft(this.rhs,e,r)),this}get names(){return this.rhs instanceof C._CodeOrName?this.rhs.names:{}}},Yo=class extends Xe{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof C.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ft(this.rhs,e,r),this}get names(){let e=this.lhs instanceof C.Name?{}:{...this.lhs.names};return Xo(e,this.rhs)}},ri=class extends Yo{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},oi=class extends Xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ni=class extends Xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},si=class extends Xe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ii=class extends Xe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ft(this.code,e,r),this}get names(){return this.code instanceof C._CodeOrName?this.code.names:{}}},Dr=class extends Xe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let s=o[n];s.optimizeNames(e,r)||(qy(e,s.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>xt(e,r.names),{})}},et=class extends Dr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ai=class extends Dr{},Ut=class extends et{};Ut.kind="else";var $t=class t extends et{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new Ut(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lp(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ft(this.condition,e,r),this}get names(){let e=super.names;return Xo(e,this.condition),this.else&&xt(e,this.else.names),e}};$t.kind="if";var wt=class extends et{};wt.kind="for";var ci=class extends wt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ft(this.iteration,e,r),this}get names(){return xt(super.names,this.iteration.names)}},ui=class extends wt{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?De.varKinds.var:this.varKind,{name:o,from:n,to:s}=this;return`for(${r} ${o}=${n}; ${o}<${s}; ${o}++)`+super.render(e)}get names(){let e=Xo(super.names,this.from);return Xo(e,this.to)}},Qo=class extends wt{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ft(this.iterable,e,r),this}get names(){return xt(super.names,this.iterable.names)}},qr=class extends et{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};qr.kind="func";var Mr=class extends Dr{render(e){return"return "+super.render(e)}};Mr.kind="return";var li=class extends et{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&xt(e,this.catch.names),this.finally&&xt(e,this.finally.names),e}},Lr=class extends et{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Lr.kind="catch";var Ur=class extends et{render(e){return"finally"+super.render(e)}};Ur.kind="finally";var di=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
- `:""},this._extScope=e,this._scope=new De.Scope({parent:e}),this._nodes=[new ai]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let o=this._extScope.value(e,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,o,n){let s=this._scope.toName(r);return o!==void 0&&n&&(this._constants[s.str]=o),this._leafNode(new ti(e,s,o)),s}const(e,r,o){return this._def(De.varKinds.const,e,r,o)}let(e,r,o){return this._def(De.varKinds.let,e,r,o)}var(e,r,o){return this._def(De.varKinds.var,e,r,o)}assign(e,r,o){return this._leafNode(new Yo(e,r,o))}add(e,r){return this._leafNode(new ri(e,N.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==C.nil&&this._leafNode(new ii(e)),this}object(...e){let r=["{"];for(let[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,C.addCodeArg)(r,n));return r.push("}"),new C._Code(r)}if(e,r,o){if(this._blockNode(new $t(e)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new $t(e))}else(){return this._elseNode(new Ut)}endIf(){return this._endBlockNode($t,Ut)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new ci(e),r)}forRange(e,r,o,n,s=this.opts.es5?De.varKinds.var:De.varKinds.let){let i=this._scope.toName(e);return this._for(new ui(s,i,r,o),()=>n(i))}forOf(e,r,o,n=De.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof C.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,C._)`${i}.length`,a=>{this.var(s,(0,C._)`${i}[${a}]`),o(s)})}return this._for(new Qo("of",n,s,r),()=>o(s))}forIn(e,r,o,n=this.opts.es5?De.varKinds.var:De.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,C._)`Object.keys(${r})`,o);let s=this._scope.toName(e);return this._for(new Qo("in",n,s,r),()=>o(s))}endFor(){return this._endBlockNode(wt)}label(e){return this._leafNode(new oi(e))}break(e){return this._leafNode(new ni(e))}return(e){let r=new Mr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Mr)}try(e,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new li;if(this._blockNode(n),this.code(e),r){let s=this.name("e");this._currNode=n.catch=new Lr(s),r(s)}return o&&(this._currNode=n.finally=new Ur,this.code(o)),this._endBlockNode(Lr,Ur)}throw(e){return this._leafNode(new si(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=C.nil,o,n){return this._blockNode(new qr(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(qr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let o=this._currNode;if(o instanceof e||r&&o instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof $t))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};N.CodeGen=di;function xt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Xo(t,e){return e instanceof C._CodeOrName?xt(t,e.names):t}function Ft(t,e,r){if(t instanceof C.Name)return o(t);if(!n(t))return t;return new C._Code(t._items.reduce((s,i)=>(i instanceof C.Name&&(i=o(i)),i instanceof C._Code?s.push(...i._items):s.push(i),s),[]));function o(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function n(s){return s instanceof C._Code&&s._items.some(i=>i instanceof C.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function qy(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function lp(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,C._)`!${pi(t)}`}N.not=lp;var My=dp(N.operators.AND);function Ly(...t){return t.reduce(My)}N.and=Ly;var Uy=dp(N.operators.OR);function Fy(...t){return t.reduce(Uy)}N.or=Fy;function dp(t){return(e,r)=>e===C.nil?r:r===C.nil?e:(0,C._)`${pi(e)} ${t} ${pi(r)}`}function pi(t){return t instanceof C.Name?t:(0,C._)`(${t})`}});var q=b(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.checkStrictMode=A.getErrorPath=A.Type=A.useFunc=A.setEvaluated=A.evaluatedPropsToName=A.mergeEvaluated=A.eachItem=A.unescapeJsonPointer=A.escapeJsonPointer=A.escapeFragment=A.unescapeFragment=A.schemaRefOrVal=A.schemaHasRulesButRef=A.schemaHasRules=A.checkUnknownRules=A.alwaysValidSchema=A.toHash=void 0;var J=I(),Vy=Cr();function Jy(t){let e={};for(let r of t)e[r]=!0;return e}A.toHash=Jy;function Hy(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(mp(t,e),!hp(e,t.self.RULES.all))}A.alwaysValidSchema=Hy;function mp(t,e=t.schema){let{opts:r,self:o}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=o.RULES.keywords;for(let s in e)n[s]||yp(t,`unknown keyword: "${s}"`)}A.checkUnknownRules=mp;function hp(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}A.schemaHasRules=hp;function By(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}A.schemaHasRulesButRef=By;function Wy({topSchemaRef:t,schemaPath:e},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,J._)`${r}`}return(0,J._)`${t}${e}${(0,J.getProperty)(o)}`}A.schemaRefOrVal=Wy;function Ky(t){return gp(decodeURIComponent(t))}A.unescapeFragment=Ky;function Gy(t){return encodeURIComponent(mi(t))}A.escapeFragment=Gy;function mi(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}A.escapeJsonPointer=mi;function gp(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}A.unescapeJsonPointer=gp;function Yy(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}A.eachItem=Yy;function pp({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:o}){return(n,s,i,a)=>{let c=i===void 0?s:i instanceof J.Name?(s instanceof J.Name?t(n,s,i):e(n,s,i),i):s instanceof J.Name?(e(n,i,s),s):r(s,i);return a===J.Name&&!(c instanceof J.Name)?o(n,c):c}}A.mergeEvaluated={props:pp({mergeNames:(t,e,r)=>t.if((0,J._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,J._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,J._)`${r} || {}`).code((0,J._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,J._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,J._)`${r} || {}`),hi(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:_p}),items:pp({mergeNames:(t,e,r)=>t.if((0,J._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,J._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,J._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,J._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function _p(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,J._)`{}`);return e!==void 0&&hi(t,r,e),r}A.evaluatedPropsToName=_p;function hi(t,e,r){Object.keys(r).forEach(o=>t.assign((0,J._)`${e}${(0,J.getProperty)(o)}`,!0))}A.setEvaluated=hi;var fp={};function Qy(t,e){return t.scopeValue("func",{ref:e,code:fp[e.code]||(fp[e.code]=new Vy._Code(e.code))})}A.useFunc=Qy;var fi;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(fi||(A.Type=fi={}));function Xy(t,e,r){if(t instanceof J.Name){let o=e===fi.Num;return r?o?(0,J._)`"[" + ${t} + "]"`:(0,J._)`"['" + ${t} + "']"`:o?(0,J._)`"/" + ${t}`:(0,J._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,J.getProperty)(t).toString():"/"+mi(t)}A.getErrorPath=Xy;function yp(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}A.checkStrictMode=yp});var tt=b(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var pe=I(),ev={data:new pe.Name("data"),valCxt:new pe.Name("valCxt"),instancePath:new pe.Name("instancePath"),parentData:new pe.Name("parentData"),parentDataProperty:new pe.Name("parentDataProperty"),rootData:new pe.Name("rootData"),dynamicAnchors:new pe.Name("dynamicAnchors"),vErrors:new pe.Name("vErrors"),errors:new pe.Name("errors"),this:new pe.Name("this"),self:new pe.Name("self"),scope:new pe.Name("scope"),json:new pe.Name("json"),jsonPos:new pe.Name("jsonPos"),jsonLen:new pe.Name("jsonLen"),jsonPart:new pe.Name("jsonPart")};gi.default=ev});var Fr=b(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.extendErrors=fe.resetErrorsCount=fe.reportExtraError=fe.reportError=fe.keyword$DataError=fe.keywordError=void 0;var M=I(),tn=q(),_e=tt();fe.keywordError={message:({keyword:t})=>(0,M.str)`must pass "${t}" keyword validation`};fe.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,M.str)`"${t}" keyword must be ${e} ($data)`:(0,M.str)`"${t}" keyword is invalid ($data)`};function tv(t,e=fe.keywordError,r,o){let{it:n}=t,{gen:s,compositeRule:i,allErrors:a}=n,c=$p(t,e,r);o??(i||a)?vp(s,c):bp(n,(0,M._)`[${c}]`)}fe.reportError=tv;function rv(t,e=fe.keywordError,r){let{it:o}=t,{gen:n,compositeRule:s,allErrors:i}=o,a=$p(t,e,r);vp(n,a),s||i||bp(o,_e.default.vErrors)}fe.reportExtraError=rv;function ov(t,e){t.assign(_e.default.errors,e),t.if((0,M._)`${_e.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,M._)`${_e.default.vErrors}.length`,e),()=>t.assign(_e.default.vErrors,null)))}fe.resetErrorsCount=ov;function nv({gen:t,keyword:e,schemaValue:r,data:o,errsCount:n,it:s}){if(n===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",n,_e.default.errors,a=>{t.const(i,(0,M._)`${_e.default.vErrors}[${a}]`),t.if((0,M._)`${i}.instancePath === undefined`,()=>t.assign((0,M._)`${i}.instancePath`,(0,M.strConcat)(_e.default.instancePath,s.errorPath))),t.assign((0,M._)`${i}.schemaPath`,(0,M.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,M._)`${i}.schema`,r),t.assign((0,M._)`${i}.data`,o))})}fe.extendErrors=nv;function vp(t,e){let r=t.const("err",e);t.if((0,M._)`${_e.default.vErrors} === null`,()=>t.assign(_e.default.vErrors,(0,M._)`[${r}]`),(0,M._)`${_e.default.vErrors}.push(${r})`),t.code((0,M._)`${_e.default.errors}++`)}function bp(t,e){let{gen:r,validateName:o,schemaEnv:n}=t;n.$async?r.throw((0,M._)`new ${t.ValidationError}(${e})`):(r.assign((0,M._)`${o}.errors`,e),r.return(!1))}var zt={keyword:new M.Name("keyword"),schemaPath:new M.Name("schemaPath"),params:new M.Name("params"),propertyName:new M.Name("propertyName"),message:new M.Name("message"),schema:new M.Name("schema"),parentSchema:new M.Name("parentSchema")};function $p(t,e,r){let{createErrors:o}=t.it;return o===!1?(0,M._)`{}`:sv(t,e,r)}function sv(t,e,r={}){let{gen:o,it:n}=t,s=[iv(n,r),av(t,r)];return cv(t,e,s),o.object(...s)}function iv({errorPath:t},{instancePath:e}){let r=e?(0,M.str)`${t}${(0,tn.getErrorPath)(e,tn.Type.Str)}`:t;return[_e.default.instancePath,(0,M.strConcat)(_e.default.instancePath,r)]}function av({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:o}){let n=o?e:(0,M.str)`${e}/${t}`;return r&&(n=(0,M.str)`${n}${(0,tn.getErrorPath)(r,tn.Type.Str)}`),[zt.schemaPath,n]}function cv(t,{params:e,message:r},o){let{keyword:n,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;o.push([zt.keyword,n],[zt.params,typeof e=="function"?e(t):e||(0,M._)`{}`]),c.messages&&o.push([zt.message,typeof r=="function"?r(t):r]),c.verbose&&o.push([zt.schema,i],[zt.parentSchema,(0,M._)`${l}${d}`],[_e.default.data,s]),u&&o.push([zt.propertyName,u])}});var xp=b(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.boolOrEmptySchema=Vt.topBoolOrEmptySchema=void 0;var uv=Fr(),lv=I(),dv=tt(),pv={message:"boolean schema is false"};function fv(t){let{gen:e,schema:r,validateName:o}=t;r===!1?wp(t,!1):typeof r=="object"&&r.$async===!0?e.return(dv.default.data):(e.assign((0,lv._)`${o}.errors`,null),e.return(!0))}Vt.topBoolOrEmptySchema=fv;function mv(t,e){let{gen:r,schema:o}=t;o===!1?(r.var(e,!1),wp(t)):r.var(e,!0)}Vt.boolOrEmptySchema=mv;function wp(t,e){let{gen:r,data:o}=t,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,uv.reportError)(n,pv,void 0,e)}});var _i=b(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getRules=Jt.isJSONType=void 0;var hv=["string","number","integer","boolean","null","object","array"],gv=new Set(hv);function _v(t){return typeof t=="string"&&gv.has(t)}Jt.isJSONType=_v;function yv(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Jt.getRules=yv});var yi=b(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.shouldUseRule=dt.shouldUseGroup=dt.schemaHasRulesForType=void 0;function vv({schema:t,self:e},r){let o=e.RULES.types[r];return o&&o!==!0&&zp(t,o)}dt.schemaHasRulesForType=vv;function zp(t,e){return e.rules.some(r=>kp(t,r))}dt.shouldUseGroup=zp;function kp(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(o=>t[o]!==void 0))}dt.shouldUseRule=kp});var Vr=b(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.reportTypeError=me.checkDataTypes=me.checkDataType=me.coerceAndCheckDataType=me.getJSONTypes=me.getSchemaTypes=me.DataType=void 0;var bv=_i(),$v=yi(),wv=Fr(),O=I(),Sp=q(),Ht;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ht||(me.DataType=Ht={}));function xv(t){let e=Pp(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}me.getSchemaTypes=xv;function Pp(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(bv.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}me.getJSONTypes=Pp;function zv(t,e){let{gen:r,data:o,opts:n}=t,s=kv(e,n.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,$v.schemaHasRulesForType)(t,e[0]));if(i){let a=bi(e,o,n.strictNumbers,Ht.Wrong);r.if(a,()=>{s.length?Sv(t,e,s):$i(t)})}return i}me.coerceAndCheckDataType=zv;var Ep=new Set(["string","number","integer","boolean","null"]);function kv(t,e){return e?t.filter(r=>Ep.has(r)||e==="array"&&r==="array"):[]}function Sv(t,e,r){let{gen:o,data:n,opts:s}=t,i=o.let("dataType",(0,O._)`typeof ${n}`),a=o.let("coerced",(0,O._)`undefined`);s.coerceTypes==="array"&&o.if((0,O._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,O._)`${n}[0]`).assign(i,(0,O._)`typeof ${n}`).if(bi(e,n,s.strictNumbers),()=>o.assign(a,n))),o.if((0,O._)`${a} !== undefined`);for(let u of r)(Ep.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);o.else(),$i(t),o.endIf(),o.if((0,O._)`${a} !== undefined`,()=>{o.assign(n,a),Pv(t,a)});function c(u){switch(u){case"string":o.elseIf((0,O._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,O._)`"" + ${n}`).elseIf((0,O._)`${n} === null`).assign(a,(0,O._)`""`);return;case"number":o.elseIf((0,O._)`${i} == "boolean" || ${n} === null
2
+ var ih=Object.create;var jn=Object.defineProperty;var ah=Object.getOwnPropertyDescriptor;var ch=Object.getOwnPropertyNames;var uh=Object.getPrototypeOf,lh=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ja=(t,e)=>{for(var r in e)jn(t,r,{get:e[r],enumerable:!0})},dh=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ch(e))!lh.call(t,n)&&n!==r&&jn(t,n,{get:()=>e[n],enumerable:!(o=ah(e,n))||o.enumerable});return t};var Ha=(t,e,r)=>(r=t!=null?ih(uh(t)):{},dh(e||!t||!t.__esModule?jn(r,"default",{value:t,enumerable:!0}):r,t));var Cr=v(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.regexpCode=L.getEsmExportName=L.getProperty=L.safeStringify=L.stringify=L.strConcat=L.addCodeArg=L.str=L._=L.nil=L._Code=L.Name=L.IDENTIFIER=L._CodeOrName=void 0;var Zr=class{};L._CodeOrName=Zr;L.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var vt=class extends Zr{constructor(e){if(super(),!L.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};L.Name=vt;var Ne=class extends Zr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof vt&&(r[o.str]=(r[o.str]||0)+1),r),{})}};L._Code=Ne;L.nil=new Ne("");function cp(t,...e){let r=[t[0]],o=0;for(;o<e.length;)Ys(r,e[o]),r.push(t[++o]);return new Ne(r)}L._=cp;var Gs=new Ne("+");function up(t,...e){let r=[jr(t[0])],o=0;for(;o<e.length;)r.push(Gs),Ys(r,e[o]),r.push(Gs,jr(t[++o]));return Ry(r),new Ne(r)}L.str=up;function Ys(t,e){e instanceof Ne?t.push(...e._items):e instanceof vt?t.push(e):t.push(Ny(e))}L.addCodeArg=Ys;function Ry(t){let e=1;for(;e<t.length-1;){if(t[e]===Gs){let r=Oy(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Oy(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof vt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof vt))return`"${t}${e.slice(1)}`}function Iy(t,e){return e.emptyStr()?t:t.emptyStr()?e:up`${t}${e}`}L.strConcat=Iy;function Ny(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:jr(Array.isArray(t)?t.join(","):t)}function Ay(t){return new Ne(jr(t))}L.stringify=Ay;function jr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}L.safeStringify=jr;function Zy(t){return typeof t=="string"&&L.IDENTIFIER.test(t)?new Ne(`.${t}`):cp`[${t}]`}L.getProperty=Zy;function jy(t){if(typeof t=="string"&&L.IDENTIFIER.test(t))return new Ne(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}L.getEsmExportName=jy;function Cy(t){return new Ne(t.toString())}L.regexpCode=Cy});var ei=v(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var ve=Cr(),Qs=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Wo;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Wo||(we.UsedValueState=Wo={}));we.varKinds={const:new ve.Name("const"),let:new ve.Name("let"),var:new ve.Name("var")};var Ko=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ve.Name?e:this.name(e)}name(e){return new ve.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};we.Scope=Ko;var Go=class extends ve.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,ve._)`.${new ve.Name(r)}[${o}]`}};we.ValueScopeName=Go;var Dy=(0,ve._)`\n`,Xs=class extends Ko{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Dy:ve.nil}}get(){return this._scope}name(e){return new Go(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,i=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,n);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:s,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,ve._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let s=ve.nil;for(let i in e){let a=e[i];if(!a)continue;let c=o[i]=o[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Wo.Started);let l=r(u);if(l){let d=this.opts.es5?we.varKinds.var:we.varKinds.const;s=(0,ve._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))s=(0,ve._)`${s}${l}${this.opts._n}`;else throw new Qs(u);c.set(u,Wo.Completed)})}return s}};we.ValueScope=Xs});var I=v(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.or=N.and=N.not=N.CodeGen=N.operators=N.varKinds=N.ValueScopeName=N.ValueScope=N.Scope=N.Name=N.regexpCode=N.stringify=N.getProperty=N.nil=N.strConcat=N.str=N._=void 0;var C=Cr(),De=ei(),lt=Cr();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return lt._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return lt.str}});Object.defineProperty(N,"strConcat",{enumerable:!0,get:function(){return lt.strConcat}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return lt.nil}});Object.defineProperty(N,"getProperty",{enumerable:!0,get:function(){return lt.getProperty}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return lt.stringify}});Object.defineProperty(N,"regexpCode",{enumerable:!0,get:function(){return lt.regexpCode}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return lt.Name}});var en=ei();Object.defineProperty(N,"Scope",{enumerable:!0,get:function(){return en.Scope}});Object.defineProperty(N,"ValueScope",{enumerable:!0,get:function(){return en.ValueScope}});Object.defineProperty(N,"ValueScopeName",{enumerable:!0,get:function(){return en.ValueScopeName}});Object.defineProperty(N,"varKinds",{enumerable:!0,get:function(){return en.varKinds}});N.operators={GT:new C._Code(">"),GTE:new C._Code(">="),LT:new C._Code("<"),LTE:new C._Code("<="),EQ:new C._Code("==="),NEQ:new C._Code("!=="),NOT:new C._Code("!"),OR:new C._Code("||"),AND:new C._Code("&&"),ADD:new C._Code("+")};var Xe=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ti=class extends Xe{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?De.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ft(this.rhs,e,r)),this}get names(){return this.rhs instanceof C._CodeOrName?this.rhs.names:{}}},Yo=class extends Xe{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof C.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ft(this.rhs,e,r),this}get names(){let e=this.lhs instanceof C.Name?{}:{...this.lhs.names};return Xo(e,this.rhs)}},ri=class extends Yo{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},oi=class extends Xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ni=class extends Xe{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},si=class extends Xe{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ii=class extends Xe{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ft(this.code,e,r),this}get names(){return this.code instanceof C._CodeOrName?this.code.names:{}}},Dr=class extends Xe{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let s=o[n];s.optimizeNames(e,r)||(qy(e,s.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>zt(e,r.names),{})}},et=class extends Dr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ai=class extends Dr{},Ut=class extends et{};Ut.kind="else";var wt=class t extends et{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new Ut(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lp(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ft(this.condition,e,r),this}get names(){let e=super.names;return Xo(e,this.condition),this.else&&zt(e,this.else.names),e}};wt.kind="if";var $t=class extends et{};$t.kind="for";var ci=class extends $t{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ft(this.iteration,e,r),this}get names(){return zt(super.names,this.iteration.names)}},ui=class extends $t{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?De.varKinds.var:this.varKind,{name:o,from:n,to:s}=this;return`for(${r} ${o}=${n}; ${o}<${s}; ${o}++)`+super.render(e)}get names(){let e=Xo(super.names,this.from);return Xo(e,this.to)}},Qo=class extends $t{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ft(this.iterable,e,r),this}get names(){return zt(super.names,this.iterable.names)}},qr=class extends et{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};qr.kind="func";var Mr=class extends Dr{render(e){return"return "+super.render(e)}};Mr.kind="return";var li=class extends et{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&zt(e,this.catch.names),this.finally&&zt(e,this.finally.names),e}},Lr=class extends et{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Lr.kind="catch";var Ur=class extends et{render(e){return"finally"+super.render(e)}};Ur.kind="finally";var di=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
+ `:""},this._extScope=e,this._scope=new De.Scope({parent:e}),this._nodes=[new ai]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let o=this._extScope.value(e,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,o,n){let s=this._scope.toName(r);return o!==void 0&&n&&(this._constants[s.str]=o),this._leafNode(new ti(e,s,o)),s}const(e,r,o){return this._def(De.varKinds.const,e,r,o)}let(e,r,o){return this._def(De.varKinds.let,e,r,o)}var(e,r,o){return this._def(De.varKinds.var,e,r,o)}assign(e,r,o){return this._leafNode(new Yo(e,r,o))}add(e,r){return this._leafNode(new ri(e,N.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==C.nil&&this._leafNode(new ii(e)),this}object(...e){let r=["{"];for(let[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,C.addCodeArg)(r,n));return r.push("}"),new C._Code(r)}if(e,r,o){if(this._blockNode(new wt(e)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new wt(e))}else(){return this._elseNode(new Ut)}endIf(){return this._endBlockNode(wt,Ut)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new ci(e),r)}forRange(e,r,o,n,s=this.opts.es5?De.varKinds.var:De.varKinds.let){let i=this._scope.toName(e);return this._for(new ui(s,i,r,o),()=>n(i))}forOf(e,r,o,n=De.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof C.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,C._)`${i}.length`,a=>{this.var(s,(0,C._)`${i}[${a}]`),o(s)})}return this._for(new Qo("of",n,s,r),()=>o(s))}forIn(e,r,o,n=this.opts.es5?De.varKinds.var:De.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,C._)`Object.keys(${r})`,o);let s=this._scope.toName(e);return this._for(new Qo("in",n,s,r),()=>o(s))}endFor(){return this._endBlockNode($t)}label(e){return this._leafNode(new oi(e))}break(e){return this._leafNode(new ni(e))}return(e){let r=new Mr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Mr)}try(e,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new li;if(this._blockNode(n),this.code(e),r){let s=this.name("e");this._currNode=n.catch=new Lr(s),r(s)}return o&&(this._currNode=n.finally=new Ur,this.code(o)),this._endBlockNode(Lr,Ur)}throw(e){return this._leafNode(new si(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=C.nil,o,n){return this._blockNode(new qr(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(qr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let o=this._currNode;if(o instanceof e||r&&o instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof wt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};N.CodeGen=di;function zt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Xo(t,e){return e instanceof C._CodeOrName?zt(t,e.names):t}function Ft(t,e,r){if(t instanceof C.Name)return o(t);if(!n(t))return t;return new C._Code(t._items.reduce((s,i)=>(i instanceof C.Name&&(i=o(i)),i instanceof C._Code?s.push(...i._items):s.push(i),s),[]));function o(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function n(s){return s instanceof C._Code&&s._items.some(i=>i instanceof C.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function qy(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function lp(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,C._)`!${pi(t)}`}N.not=lp;var My=dp(N.operators.AND);function Ly(...t){return t.reduce(My)}N.and=Ly;var Uy=dp(N.operators.OR);function Fy(...t){return t.reduce(Uy)}N.or=Fy;function dp(t){return(e,r)=>e===C.nil?r:r===C.nil?e:(0,C._)`${pi(e)} ${t} ${pi(r)}`}function pi(t){return t instanceof C.Name?t:(0,C._)`(${t})`}});var q=v(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.checkStrictMode=A.getErrorPath=A.Type=A.useFunc=A.setEvaluated=A.evaluatedPropsToName=A.mergeEvaluated=A.eachItem=A.unescapeJsonPointer=A.escapeJsonPointer=A.escapeFragment=A.unescapeFragment=A.schemaRefOrVal=A.schemaHasRulesButRef=A.schemaHasRules=A.checkUnknownRules=A.alwaysValidSchema=A.toHash=void 0;var J=I(),Vy=Cr();function Jy(t){let e={};for(let r of t)e[r]=!0;return e}A.toHash=Jy;function Hy(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(mp(t,e),!hp(e,t.self.RULES.all))}A.alwaysValidSchema=Hy;function mp(t,e=t.schema){let{opts:r,self:o}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=o.RULES.keywords;for(let s in e)n[s]||yp(t,`unknown keyword: "${s}"`)}A.checkUnknownRules=mp;function hp(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}A.schemaHasRules=hp;function By(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}A.schemaHasRulesButRef=By;function Wy({topSchemaRef:t,schemaPath:e},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,J._)`${r}`}return(0,J._)`${t}${e}${(0,J.getProperty)(o)}`}A.schemaRefOrVal=Wy;function Ky(t){return gp(decodeURIComponent(t))}A.unescapeFragment=Ky;function Gy(t){return encodeURIComponent(mi(t))}A.escapeFragment=Gy;function mi(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}A.escapeJsonPointer=mi;function gp(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}A.unescapeJsonPointer=gp;function Yy(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}A.eachItem=Yy;function pp({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:o}){return(n,s,i,a)=>{let c=i===void 0?s:i instanceof J.Name?(s instanceof J.Name?t(n,s,i):e(n,s,i),i):s instanceof J.Name?(e(n,i,s),s):r(s,i);return a===J.Name&&!(c instanceof J.Name)?o(n,c):c}}A.mergeEvaluated={props:pp({mergeNames:(t,e,r)=>t.if((0,J._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,J._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,J._)`${r} || {}`).code((0,J._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,J._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,J._)`${r} || {}`),hi(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:_p}),items:pp({mergeNames:(t,e,r)=>t.if((0,J._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,J._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,J._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,J._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function _p(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,J._)`{}`);return e!==void 0&&hi(t,r,e),r}A.evaluatedPropsToName=_p;function hi(t,e,r){Object.keys(r).forEach(o=>t.assign((0,J._)`${e}${(0,J.getProperty)(o)}`,!0))}A.setEvaluated=hi;var fp={};function Qy(t,e){return t.scopeValue("func",{ref:e,code:fp[e.code]||(fp[e.code]=new Vy._Code(e.code))})}A.useFunc=Qy;var fi;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(fi||(A.Type=fi={}));function Xy(t,e,r){if(t instanceof J.Name){let o=e===fi.Num;return r?o?(0,J._)`"[" + ${t} + "]"`:(0,J._)`"['" + ${t} + "']"`:o?(0,J._)`"/" + ${t}`:(0,J._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,J.getProperty)(t).toString():"/"+mi(t)}A.getErrorPath=Xy;function yp(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}A.checkStrictMode=yp});var tt=v(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var pe=I(),eb={data:new pe.Name("data"),valCxt:new pe.Name("valCxt"),instancePath:new pe.Name("instancePath"),parentData:new pe.Name("parentData"),parentDataProperty:new pe.Name("parentDataProperty"),rootData:new pe.Name("rootData"),dynamicAnchors:new pe.Name("dynamicAnchors"),vErrors:new pe.Name("vErrors"),errors:new pe.Name("errors"),this:new pe.Name("this"),self:new pe.Name("self"),scope:new pe.Name("scope"),json:new pe.Name("json"),jsonPos:new pe.Name("jsonPos"),jsonLen:new pe.Name("jsonLen"),jsonPart:new pe.Name("jsonPart")};gi.default=eb});var Fr=v(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.extendErrors=fe.resetErrorsCount=fe.reportExtraError=fe.reportError=fe.keyword$DataError=fe.keywordError=void 0;var M=I(),tn=q(),_e=tt();fe.keywordError={message:({keyword:t})=>(0,M.str)`must pass "${t}" keyword validation`};fe.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,M.str)`"${t}" keyword must be ${e} ($data)`:(0,M.str)`"${t}" keyword is invalid ($data)`};function tb(t,e=fe.keywordError,r,o){let{it:n}=t,{gen:s,compositeRule:i,allErrors:a}=n,c=wp(t,e,r);o??(i||a)?bp(s,c):vp(n,(0,M._)`[${c}]`)}fe.reportError=tb;function rb(t,e=fe.keywordError,r){let{it:o}=t,{gen:n,compositeRule:s,allErrors:i}=o,a=wp(t,e,r);bp(n,a),s||i||vp(o,_e.default.vErrors)}fe.reportExtraError=rb;function ob(t,e){t.assign(_e.default.errors,e),t.if((0,M._)`${_e.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,M._)`${_e.default.vErrors}.length`,e),()=>t.assign(_e.default.vErrors,null)))}fe.resetErrorsCount=ob;function nb({gen:t,keyword:e,schemaValue:r,data:o,errsCount:n,it:s}){if(n===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",n,_e.default.errors,a=>{t.const(i,(0,M._)`${_e.default.vErrors}[${a}]`),t.if((0,M._)`${i}.instancePath === undefined`,()=>t.assign((0,M._)`${i}.instancePath`,(0,M.strConcat)(_e.default.instancePath,s.errorPath))),t.assign((0,M._)`${i}.schemaPath`,(0,M.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,M._)`${i}.schema`,r),t.assign((0,M._)`${i}.data`,o))})}fe.extendErrors=nb;function bp(t,e){let r=t.const("err",e);t.if((0,M._)`${_e.default.vErrors} === null`,()=>t.assign(_e.default.vErrors,(0,M._)`[${r}]`),(0,M._)`${_e.default.vErrors}.push(${r})`),t.code((0,M._)`${_e.default.errors}++`)}function vp(t,e){let{gen:r,validateName:o,schemaEnv:n}=t;n.$async?r.throw((0,M._)`new ${t.ValidationError}(${e})`):(r.assign((0,M._)`${o}.errors`,e),r.return(!1))}var kt={keyword:new M.Name("keyword"),schemaPath:new M.Name("schemaPath"),params:new M.Name("params"),propertyName:new M.Name("propertyName"),message:new M.Name("message"),schema:new M.Name("schema"),parentSchema:new M.Name("parentSchema")};function wp(t,e,r){let{createErrors:o}=t.it;return o===!1?(0,M._)`{}`:sb(t,e,r)}function sb(t,e,r={}){let{gen:o,it:n}=t,s=[ib(n,r),ab(t,r)];return cb(t,e,s),o.object(...s)}function ib({errorPath:t},{instancePath:e}){let r=e?(0,M.str)`${t}${(0,tn.getErrorPath)(e,tn.Type.Str)}`:t;return[_e.default.instancePath,(0,M.strConcat)(_e.default.instancePath,r)]}function ab({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:o}){let n=o?e:(0,M.str)`${e}/${t}`;return r&&(n=(0,M.str)`${n}${(0,tn.getErrorPath)(r,tn.Type.Str)}`),[kt.schemaPath,n]}function cb(t,{params:e,message:r},o){let{keyword:n,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;o.push([kt.keyword,n],[kt.params,typeof e=="function"?e(t):e||(0,M._)`{}`]),c.messages&&o.push([kt.message,typeof r=="function"?r(t):r]),c.verbose&&o.push([kt.schema,i],[kt.parentSchema,(0,M._)`${l}${d}`],[_e.default.data,s]),u&&o.push([kt.propertyName,u])}});var zp=v(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.boolOrEmptySchema=Vt.topBoolOrEmptySchema=void 0;var ub=Fr(),lb=I(),db=tt(),pb={message:"boolean schema is false"};function fb(t){let{gen:e,schema:r,validateName:o}=t;r===!1?$p(t,!1):typeof r=="object"&&r.$async===!0?e.return(db.default.data):(e.assign((0,lb._)`${o}.errors`,null),e.return(!0))}Vt.topBoolOrEmptySchema=fb;function mb(t,e){let{gen:r,schema:o}=t;o===!1?(r.var(e,!1),$p(t)):r.var(e,!0)}Vt.boolOrEmptySchema=mb;function $p(t,e){let{gen:r,data:o}=t,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,ub.reportError)(n,pb,void 0,e)}});var _i=v(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getRules=Jt.isJSONType=void 0;var hb=["string","number","integer","boolean","null","object","array"],gb=new Set(hb);function _b(t){return typeof t=="string"&&gb.has(t)}Jt.isJSONType=_b;function yb(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Jt.getRules=yb});var yi=v(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.shouldUseRule=dt.shouldUseGroup=dt.schemaHasRulesForType=void 0;function bb({schema:t,self:e},r){let o=e.RULES.types[r];return o&&o!==!0&&kp(t,o)}dt.schemaHasRulesForType=bb;function kp(t,e){return e.rules.some(r=>xp(t,r))}dt.shouldUseGroup=kp;function xp(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(o=>t[o]!==void 0))}dt.shouldUseRule=xp});var Vr=v(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.reportTypeError=me.checkDataTypes=me.checkDataType=me.coerceAndCheckDataType=me.getJSONTypes=me.getSchemaTypes=me.DataType=void 0;var vb=_i(),wb=yi(),$b=Fr(),O=I(),Sp=q(),Ht;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ht||(me.DataType=Ht={}));function zb(t){let e=Pp(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}me.getSchemaTypes=zb;function Pp(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(vb.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}me.getJSONTypes=Pp;function kb(t,e){let{gen:r,data:o,opts:n}=t,s=xb(e,n.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,wb.schemaHasRulesForType)(t,e[0]));if(i){let a=vi(e,o,n.strictNumbers,Ht.Wrong);r.if(a,()=>{s.length?Sb(t,e,s):wi(t)})}return i}me.coerceAndCheckDataType=kb;var Ep=new Set(["string","number","integer","boolean","null"]);function xb(t,e){return e?t.filter(r=>Ep.has(r)||e==="array"&&r==="array"):[]}function Sb(t,e,r){let{gen:o,data:n,opts:s}=t,i=o.let("dataType",(0,O._)`typeof ${n}`),a=o.let("coerced",(0,O._)`undefined`);s.coerceTypes==="array"&&o.if((0,O._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,O._)`${n}[0]`).assign(i,(0,O._)`typeof ${n}`).if(vi(e,n,s.strictNumbers),()=>o.assign(a,n))),o.if((0,O._)`${a} !== undefined`);for(let u of r)(Ep.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);o.else(),wi(t),o.endIf(),o.if((0,O._)`${a} !== undefined`,()=>{o.assign(n,a),Pb(t,a)});function c(u){switch(u){case"string":o.elseIf((0,O._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,O._)`"" + ${n}`).elseIf((0,O._)`${n} === null`).assign(a,(0,O._)`""`);return;case"number":o.elseIf((0,O._)`${i} == "boolean" || ${n} === null
4
4
  || (${i} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,O._)`+${n}`);return;case"integer":o.elseIf((0,O._)`${i} === "boolean" || ${n} === null
5
5
  || (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,O._)`+${n}`);return;case"boolean":o.elseIf((0,O._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,O._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf((0,O._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf((0,O._)`${i} === "string" || ${i} === "number"
6
- || ${i} === "boolean" || ${n} === null`).assign(a,(0,O._)`[${n}]`)}}}function Pv({gen:t,parentData:e,parentDataProperty:r},o){t.if((0,O._)`${e} !== undefined`,()=>t.assign((0,O._)`${e}[${r}]`,o))}function vi(t,e,r,o=Ht.Correct){let n=o===Ht.Correct?O.operators.EQ:O.operators.NEQ,s;switch(t){case"null":return(0,O._)`${e} ${n} null`;case"array":s=(0,O._)`Array.isArray(${e})`;break;case"object":s=(0,O._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,O._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,O._)`typeof ${e} ${n} ${t}`}return o===Ht.Correct?s:(0,O.not)(s);function i(a=O.nil){return(0,O.and)((0,O._)`typeof ${e} == "number"`,a,r?(0,O._)`isFinite(${e})`:O.nil)}}me.checkDataType=vi;function bi(t,e,r,o){if(t.length===1)return vi(t[0],e,r,o);let n,s=(0,Sp.toHash)(t);if(s.array&&s.object){let i=(0,O._)`typeof ${e} != "object"`;n=s.null?i:(0,O._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else n=O.nil;s.number&&delete s.integer;for(let i in s)n=(0,O.and)(n,vi(i,e,r,o));return n}me.checkDataTypes=bi;var Ev={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,O._)`{type: ${t}}`:(0,O._)`{type: ${e}}`};function $i(t){let e=Tv(t);(0,wv.reportError)(e,Ev)}me.reportTypeError=$i;function Tv(t){let{gen:e,data:r,schema:o}=t,n=(0,Sp.schemaRefOrVal)(t,o,"type");return{gen:e,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:t}}});var Rp=b(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.assignDefaults=void 0;var Bt=I(),Rv=q();function Ov(t,e){let{properties:r,items:o}=t.schema;if(e==="object"&&r)for(let n in r)Tp(t,n,r[n].default);else e==="array"&&Array.isArray(o)&&o.forEach((n,s)=>Tp(t,s,n.default))}rn.assignDefaults=Ov;function Tp(t,e,r){let{gen:o,compositeRule:n,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Bt._)`${s}${(0,Bt.getProperty)(e)}`;if(n){(0,Rv.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Bt._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Bt._)`${c} || ${a} === null || ${a} === ""`),o.if(c,(0,Bt._)`${a} = ${(0,Bt.stringify)(r)}`)}});var Ne=b(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.validateUnion=V.validateArray=V.usePattern=V.callValidateCode=V.schemaProperties=V.allSchemaProperties=V.noPropertyInData=V.propertyInData=V.isOwnProperty=V.hasPropFunc=V.reportMissingProp=V.checkMissingProp=V.checkReportMissingProp=void 0;var G=I(),wi=q(),pt=tt(),Iv=q();function Nv(t,e){let{gen:r,data:o,it:n}=t;r.if(zi(r,o,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,G._)`${e}`},!0),t.error()})}V.checkReportMissingProp=Nv;function Av({gen:t,data:e,it:{opts:r}},o,n){return(0,G.or)(...o.map(s=>(0,G.and)(zi(t,e,s,r.ownProperties),(0,G._)`${n} = ${s}`)))}V.checkMissingProp=Av;function Zv(t,e){t.setParams({missingProperty:e},!0),t.error()}V.reportMissingProp=Zv;function Op(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Op;function xi(t,e,r){return(0,G._)`${Op(t)}.call(${e}, ${r})`}V.isOwnProperty=xi;function jv(t,e,r,o){let n=(0,G._)`${e}${(0,G.getProperty)(r)} !== undefined`;return o?(0,G._)`${n} && ${xi(t,e,r)}`:n}V.propertyInData=jv;function zi(t,e,r,o){let n=(0,G._)`${e}${(0,G.getProperty)(r)} === undefined`;return o?(0,G.or)(n,(0,G.not)(xi(t,e,r))):n}V.noPropertyInData=zi;function Ip(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Ip;function Cv(t,e){return Ip(e).filter(r=>!(0,wi.alwaysValidSchema)(t,e[r]))}V.schemaProperties=Cv;function Dv({schemaCode:t,data:e,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:s},it:i},a,c,u){let l=u?(0,G._)`${t}, ${e}, ${o}${n}`:e,d=[[pt.default.instancePath,(0,G.strConcat)(pt.default.instancePath,s)],[pt.default.parentData,i.parentData],[pt.default.parentDataProperty,i.parentDataProperty],[pt.default.rootData,pt.default.rootData]];i.opts.dynamicRef&&d.push([pt.default.dynamicAnchors,pt.default.dynamicAnchors]);let p=(0,G._)`${l}, ${r.object(...d)}`;return c!==G.nil?(0,G._)`${a}.call(${c}, ${p})`:(0,G._)`${a}(${p})`}V.callValidateCode=Dv;var qv=(0,G._)`new RegExp`;function Mv({gen:t,it:{opts:e}},r){let o=e.unicodeRegExp?"u":"",{regExp:n}=e.code,s=n(r,o);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,G._)`${n.code==="new RegExp"?qv:(0,Iv.useFunc)(t,n)}(${r}, ${o})`})}V.usePattern=Mv;function Lv(t){let{gen:e,data:r,keyword:o,it:n}=t,s=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,G._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:wi.Type.Num},s),e.if((0,G.not)(s),a)})}}V.validateArray=Lv;function Uv(t){let{gen:e,schema:r,keyword:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,wi.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:o,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,G._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,G.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}V.validateUnion=Uv});var Zp=b(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.validateKeywordUsage=Ve.validSchemaType=Ve.funcKeywordCode=Ve.macroKeywordCode=void 0;var ye=I(),kt=tt(),Fv=Ne(),Vv=Fr();function Jv(t,e){let{gen:r,keyword:o,schema:n,parentSchema:s,it:i}=t,a=e.macro.call(i.self,n,s,i),c=Ap(r,o,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ye.nil,errSchemaPath:`${i.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ve.macroKeywordCode=Jv;function Hv(t,e){var r;let{gen:o,keyword:n,schema:s,parentSchema:i,$data:a,it:c}=t;Wv(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Ap(o,n,u),d=o.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)_(),e.modifying&&Np(t),y(()=>t.error());else{let v=e.async?f():m();e.modifying&&Np(t),y(()=>Bv(t,v))}}function f(){let v=o.let("ruleErrs",null);return o.try(()=>_((0,ye._)`await `),P=>o.assign(d,!1).if((0,ye._)`${P} instanceof ${c.ValidationError}`,()=>o.assign(v,(0,ye._)`${P}.errors`),()=>o.throw(P))),v}function m(){let v=(0,ye._)`${l}.errors`;return o.assign(v,null),_(ye.nil),v}function _(v=e.async?(0,ye._)`await `:ye.nil){let P=c.opts.passContext?kt.default.this:kt.default.self,x=!("compile"in e&&!a||e.schema===!1);o.assign(d,(0,ye._)`${v}${(0,Fv.callValidateCode)(t,l,P,x)}`,e.modifying)}function y(v){var P;o.if((0,ye.not)((P=e.valid)!==null&&P!==void 0?P:d),v)}}Ve.funcKeywordCode=Hv;function Np(t){let{gen:e,data:r,it:o}=t;e.if(o.parentData,()=>e.assign(r,(0,ye._)`${o.parentData}[${o.parentDataProperty}]`))}function Bv(t,e){let{gen:r}=t;r.if((0,ye._)`Array.isArray(${e})`,()=>{r.assign(kt.default.vErrors,(0,ye._)`${kt.default.vErrors} === null ? ${e} : ${kt.default.vErrors}.concat(${e})`).assign(kt.default.errors,(0,ye._)`${kt.default.vErrors}.length`),(0,Vv.extendErrors)(t)},()=>t.error())}function Wv({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Ap(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ye.stringify)(r)})}function Kv(t,e,r=!1){return!e.length||e.some(o=>o==="array"?Array.isArray(t):o==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==o||r&&typeof t>"u")}Ve.validSchemaType=Kv;function Gv({schema:t,opts:e,self:r,errSchemaPath:o},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");let i=n.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ve.validateKeywordUsage=Gv});var Cp=b(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.extendSubschemaMode=ft.extendSubschemaData=ft.getSubschema=void 0;var Je=I(),jp=q();function Yv(t,{keyword:e,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}${(0,Je.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,jp.escapeFragment)(r)}`}}if(o!==void 0){if(n===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ft.getSubschema=Yv;function Qv(t,e,{dataProp:r,dataPropType:o,data:n,dataTypes:s,propertyName:i}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,p=a.let("data",(0,Je._)`${e.data}${(0,Je.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Je.str)`${u}${(0,jp.getErrorPath)(r,o,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Je._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let u=n instanceof Je.Name?n:a.let("data",n,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}ft.extendSubschemaData=Qv;function Xv(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:s}){o!==void 0&&(t.compositeRule=o),n!==void 0&&(t.createErrors=n),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ft.extendSubschemaMode=Xv});var ki=b((nR,Dp)=>{"use strict";Dp.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,n,s;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),o=s.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=o;n--!==0;){var i=s[n];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Mp=b((sR,qp)=>{"use strict";var mt=qp.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};on(e,o,n,t,"",t)};mt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mt.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 on(t,e,r,o,n,s,i,a,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){e(o,n,s,i,a,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in mt.arrayKeywords)for(var p=0;p<d.length;p++)on(t,e,r,d[p],n+"/"+l+"/"+p,s,n,l,o,p)}else if(l in mt.propsKeywords){if(d&&typeof d=="object")for(var f in d)on(t,e,r,d[f],n+"/"+l+"/"+eb(f),s,n,l,o,f)}else(l in mt.keywords||t.allKeys&&!(l in mt.skipKeywords))&&on(t,e,r,d,n+"/"+l,s,n,l,o)}r(o,n,s,i,a,c,u)}}function eb(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Jr=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.getSchemaRefs=we.resolveUrl=we.normalizeId=we._getFullPath=we.getFullPath=we.inlineRef=void 0;var tb=q(),rb=ki(),ob=Mp(),nb=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sb(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Si(t):e?Lp(t)<=e:!1}we.inlineRef=sb;var ib=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Si(t){for(let e in t){if(ib.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Si)||typeof r=="object"&&Si(r))return!0}return!1}function Lp(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!nb.has(r)&&(typeof t[r]=="object"&&(0,tb.eachItem)(t[r],o=>e+=Lp(o)),e===1/0))return 1/0}return e}function Up(t,e="",r){r!==!1&&(e=Wt(e));let o=t.parse(e);return Fp(t,o)}we.getFullPath=Up;function Fp(t,e){return t.serialize(e).split("#")[0]+"#"}we._getFullPath=Fp;var ab=/#\/?$/;function Wt(t){return t?t.replace(ab,""):""}we.normalizeId=Wt;function cb(t,e,r){return r=Wt(r),t.resolve(e,r)}we.resolveUrl=cb;var ub=/^[a-z_][-a-z0-9._]*$/i;function lb(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=Wt(t[r]||e),s={"":n},i=Up(o,n,!1),a={},c=new Set;return ob(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let _=i+p,y=s[m];typeof d[r]=="string"&&(y=v.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),s[p]=y;function v(x){let S=this.opts.uriResolver.resolve;if(x=Wt(y?S(y,x):x),c.has(x))throw l(x);c.add(x);let w=this.refs[x];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?u(d,w.schema,x):x!==Wt(_)&&(x[0]==="#"?(u(d,a[x],x),a[x]=d):this.refs[x]=_),x}function P(x){if(typeof x=="string"){if(!ub.test(x))throw new Error(`invalid anchor "${x}"`);v.call(this,`#${x}`)}}}),a;function u(d,p,f){if(p!==void 0&&!rb(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}we.getSchemaRefs=lb});var Wr=b(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.getData=ht.KeywordCxt=ht.validateFunctionCode=void 0;var Wp=xp(),Vp=Vr(),Ei=yi(),nn=Vr(),db=Rp(),Br=Zp(),Pi=Cp(),k=I(),T=tt(),pb=Jr(),rt=q(),Hr=Fr();function fb(t){if(Yp(t)&&(Qp(t),Gp(t))){gb(t);return}Kp(t,()=>(0,Wp.topBoolOrEmptySchema)(t))}ht.validateFunctionCode=fb;function Kp({gen:t,validateName:e,schema:r,schemaEnv:o,opts:n},s){n.code.es5?t.func(e,(0,k._)`${T.default.data}, ${T.default.valCxt}`,o.$async,()=>{t.code((0,k._)`"use strict"; ${Jp(r,n)}`),hb(t,n),t.code(s)}):t.func(e,(0,k._)`${T.default.data}, ${mb(n)}`,o.$async,()=>t.code(Jp(r,n)).code(s))}function mb(t){return(0,k._)`{${T.default.instancePath}="", ${T.default.parentData}, ${T.default.parentDataProperty}, ${T.default.rootData}=${T.default.data}${t.dynamicRef?(0,k._)`, ${T.default.dynamicAnchors}={}`:k.nil}}={}`}function hb(t,e){t.if(T.default.valCxt,()=>{t.var(T.default.instancePath,(0,k._)`${T.default.valCxt}.${T.default.instancePath}`),t.var(T.default.parentData,(0,k._)`${T.default.valCxt}.${T.default.parentData}`),t.var(T.default.parentDataProperty,(0,k._)`${T.default.valCxt}.${T.default.parentDataProperty}`),t.var(T.default.rootData,(0,k._)`${T.default.valCxt}.${T.default.rootData}`),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,k._)`${T.default.valCxt}.${T.default.dynamicAnchors}`)},()=>{t.var(T.default.instancePath,(0,k._)`""`),t.var(T.default.parentData,(0,k._)`undefined`),t.var(T.default.parentDataProperty,(0,k._)`undefined`),t.var(T.default.rootData,T.default.data),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,k._)`{}`)})}function gb(t){let{schema:e,opts:r,gen:o}=t;Kp(t,()=>{r.$comment&&e.$comment&&ef(t),$b(t),o.let(T.default.vErrors,null),o.let(T.default.errors,0),r.unevaluated&&_b(t),Xp(t),zb(t)})}function _b(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,k._)`${r}.evaluated`),e.if((0,k._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,k._)`${t.evaluated}.props`,(0,k._)`undefined`)),e.if((0,k._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,k._)`${t.evaluated}.items`,(0,k._)`undefined`))}function Jp(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,k._)`/*# sourceURL=${r} */`:k.nil}function yb(t,e){if(Yp(t)&&(Qp(t),Gp(t))){vb(t,e);return}(0,Wp.boolOrEmptySchema)(t,e)}function Gp({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Yp(t){return typeof t.schema!="boolean"}function vb(t,e){let{schema:r,gen:o,opts:n}=t;n.$comment&&r.$comment&&ef(t),wb(t),xb(t);let s=o.const("_errs",T.default.errors);Xp(t,s),o.var(e,(0,k._)`${s} === ${T.default.errors}`)}function Qp(t){(0,rt.checkUnknownRules)(t),bb(t)}function Xp(t,e){if(t.opts.jtd)return Hp(t,[],!1,e);let r=(0,Vp.getSchemaTypes)(t.schema),o=(0,Vp.coerceAndCheckDataType)(t,r);Hp(t,r,!o,e)}function bb(t){let{schema:e,errSchemaPath:r,opts:o,self:n}=t;e.$ref&&o.ignoreKeywordsWithRef&&(0,rt.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function $b(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,rt.checkStrictMode)(t,"default is ignored in the schema root")}function wb(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,pb.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function xb(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ef({gen:t,schemaEnv:e,schema:r,errSchemaPath:o,opts:n}){let s=r.$comment;if(n.$comment===!0)t.code((0,k._)`${T.default.self}.logger.log(${s})`);else if(typeof n.$comment=="function"){let i=(0,k.str)`${o}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,k._)`${T.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function zb(t){let{gen:e,schemaEnv:r,validateName:o,ValidationError:n,opts:s}=t;r.$async?e.if((0,k._)`${T.default.errors} === 0`,()=>e.return(T.default.data),()=>e.throw((0,k._)`new ${n}(${T.default.vErrors})`)):(e.assign((0,k._)`${o}.errors`,T.default.vErrors),s.unevaluated&&kb(t),e.return((0,k._)`${T.default.errors} === 0`))}function kb({gen:t,evaluated:e,props:r,items:o}){r instanceof k.Name&&t.assign((0,k._)`${e}.props`,r),o instanceof k.Name&&t.assign((0,k._)`${e}.items`,o)}function Hp(t,e,r,o){let{gen:n,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,rt.schemaHasRulesButRef)(s,l))){n.block(()=>rf(t,"$ref",l.all.$ref.definition));return}c.jtd||Sb(t,e),n.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Ei.shouldUseGroup)(s,p)&&(p.type?(n.if((0,nn.checkDataType)(p.type,i,c.strictNumbers)),Bp(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,nn.reportTypeError)(t)),n.endIf()):Bp(t,p),a||n.if((0,k._)`${T.default.errors} === ${o||0}`))}}function Bp(t,e){let{gen:r,schema:o,opts:{useDefaults:n}}=t;n&&(0,db.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Ei.shouldUseRule)(o,s)&&rf(t,s.keyword,s.definition,e.type)})}function Sb(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Pb(t,e),t.opts.allowUnionTypes||Eb(t,e),Tb(t,t.dataTypes))}function Pb(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{tf(t.dataTypes,r)||Ti(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Ob(t,e)}}function Eb(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ti(t,"use allowUnionTypes to allow union type keyword")}function Tb(t,e){let r=t.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&(0,Ei.shouldUseRule)(t.schema,n)){let{type:s}=n.definition;s.length&&!s.some(i=>Rb(e,i))&&Ti(t,`missing type "${s.join(",")}" for keyword "${o}"`)}}}function Rb(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function tf(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Ob(t,e){let r=[];for(let o of t.dataTypes)tf(e,o)?r.push(o):e.includes("integer")&&o==="number"&&r.push("integer");t.dataTypes=r}function Ti(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,rt.checkStrictMode)(t,e,t.opts.strictTypes)}var sn=class{constructor(e,r,o){if((0,Br.validateKeywordUsage)(e,r,o),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=o,this.data=e.data,this.schema=e.schema[o],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,rt.schemaRefOrVal)(e,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",of(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Br.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",T.default.errors))}result(e,r,o){this.failResult((0,k.not)(e),r,o)}failResult(e,r,o){this.gen.if(e),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,k.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,k._)`${r} !== undefined && (${(0,k.or)(this.invalid$data(),e)})`)}error(e,r,o){if(r){this.setParams(r),this._error(e,o),this.setParams({});return}this._error(e,o)}_error(e,r){(e?Hr.reportExtraError:Hr.reportError)(this,this.def.error,r)}$dataError(){(0,Hr.reportError)(this,this.def.$dataError||Hr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Hr.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,o=k.nil){this.gen.block(()=>{this.check$data(e,o),r()})}check$data(e=k.nil,r=k.nil){if(!this.$data)return;let{gen:o,schemaCode:n,schemaType:s,def:i}=this;o.if((0,k.or)((0,k._)`${n} === undefined`,r)),e!==k.nil&&o.assign(e,!0),(s.length||i.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),e!==k.nil&&o.assign(e,!1)),o.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:o,def:n,it:s}=this;return(0,k.or)(i(),a());function i(){if(o.length){if(!(r instanceof k.Name))throw new Error("ajv implementation error");let c=Array.isArray(o)?o:[o];return(0,k._)`${(0,nn.checkDataTypes)(c,r,s.opts.strictNumbers,nn.DataType.Wrong)}`}return k.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,k._)`!${c}(${r})`}return k.nil}}subschema(e,r){let o=(0,Pi.getSubschema)(this.it,e);(0,Pi.extendSubschemaData)(o,this.it,e),(0,Pi.extendSubschemaMode)(o,e);let n={...this.it,...o,items:void 0,props:void 0};return yb(n,r),n}mergeEvaluated(e,r){let{it:o,gen:n}=this;o.opts.unevaluated&&(o.props!==!0&&e.props!==void 0&&(o.props=rt.mergeEvaluated.props(n,e.props,o.props,r)),o.items!==!0&&e.items!==void 0&&(o.items=rt.mergeEvaluated.items(n,e.items,o.items,r)))}mergeValidEvaluated(e,r){let{it:o,gen:n}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,k.Name)),!0}};ht.KeywordCxt=sn;function rf(t,e,r,o){let n=new sn(t,r,e);"code"in r?r.code(n,o):n.$data&&r.validate?(0,Br.funcKeywordCode)(n,r):"macro"in r?(0,Br.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Br.funcKeywordCode)(n,r)}var Ib=/^\/(?:[^~]|~0|~1)*$/,Nb=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function of(t,{dataLevel:e,dataNames:r,dataPathArr:o}){let n,s;if(t==="")return T.default.rootData;if(t[0]==="/"){if(!Ib.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,s=T.default.rootData}else{let u=Nb.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=e)throw new Error(c("property/index",l));return o[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!n)return s}let i=s,a=n.split("/");for(let u of a)u&&(s=(0,k._)`${s}${(0,k.getProperty)((0,rt.unescapeJsonPointer)(u))}`,i=(0,k._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}ht.getData=of});var an=b(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var Ri=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Oi.default=Ri});var Kr=b(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var Ii=Jr(),Ni=class extends Error{constructor(e,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,Ii.resolveUrl)(e,r,o),this.missingSchema=(0,Ii.normalizeId)((0,Ii.getFullPath)(e,this.missingRef))}};Ai.default=Ni});var un=b(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.resolveSchema=Ae.getCompilingSchema=Ae.resolveRef=Ae.compileSchema=Ae.SchemaEnv=void 0;var qe=I(),Ab=an(),St=tt(),Me=Jr(),nf=q(),Zb=Wr(),Kt=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let o;typeof e.schema=="object"&&(o=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Me.normalizeId)(o?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=o?.$async,this.refs={}}};Ae.SchemaEnv=Kt;function ji(t){let e=sf.call(this,t);if(e)return e;let r=(0,Me.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:s}=this.opts,i=new qe.CodeGen(this.scope,{es5:o,lines:n,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:Ab.default,code:(0,qe._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:St.default.data,parentData:St.default.parentData,parentDataProperty:St.default.parentDataProperty,dataNames:[St.default.data],dataPathArr:[qe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,qe.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:qe.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,qe._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Zb.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(St.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${St.default.self}`,`${St.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:m,items:_}=u;f.evaluated={props:m instanceof qe.Name?void 0:m,items:_ instanceof qe.Name?void 0:_,dynamicProps:m instanceof qe.Name,dynamicItems:_ instanceof qe.Name},f.source&&(f.source.evaluated=(0,qe.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}Ae.compileSchema=ji;function jb(t,e,r){var o;r=(0,Me.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let s=qb.call(this,t,r);if(s===void 0){let i=(o=t.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;i&&(s=new Kt({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=Cb.call(this,s)}Ae.resolveRef=jb;function Cb(t){return(0,Me.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ji.call(this,t)}function sf(t){for(let e of this._compilations)if(Db(e,t))return e}Ae.getCompilingSchema=sf;function Db(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function qb(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||cn.call(this,t,e)}function cn(t,e){let r=this.opts.uriResolver.parse(e),o=(0,Me._getFullPath)(this.opts.uriResolver,r),n=(0,Me.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===n)return Zi.call(this,r,t);let s=(0,Me.normalizeId)(o),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=cn.call(this,t,i);return typeof a?.schema!="object"?void 0:Zi.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||ji.call(this,i),s===(0,Me.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(n=(0,Me.resolveUrl)(this.opts.uriResolver,n,u)),new Kt({schema:a,schemaId:c,root:t,baseId:n})}return Zi.call(this,r,i)}}Ae.resolveSchema=cn;var Mb=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Zi(t,{baseId:e,schema:r,root:o}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,nf.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Mb.has(a)&&u&&(e=(0,Me.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,nf.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Me.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=cn.call(this,o,a)}let{schemaId:i}=this.opts;if(s=s||new Kt({schema:r,schemaId:i,root:o,baseId:e}),s.schema!==s.root.schema)return s}});var af=b((dR,Lb)=>{Lb.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 qi=b((pR,ff)=>{"use strict";var Ub=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uf=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),Ci=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),lf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Fb=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Di(t){let e="",r=0,o=0;for(o=0;o<t.length;o++)if(r=t[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o];break}for(o+=1;o<t.length;o++){if(r=t[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o]}return e}var Vb=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cf(t){return t.length=0,!0}function Jb(t,e,r){if(t.length){let o=Di(t);if(o!=="")e.push(o);else return r.error=!0,!1;t.length=0}return!0}function Hb(t){let e=0,r={error:!1,address:"",zone:""},o=[],n=[],s=!1,i=!1,a=Jb;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(n,o,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),o.push(":");continue}else if(u==="%"){if(!a(n,o,r))break;a=cf}else{n.push(u);continue}}return n.length&&(a===cf?r.zone=n.join(""):i?o.push(n.join("")):o.push(Di(n))),r.address=o.join(""),r}function df(t){if(Bb(t,":")<2)return{host:t,isIPV6:!1};let e=Hb(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,o=e.address;return e.zone&&(r+="%"+e.zone,o+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:o}}}function Bb(t,e){let r=0;for(let o=0;o<t.length;o++)t[o]===e&&r++;return r}function Wb(t){let e=t,r=[],o=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((o=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,o)),e=e.slice(o)}return r.join("")}var Kb={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gb=/[@/?#:]/g,Yb=/[@/?#]/g;function pf(t,e){let r=e?Yb:Gb;return r.lastIndex=0,t.replace(r,o=>Kb[o])}function Qb(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let n=t.slice(o+1,o+3);if(Ci(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&lf(i)?r+=i:r+="%"+s,o+=2;continue}}r+=t[o]}return r}function Xb(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Ci(o)){let n=o.toUpperCase(),s=String.fromCharCode(parseInt(n,16));s!=="."&&lf(s)?e+=s:e+="%"+n,r+=2;continue}}Fb(t[r])?e+=t[r]:e+=escape(t[r])}return e}function e$(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Ci(o)){e+="%"+o.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function t$(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!uf(r)){let o=df(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=pf(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ff.exports={nonSimpleDomain:Vb,recomposeAuthority:t$,reescapeHostDelimiters:pf,normalizePercentEncoding:Qb,normalizePathEncoding:Xb,escapePreservingEscapes:e$,removeDotSegments:Wb,isIPv4:uf,isUUID:Ub,normalizeIPv6:df,stringArrayToHexStripped:Di}});var yf=b((fR,_f)=>{"use strict";var{isUUID:r$}=qi(),o$=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n$=["http","https","ws","wss","urn","urn:uuid"];function s$(t){return n$.indexOf(t)!==-1}function Mi(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function mf(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function hf(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function i$(t){return t.secure=Mi(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function a$(t){if((t.port===(Mi(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function c$(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(o$);if(r){let o=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${o}:${e.nid||t.nid}`,s=Li(n);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function u$(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",o=t.nid.toLowerCase(),n=`${r}:${e.nid||o}`,s=Li(n);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${o||e.nid}:${a}`,e.skipEscape=!0,i}function l$(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!r$(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function d$(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var gf={scheme:"http",domainHost:!0,parse:mf,serialize:hf},p$={scheme:"https",domainHost:gf.domainHost,parse:mf,serialize:hf},ln={scheme:"ws",domainHost:!0,parse:i$,serialize:a$},f$={scheme:"wss",domainHost:ln.domainHost,parse:ln.parse,serialize:ln.serialize},m$={scheme:"urn",parse:c$,serialize:u$,skipNormalize:!0},h$={scheme:"urn:uuid",parse:l$,serialize:d$,skipNormalize:!0},dn={http:gf,https:p$,ws:ln,wss:f$,urn:m$,"urn:uuid":h$};Object.setPrototypeOf(dn,null);function Li(t){return t&&(dn[t]||dn[t.toLowerCase()])||void 0}_f.exports={wsIsSecure:Mi,SCHEMES:dn,isValidSchemeName:s$,getSchemeHandler:Li}});var zf=b((mR,pn)=>{"use strict";var{normalizeIPv6:g$,removeDotSegments:Gr,recomposeAuthority:_$,normalizePercentEncoding:y$,normalizePathEncoding:v$,escapePreservingEscapes:b$,reescapeHostDelimiters:$$,isIPv4:w$,nonSimpleDomain:x$}=qi(),{SCHEMES:z$,getSchemeHandler:bf}=yf();function k$(t,e){return typeof t=="string"?t=R$(t,e):typeof t=="object"&&(t=Gt(Pt(t,e),e)),t}function S$(t,e,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=$f(Gt(t,o),Gt(e,o),o,!0);return o.skipEscape=!0,Pt(n,o)}function $f(t,e,r,o){let n={};return o||(t=Gt(Pt(t,r),r),e=Gt(Pt(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Gr(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Gr(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Gr(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Gr(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function P$(t,e,r){let o=vf(t,r),n=vf(e,r);return o!==void 0&&n!==void 0&&o.toLowerCase()===n.toLowerCase()}function Pt(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},o=Object.assign({},e),n=[],s=bf(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=y$(r.path):(r.path=b$(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let i=_$(r);if(i!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(i),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(a=Gr(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var E$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function T$(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function wf(t,e){let r=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(E$);if(i){o.scheme=i[1],o.userinfo=i[3],o.host=i[4],o.port=parseInt(i[5],10),o.path=i[6]||"",o.query=i[7],o.fragment=i[8],isNaN(o.port)&&(o.port=i[5]);let a=T$(o,i);if(a!==void 0&&(o.error=o.error||a,n=!0),o.host)if(w$(o.host)===!1){let l=g$(o.host);o.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let c=bf(r.scheme||o.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&x$(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(u){o.error=o.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=$$(unescape(o.host),s))),o.path&&(o.path=v$(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}c&&c.parse&&c.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:n}}function Gt(t,e){return wf(t,e).parsed}function R$(t,e){return xf(t,e).normalized}function xf(t,e){let{parsed:r,malformedAuthorityOrPort:o}=wf(t,e);return{normalized:o?t:Pt(r,e),malformedAuthorityOrPort:o}}function vf(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:o}=xf(t,e);return o?void 0:r}if(typeof t=="object")return Pt(t,e)}var Ui={SCHEMES:z$,normalize:k$,resolve:S$,resolveComponent:$f,equal:P$,serialize:Pt,parse:Gt};pn.exports=Ui;pn.exports.default=Ui;pn.exports.fastUri=Ui});var Sf=b(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var kf=zf();kf.code='require("ajv/dist/runtime/uri").default';Fi.default=kf});var Af=b(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.CodeGen=le.Name=le.nil=le.stringify=le.str=le._=le.KeywordCxt=void 0;var O$=Wr();Object.defineProperty(le,"KeywordCxt",{enumerable:!0,get:function(){return O$.KeywordCxt}});var Yt=I();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return Yt._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return Yt.str}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return Yt.stringify}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return Yt.nil}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return Yt.Name}});Object.defineProperty(le,"CodeGen",{enumerable:!0,get:function(){return Yt.CodeGen}});var I$=an(),Of=Kr(),N$=_i(),Yr=un(),A$=I(),Qr=Jr(),fn=Vr(),Ji=q(),Pf=af(),Z$=Sf(),If=(t,e)=>new RegExp(t,e);If.code="new RegExp";var j$=["removeAdditional","useDefaults","coerceTypes"],C$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),D$={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."},q$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ef=200;function M$(t){var e,r,o,n,s,i,a,c,u,l,d,p,f,m,_,y,v,P,x,S,w,ze,Ee,ir,An;let ar=t.strict,Zn=(e=t.code)===null||e===void 0?void 0:e.optimize,Fa=Zn===!0||Zn===void 0?1:Zn||0,Va=(o=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:If,sh=(n=t.uriResolver)!==null&&n!==void 0?n:Z$.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:ar)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ar)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:ar)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ar)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:ar)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:Fa,regExp:Va}:{optimize:Fa,regExp:Va},loopRequired:(_=t.loopRequired)!==null&&_!==void 0?_:Ef,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:Ef,meta:(v=t.meta)!==null&&v!==void 0?v:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(x=t.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(ze=t.validateSchema)!==null&&ze!==void 0?ze:!0,validateFormats:(Ee=t.validateFormats)!==null&&Ee!==void 0?Ee:!0,unicodeRegExp:(ir=t.unicodeRegExp)!==null&&ir!==void 0?ir:!0,int32range:(An=t.int32range)!==null&&An!==void 0?An:!0,uriResolver:sh}}var Xr=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...M$(e)};let{es5:r,lines:o}=this.opts.code;this.scope=new A$.ValueScope({scope:{},prefixes:C$,es5:r,lines:o}),this.logger=H$(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,N$.getRules)(),Tf.call(this,D$,e,"NOT SUPPORTED"),Tf.call(this,q$,e,"DEPRECATED","warn"),this._metaOpts=V$.call(this),e.formats&&U$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&F$.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),L$.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:o}=this.opts,n=Pf;o==="id"&&(n={...Pf},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[o],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let o;if(typeof e=="string"){if(o=this.getSchema(e),!o)throw new Error(`no schema with key or ref "${e}"`)}else o=this.compile(e);let n=o(r);return"$async"in o||(this.errors=o.errors),n}compile(e,r){let o=this._addSchema(e,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return n.call(this,e,r);async function n(l,d){await s.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||i.call(this,p)}async function s(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Of.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.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 s.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]=o(l))}finally{delete this._loading[l]}}}addSchema(e,r,o,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,o,n);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,Qr.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,o,r,n,!0),this}addMetaSchema(e,r,o=this.opts.validateSchema){return this.addSchema(e,r,!0,o),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let o;if(o=e.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(o,e);if(!n&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return n}getSchema(e){let r;for(;typeof(r=Rf.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:o}=this.opts,n=new Yr.SchemaEnv({schema:{},schemaId:o});if(r=Yr.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Rf.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let o=e[this.opts.schemaId];return o&&(o=(0,Qr.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let o;if(typeof e=="string")o=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if(typeof e=="object"&&r===void 0){if(r=e,o=r.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W$.call(this,o,r),!r)return(0,Ji.eachItem)(o,s=>Vi.call(this,s)),this;G$.call(this,r);let n={...r,type:(0,fn.getJSONTypes)(r.type),schemaType:(0,fn.getJSONTypes)(r.schemaType)};return(0,Ji.eachItem)(o,n.type.length===0?s=>Vi.call(this,s,n):s=>n.type.forEach(i=>Vi.call(this,s,n,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let o of r.rules){let n=o.rules.findIndex(s=>s.keyword===e);n>=0&&o.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:o="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${o}${n.instancePath} ${n.message}`).reduce((n,s)=>n+r+s)}$dataMetaSchema(e,r){let o=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let s=n.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in o){let c=o[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=Nf(l))}}return e}_removeAllSchemas(e,r){for(let o in e){let n=e[o];(!r||r.test(o))&&(typeof n=="string"?delete e[o]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[o]))}}_addSchema(e,r,o,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;o=(0,Qr.normalizeId)(i||o);let u=Qr.getSchemaRefs.call(this,e,o);return c=new Yr.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:o,localRefs:u}),this._cache.set(c.schema,c),s&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Yr.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Yr.compileSchema.call(this,e)}finally{this.opts=r}}};Xr.ValidationError=I$.default;Xr.MissingRefError=Of.default;le.default=Xr;function Tf(t,e,r,o="error"){for(let n in t){let s=n;s in e&&this.logger[o](`${r}: option ${n}. ${t[s]}`)}}function Rf(t){return t=(0,Qr.normalizeId)(t),this.schemas[t]||this.refs[t]}function L$(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function U$(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function F$(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function V$(){let t={...this.opts};for(let e of j$)delete t[e];return t}var J$={log(){},warn(){},error(){}};function H$(t){if(t===!1)return J$;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var B$=/^[a-z_$][a-z0-9_$:-]*$/i;function W$(t,e){let{RULES:r}=this;if((0,Ji.eachItem)(t,o=>{if(r.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!B$.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Vi(t,e,r){var o;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=n?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,fn.getJSONTypes)(e.type),schemaType:(0,fn.getJSONTypes)(e.schemaType)}};e.before?K$.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(o=e.implements)===null||o===void 0||o.forEach(c=>this.addKeyword(c))}function K$(t,e,r){let o=t.rules.findIndex(n=>n.keyword===r);o>=0?t.rules.splice(o,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function G$(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Nf(e)),t.validateSchema=this.compile(e,!0))}var Y$={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Nf(t){return{anyOf:[t,Y$]}}});var Zf=b(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var Q$={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Hi.default=Q$});var qf=b(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.callRef=Et.getValidate=void 0;var X$=Kr(),jf=Ne(),xe=I(),Qt=tt(),Cf=un(),mn=q(),e0={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:o}=t,{baseId:n,schemaEnv:s,validateName:i,opts:a,self:c}=o,{root:u}=s;if((r==="#"||r==="#/")&&n===u.baseId)return d();let l=Cf.resolveRef.call(c,u,n,r);if(l===void 0)throw new X$.default(o.opts.uriResolver,n,r);if(l instanceof Cf.SchemaEnv)return p(l);return f(l);function d(){if(s===u)return hn(t,i,s,s.$async);let m=e.scopeValue("root",{ref:u});return hn(t,(0,xe._)`${m}.validate`,u,u.$async)}function p(m){let _=Df(t,m);hn(t,_,m,m.$async)}function f(m){let _=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,xe.stringify)(m)}:{ref:m}),y=e.name("valid"),v=t.subschema({schema:m,dataTypes:[],schemaPath:xe.nil,topSchemaRef:_,errSchemaPath:r},y);t.mergeEvaluated(v),t.ok(y)}}};function Df(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,xe._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Et.getValidate=Df;function hn(t,e,r,o){let{gen:n,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?Qt.default.this:xe.nil;o?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,xe._)`await ${(0,jf.callValidateCode)(t,e,u)}`),f(e),i||n.assign(m,!0)},_=>{n.if((0,xe._)`!(${_} instanceof ${s.ValidationError})`,()=>n.throw(_)),p(_),i||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,jf.callValidateCode)(t,e,u),()=>f(e),()=>p(e))}function p(m){let _=(0,xe._)`${m}.errors`;n.assign(Qt.default.vErrors,(0,xe._)`${Qt.default.vErrors} === null ? ${_} : ${Qt.default.vErrors}.concat(${_})`),n.assign(Qt.default.errors,(0,xe._)`${Qt.default.vErrors}.length`)}function f(m){var _;if(!s.opts.unevaluated)return;let y=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=mn.mergeEvaluated.props(n,y.props,s.props));else{let v=n.var("props",(0,xe._)`${m}.evaluated.props`);s.props=mn.mergeEvaluated.props(n,v,s.props,xe.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=mn.mergeEvaluated.items(n,y.items,s.items));else{let v=n.var("items",(0,xe._)`${m}.evaluated.items`);s.items=mn.mergeEvaluated.items(n,v,s.items,xe.Name)}}}Et.callRef=hn;Et.default=e0});var Mf=b(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var t0=Zf(),r0=qf(),o0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t0.default,r0.default];Bi.default=o0});var Lf=b(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var gn=I(),gt=gn.operators,_n={maximum:{okStr:"<=",ok:gt.LTE,fail:gt.GT},minimum:{okStr:">=",ok:gt.GTE,fail:gt.LT},exclusiveMaximum:{okStr:"<",ok:gt.LT,fail:gt.GTE},exclusiveMinimum:{okStr:">",ok:gt.GT,fail:gt.LTE}},n0={message:({keyword:t,schemaCode:e})=>(0,gn.str)`must be ${_n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,gn._)`{comparison: ${_n[t].okStr}, limit: ${e}}`},s0={keyword:Object.keys(_n),type:"number",schemaType:"number",$data:!0,error:n0,code(t){let{keyword:e,data:r,schemaCode:o}=t;t.fail$data((0,gn._)`${r} ${_n[e].fail} ${o} || isNaN(${r})`)}};Wi.default=s0});var Uf=b(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var eo=I(),i0={message:({schemaCode:t})=>(0,eo.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,eo._)`{multipleOf: ${t}}`},a0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:i0,code(t){let{gen:e,data:r,schemaCode:o,it:n}=t,s=n.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,eo._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,eo._)`${i} !== parseInt(${i})`;t.fail$data((0,eo._)`(${o} === 0 || (${i} = ${r}/${o}, ${a}))`)}};Ki.default=a0});var Vf=b(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});function Ff(t){let e=t.length,r=0,o=0,n;for(;o<e;)r++,n=t.charCodeAt(o++),n>=55296&&n<=56319&&o<e&&(n=t.charCodeAt(o),(n&64512)===56320&&o++);return r}Gi.default=Ff;Ff.code='require("ajv/dist/runtime/ucs2length").default'});var Jf=b(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Tt=I(),c0=q(),u0=Vf(),l0={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Tt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Tt._)`{limit: ${t}}`},d0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:l0,code(t){let{keyword:e,data:r,schemaCode:o,it:n}=t,s=e==="maxLength"?Tt.operators.GT:Tt.operators.LT,i=n.opts.unicode===!1?(0,Tt._)`${r}.length`:(0,Tt._)`${(0,c0.useFunc)(t.gen,u0.default)}(${r})`;t.fail$data((0,Tt._)`${i} ${s} ${o}`)}};Yi.default=d0});var Hf=b(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var p0=Ne(),f0=q(),Xt=I(),m0={message:({schemaCode:t})=>(0,Xt.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{pattern: ${t}}`},h0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:m0,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(o){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,Xt._)`new RegExp`:(0,f0.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Xt._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Xt._)`!${l}`)}else{let c=(0,p0.usePattern)(t,n);t.fail$data((0,Xt._)`!${c}.test(${r})`)}}};Qi.default=h0});var Bf=b(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var to=I(),g0={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,to.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,to._)`{limit: ${t}}`},_0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:g0,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxProperties"?to.operators.GT:to.operators.LT;t.fail$data((0,to._)`Object.keys(${r}).length ${n} ${o}`)}};Xi.default=_0});var Wf=b(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var ro=Ne(),oo=I(),y0=q(),v0={message:({params:{missingProperty:t}})=>(0,oo.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,oo._)`{missingProperty: ${t}}`},b0={keyword:"required",type:"object",schemaType:"array",$data:!0,error:v0,code(t){let{gen:e,schema:r,schemaCode:o,data:n,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let _ of r)if(f?.[_]===void 0&&!m.has(_)){let y=i.schemaEnv.baseId+i.errSchemaPath,v=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,y0.checkStrictMode)(i,v,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(oo.nil,d);else for(let f of r)(0,ro.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(c||s){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,ro.checkMissingProp)(t,r,f)),(0,ro.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",o,f=>{t.setParams({missingProperty:f}),e.if((0,ro.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,o,()=>{e.assign(m,(0,ro.propertyInData)(e,n,f,a.ownProperties)),e.if((0,oo.not)(m),()=>{t.error(),e.break()})},oo.nil)}}};ea.default=b0});var Kf=b(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var no=I(),$0={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,no.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,no._)`{limit: ${t}}`},w0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$0,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxItems"?no.operators.GT:no.operators.LT;t.fail$data((0,no._)`${r}.length ${n} ${o}`)}};ta.default=w0});var yn=b(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var Gf=ki();Gf.code='require("ajv/dist/runtime/equal").default';ra.default=Gf});var Yf=b(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var oa=Vr(),de=I(),x0=q(),z0=yn(),k0={message:({params:{i:t,j:e}})=>(0,de.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,de._)`{i: ${t}, j: ${e}}`},S0={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:k0,code(t){let{gen:e,data:r,$data:o,schema:n,parentSchema:s,schemaCode:i,it:a}=t;if(!o&&!n)return;let c=e.let("valid"),u=s.items?(0,oa.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,de._)`${i} === false`),t.ok(c);function l(){let m=e.let("i",(0,de._)`${r}.length`),_=e.let("j");t.setParams({i:m,j:_}),e.assign(c,!0),e.if((0,de._)`${m} > 1`,()=>(d()?p:f)(m,_))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function p(m,_){let y=e.name("item"),v=(0,oa.checkDataTypes)(u,y,a.opts.strictNumbers,oa.DataType.Wrong),P=e.const("indices",(0,de._)`{}`);e.for((0,de._)`;${m}--;`,()=>{e.let(y,(0,de._)`${r}[${m}]`),e.if(v,(0,de._)`continue`),u.length>1&&e.if((0,de._)`typeof ${y} == "string"`,(0,de._)`${y} += "_"`),e.if((0,de._)`typeof ${P}[${y}] == "number"`,()=>{e.assign(_,(0,de._)`${P}[${y}]`),t.error(),e.assign(c,!1).break()}).code((0,de._)`${P}[${y}] = ${m}`)})}function f(m,_){let y=(0,x0.useFunc)(e,z0.default),v=e.name("outer");e.label(v).for((0,de._)`;${m}--;`,()=>e.for((0,de._)`${_} = ${m}; ${_}--;`,()=>e.if((0,de._)`${y}(${r}[${m}], ${r}[${_}])`,()=>{t.error(),e.assign(c,!1).break(v)})))}}};na.default=S0});var Qf=b(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var sa=I(),P0=q(),E0=yn(),T0={message:"must be equal to constant",params:({schemaCode:t})=>(0,sa._)`{allowedValue: ${t}}`},R0={keyword:"const",$data:!0,error:T0,code(t){let{gen:e,data:r,$data:o,schemaCode:n,schema:s}=t;o||s&&typeof s=="object"?t.fail$data((0,sa._)`!${(0,P0.useFunc)(e,E0.default)}(${r}, ${n})`):t.fail((0,sa._)`${s} !== ${r}`)}};ia.default=R0});var Xf=b(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var so=I(),O0=q(),I0=yn(),N0={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,so._)`{allowedValues: ${t}}`},A0={keyword:"enum",schemaType:"array",$data:!0,error:N0,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t;if(!o&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,O0.useFunc)(e,I0.default)),l;if(a||o)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",s);l=(0,so.or)(...n.map((m,_)=>p(f,_)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,f=>e.if((0,so._)`${u()}(${r}, ${f})`,()=>e.assign(l,!0).break()))}function p(f,m){let _=n[m];return typeof _=="object"&&_!==null?(0,so._)`${u()}(${r}, ${f}[${m}])`:(0,so._)`${r} === ${_}`}}};aa.default=A0});var em=b(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var Z0=Lf(),j0=Uf(),C0=Jf(),D0=Hf(),q0=Bf(),M0=Wf(),L0=Kf(),U0=Yf(),F0=Qf(),V0=Xf(),J0=[Z0.default,j0.default,C0.default,D0.default,q0.default,M0.default,L0.default,U0.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},F0.default,V0.default];ca.default=J0});var la=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.validateAdditionalItems=void 0;var Rt=I(),ua=q(),H0={message:({params:{len:t}})=>(0,Rt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Rt._)`{limit: ${t}}`},B0={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:H0,code(t){let{parentSchema:e,it:r}=t,{items:o}=e;if(!Array.isArray(o)){(0,ua.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}tm(t,o)}};function tm(t,e){let{gen:r,schema:o,data:n,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Rt._)`${n}.length`);if(o===!1)t.setParams({len:e.length}),t.pass((0,Rt._)`${a} <= ${e.length}`);else if(typeof o=="object"&&!(0,ua.alwaysValidSchema)(i,o)){let u=r.var("valid",(0,Rt._)`${a} <= ${e.length}`);r.if((0,Rt.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:ua.Type.Num},u),i.allErrors||r.if((0,Rt.not)(u),()=>r.break())})}}io.validateAdditionalItems=tm;io.default=B0});var da=b(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.validateTuple=void 0;var rm=I(),vn=q(),W0=Ne(),K0={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return om(t,"additionalItems",e);r.items=!0,!(0,vn.alwaysValidSchema)(r,e)&&t.ok((0,W0.validateArray)(t))}};function om(t,e,r=t.schema){let{gen:o,parentSchema:n,data:s,keyword:i,it:a}=t;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=vn.mergeEvaluated.items(o,r.length,a.items));let c=o.name("valid"),u=o.const("len",(0,rm._)`${s}.length`);r.forEach((d,p)=>{(0,vn.alwaysValidSchema)(a,d)||(o.if((0,rm._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:f}=a,m=r.length,_=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!_){let y=`"${i}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,vn.checkStrictMode)(a,y,p.strictTuples)}}}ao.validateTuple=om;ao.default=K0});var nm=b(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var G0=da(),Y0={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,G0.validateTuple)(t,"items")};pa.default=Y0});var im=b(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var sm=I(),Q0=q(),X0=Ne(),ew=la(),tw={message:({params:{len:t}})=>(0,sm.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,sm._)`{limit: ${t}}`},rw={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:tw,code(t){let{schema:e,parentSchema:r,it:o}=t,{prefixItems:n}=r;o.items=!0,!(0,Q0.alwaysValidSchema)(o,e)&&(n?(0,ew.validateAdditionalItems)(t,n):t.ok((0,X0.validateArray)(t)))}};fa.default=rw});var am=b(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var Ze=I(),bn=q(),ow={message:({params:{min:t,max:e}})=>e===void 0?(0,Ze.str)`must contain at least ${t} valid item(s)`:(0,Ze.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ze._)`{minContains: ${t}}`:(0,Ze._)`{minContains: ${t}, maxContains: ${e}}`},nw={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ow,code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t,i,a,{minContains:c,maxContains:u}=o;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,Ze._)`${n}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,bn.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,bn.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,bn.alwaysValidSchema)(s,r)){let _=(0,Ze._)`${l} >= ${i}`;a!==void 0&&(_=(0,Ze._)`${_} && ${l} <= ${a}`),t.pass(_);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?f(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,Ze._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let _=e.name("_valid"),y=e.let("count",0);f(_,()=>e.if(_,()=>m(y)))}function f(_,y){e.forRange("i",0,l,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:bn.Type.Num,compositeRule:!0},_),y()})}function m(_){e.code((0,Ze._)`${_}++`),a===void 0?e.if((0,Ze._)`${_} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,Ze._)`${_} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,Ze._)`${_} >= ${i}`,()=>e.assign(d,!0)))}}};ma.default=nw});var lm=b(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.validateSchemaDeps=He.validatePropertyDeps=He.error=void 0;var ha=I(),sw=q(),co=Ne();He.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let o=e===1?"property":"properties";return(0,ha.str)`must have ${o} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:o}})=>(0,ha._)`{property: ${t},
6
+ || ${i} === "boolean" || ${n} === null`).assign(a,(0,O._)`[${n}]`)}}}function Pb({gen:t,parentData:e,parentDataProperty:r},o){t.if((0,O._)`${e} !== undefined`,()=>t.assign((0,O._)`${e}[${r}]`,o))}function bi(t,e,r,o=Ht.Correct){let n=o===Ht.Correct?O.operators.EQ:O.operators.NEQ,s;switch(t){case"null":return(0,O._)`${e} ${n} null`;case"array":s=(0,O._)`Array.isArray(${e})`;break;case"object":s=(0,O._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,O._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,O._)`typeof ${e} ${n} ${t}`}return o===Ht.Correct?s:(0,O.not)(s);function i(a=O.nil){return(0,O.and)((0,O._)`typeof ${e} == "number"`,a,r?(0,O._)`isFinite(${e})`:O.nil)}}me.checkDataType=bi;function vi(t,e,r,o){if(t.length===1)return bi(t[0],e,r,o);let n,s=(0,Sp.toHash)(t);if(s.array&&s.object){let i=(0,O._)`typeof ${e} != "object"`;n=s.null?i:(0,O._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else n=O.nil;s.number&&delete s.integer;for(let i in s)n=(0,O.and)(n,bi(i,e,r,o));return n}me.checkDataTypes=vi;var Eb={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,O._)`{type: ${t}}`:(0,O._)`{type: ${e}}`};function wi(t){let e=Tb(t);(0,$b.reportError)(e,Eb)}me.reportTypeError=wi;function Tb(t){let{gen:e,data:r,schema:o}=t,n=(0,Sp.schemaRefOrVal)(t,o,"type");return{gen:e,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:t}}});var Rp=v(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.assignDefaults=void 0;var Bt=I(),Rb=q();function Ob(t,e){let{properties:r,items:o}=t.schema;if(e==="object"&&r)for(let n in r)Tp(t,n,r[n].default);else e==="array"&&Array.isArray(o)&&o.forEach((n,s)=>Tp(t,s,n.default))}rn.assignDefaults=Ob;function Tp(t,e,r){let{gen:o,compositeRule:n,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Bt._)`${s}${(0,Bt.getProperty)(e)}`;if(n){(0,Rb.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Bt._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Bt._)`${c} || ${a} === null || ${a} === ""`),o.if(c,(0,Bt._)`${a} = ${(0,Bt.stringify)(r)}`)}});var Ae=v(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.validateUnion=V.validateArray=V.usePattern=V.callValidateCode=V.schemaProperties=V.allSchemaProperties=V.noPropertyInData=V.propertyInData=V.isOwnProperty=V.hasPropFunc=V.reportMissingProp=V.checkMissingProp=V.checkReportMissingProp=void 0;var G=I(),$i=q(),pt=tt(),Ib=q();function Nb(t,e){let{gen:r,data:o,it:n}=t;r.if(ki(r,o,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,G._)`${e}`},!0),t.error()})}V.checkReportMissingProp=Nb;function Ab({gen:t,data:e,it:{opts:r}},o,n){return(0,G.or)(...o.map(s=>(0,G.and)(ki(t,e,s,r.ownProperties),(0,G._)`${n} = ${s}`)))}V.checkMissingProp=Ab;function Zb(t,e){t.setParams({missingProperty:e},!0),t.error()}V.reportMissingProp=Zb;function Op(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Op;function zi(t,e,r){return(0,G._)`${Op(t)}.call(${e}, ${r})`}V.isOwnProperty=zi;function jb(t,e,r,o){let n=(0,G._)`${e}${(0,G.getProperty)(r)} !== undefined`;return o?(0,G._)`${n} && ${zi(t,e,r)}`:n}V.propertyInData=jb;function ki(t,e,r,o){let n=(0,G._)`${e}${(0,G.getProperty)(r)} === undefined`;return o?(0,G.or)(n,(0,G.not)(zi(t,e,r))):n}V.noPropertyInData=ki;function Ip(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Ip;function Cb(t,e){return Ip(e).filter(r=>!(0,$i.alwaysValidSchema)(t,e[r]))}V.schemaProperties=Cb;function Db({schemaCode:t,data:e,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:s},it:i},a,c,u){let l=u?(0,G._)`${t}, ${e}, ${o}${n}`:e,d=[[pt.default.instancePath,(0,G.strConcat)(pt.default.instancePath,s)],[pt.default.parentData,i.parentData],[pt.default.parentDataProperty,i.parentDataProperty],[pt.default.rootData,pt.default.rootData]];i.opts.dynamicRef&&d.push([pt.default.dynamicAnchors,pt.default.dynamicAnchors]);let p=(0,G._)`${l}, ${r.object(...d)}`;return c!==G.nil?(0,G._)`${a}.call(${c}, ${p})`:(0,G._)`${a}(${p})`}V.callValidateCode=Db;var qb=(0,G._)`new RegExp`;function Mb({gen:t,it:{opts:e}},r){let o=e.unicodeRegExp?"u":"",{regExp:n}=e.code,s=n(r,o);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,G._)`${n.code==="new RegExp"?qb:(0,Ib.useFunc)(t,n)}(${r}, ${o})`})}V.usePattern=Mb;function Lb(t){let{gen:e,data:r,keyword:o,it:n}=t,s=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,G._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:$i.Type.Num},s),e.if((0,G.not)(s),a)})}}V.validateArray=Lb;function Ub(t){let{gen:e,schema:r,keyword:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,$i.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:o,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,G._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,G.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}V.validateUnion=Ub});var Zp=v(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.validateKeywordUsage=Ve.validSchemaType=Ve.funcKeywordCode=Ve.macroKeywordCode=void 0;var ye=I(),xt=tt(),Fb=Ae(),Vb=Fr();function Jb(t,e){let{gen:r,keyword:o,schema:n,parentSchema:s,it:i}=t,a=e.macro.call(i.self,n,s,i),c=Ap(r,o,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ye.nil,errSchemaPath:`${i.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ve.macroKeywordCode=Jb;function Hb(t,e){var r;let{gen:o,keyword:n,schema:s,parentSchema:i,$data:a,it:c}=t;Wb(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Ap(o,n,u),d=o.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)_(),e.modifying&&Np(t),y(()=>t.error());else{let b=e.async?f():m();e.modifying&&Np(t),y(()=>Bb(t,b))}}function f(){let b=o.let("ruleErrs",null);return o.try(()=>_((0,ye._)`await `),P=>o.assign(d,!1).if((0,ye._)`${P} instanceof ${c.ValidationError}`,()=>o.assign(b,(0,ye._)`${P}.errors`),()=>o.throw(P))),b}function m(){let b=(0,ye._)`${l}.errors`;return o.assign(b,null),_(ye.nil),b}function _(b=e.async?(0,ye._)`await `:ye.nil){let P=c.opts.passContext?xt.default.this:xt.default.self,z=!("compile"in e&&!a||e.schema===!1);o.assign(d,(0,ye._)`${b}${(0,Fb.callValidateCode)(t,l,P,z)}`,e.modifying)}function y(b){var P;o.if((0,ye.not)((P=e.valid)!==null&&P!==void 0?P:d),b)}}Ve.funcKeywordCode=Hb;function Np(t){let{gen:e,data:r,it:o}=t;e.if(o.parentData,()=>e.assign(r,(0,ye._)`${o.parentData}[${o.parentDataProperty}]`))}function Bb(t,e){let{gen:r}=t;r.if((0,ye._)`Array.isArray(${e})`,()=>{r.assign(xt.default.vErrors,(0,ye._)`${xt.default.vErrors} === null ? ${e} : ${xt.default.vErrors}.concat(${e})`).assign(xt.default.errors,(0,ye._)`${xt.default.vErrors}.length`),(0,Vb.extendErrors)(t)},()=>t.error())}function Wb({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Ap(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ye.stringify)(r)})}function Kb(t,e,r=!1){return!e.length||e.some(o=>o==="array"?Array.isArray(t):o==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==o||r&&typeof t>"u")}Ve.validSchemaType=Kb;function Gb({schema:t,opts:e,self:r,errSchemaPath:o},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");let i=n.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ve.validateKeywordUsage=Gb});var Cp=v(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.extendSubschemaMode=ft.extendSubschemaData=ft.getSubschema=void 0;var Je=I(),jp=q();function Yb(t,{keyword:e,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}${(0,Je.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,jp.escapeFragment)(r)}`}}if(o!==void 0){if(n===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ft.getSubschema=Yb;function Qb(t,e,{dataProp:r,dataPropType:o,data:n,dataTypes:s,propertyName:i}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,p=a.let("data",(0,Je._)`${e.data}${(0,Je.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Je.str)`${u}${(0,jp.getErrorPath)(r,o,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Je._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let u=n instanceof Je.Name?n:a.let("data",n,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}ft.extendSubschemaData=Qb;function Xb(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:s}){o!==void 0&&(t.compositeRule=o),n!==void 0&&(t.createErrors=n),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ft.extendSubschemaMode=Xb});var xi=v((nR,Dp)=>{"use strict";Dp.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,n,s;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),o=s.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=o;n--!==0;){var i=s[n];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Mp=v((sR,qp)=>{"use strict";var mt=qp.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};on(e,o,n,t,"",t)};mt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mt.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 on(t,e,r,o,n,s,i,a,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){e(o,n,s,i,a,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in mt.arrayKeywords)for(var p=0;p<d.length;p++)on(t,e,r,d[p],n+"/"+l+"/"+p,s,n,l,o,p)}else if(l in mt.propsKeywords){if(d&&typeof d=="object")for(var f in d)on(t,e,r,d[f],n+"/"+l+"/"+ev(f),s,n,l,o,f)}else(l in mt.keywords||t.allKeys&&!(l in mt.skipKeywords))&&on(t,e,r,d,n+"/"+l,s,n,l,o)}r(o,n,s,i,a,c,u)}}function ev(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Jr=v($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;var tv=q(),rv=xi(),ov=Mp(),nv=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sv(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Si(t):e?Lp(t)<=e:!1}$e.inlineRef=sv;var iv=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Si(t){for(let e in t){if(iv.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Si)||typeof r=="object"&&Si(r))return!0}return!1}function Lp(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!nv.has(r)&&(typeof t[r]=="object"&&(0,tv.eachItem)(t[r],o=>e+=Lp(o)),e===1/0))return 1/0}return e}function Up(t,e="",r){r!==!1&&(e=Wt(e));let o=t.parse(e);return Fp(t,o)}$e.getFullPath=Up;function Fp(t,e){return t.serialize(e).split("#")[0]+"#"}$e._getFullPath=Fp;var av=/#\/?$/;function Wt(t){return t?t.replace(av,""):""}$e.normalizeId=Wt;function cv(t,e,r){return r=Wt(r),t.resolve(e,r)}$e.resolveUrl=cv;var uv=/^[a-z_][-a-z0-9._]*$/i;function lv(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=Wt(t[r]||e),s={"":n},i=Up(o,n,!1),a={},c=new Set;return ov(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let _=i+p,y=s[m];typeof d[r]=="string"&&(y=b.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),s[p]=y;function b(z){let S=this.opts.uriResolver.resolve;if(z=Wt(y?S(y,z):z),c.has(z))throw l(z);c.add(z);let $=this.refs[z];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?u(d,$.schema,z):z!==Wt(_)&&(z[0]==="#"?(u(d,a[z],z),a[z]=d):this.refs[z]=_),z}function P(z){if(typeof z=="string"){if(!uv.test(z))throw new Error(`invalid anchor "${z}"`);b.call(this,`#${z}`)}}}),a;function u(d,p,f){if(p!==void 0&&!rv(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}$e.getSchemaRefs=lv});var Wr=v(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.getData=ht.KeywordCxt=ht.validateFunctionCode=void 0;var Wp=zp(),Vp=Vr(),Ei=yi(),nn=Vr(),dv=Rp(),Br=Zp(),Pi=Cp(),x=I(),T=tt(),pv=Jr(),rt=q(),Hr=Fr();function fv(t){if(Yp(t)&&(Qp(t),Gp(t))){gv(t);return}Kp(t,()=>(0,Wp.topBoolOrEmptySchema)(t))}ht.validateFunctionCode=fv;function Kp({gen:t,validateName:e,schema:r,schemaEnv:o,opts:n},s){n.code.es5?t.func(e,(0,x._)`${T.default.data}, ${T.default.valCxt}`,o.$async,()=>{t.code((0,x._)`"use strict"; ${Jp(r,n)}`),hv(t,n),t.code(s)}):t.func(e,(0,x._)`${T.default.data}, ${mv(n)}`,o.$async,()=>t.code(Jp(r,n)).code(s))}function mv(t){return(0,x._)`{${T.default.instancePath}="", ${T.default.parentData}, ${T.default.parentDataProperty}, ${T.default.rootData}=${T.default.data}${t.dynamicRef?(0,x._)`, ${T.default.dynamicAnchors}={}`:x.nil}}={}`}function hv(t,e){t.if(T.default.valCxt,()=>{t.var(T.default.instancePath,(0,x._)`${T.default.valCxt}.${T.default.instancePath}`),t.var(T.default.parentData,(0,x._)`${T.default.valCxt}.${T.default.parentData}`),t.var(T.default.parentDataProperty,(0,x._)`${T.default.valCxt}.${T.default.parentDataProperty}`),t.var(T.default.rootData,(0,x._)`${T.default.valCxt}.${T.default.rootData}`),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,x._)`${T.default.valCxt}.${T.default.dynamicAnchors}`)},()=>{t.var(T.default.instancePath,(0,x._)`""`),t.var(T.default.parentData,(0,x._)`undefined`),t.var(T.default.parentDataProperty,(0,x._)`undefined`),t.var(T.default.rootData,T.default.data),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,x._)`{}`)})}function gv(t){let{schema:e,opts:r,gen:o}=t;Kp(t,()=>{r.$comment&&e.$comment&&ef(t),wv(t),o.let(T.default.vErrors,null),o.let(T.default.errors,0),r.unevaluated&&_v(t),Xp(t),kv(t)})}function _v(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,x._)`${r}.evaluated`),e.if((0,x._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,x._)`${t.evaluated}.props`,(0,x._)`undefined`)),e.if((0,x._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,x._)`${t.evaluated}.items`,(0,x._)`undefined`))}function Jp(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,x._)`/*# sourceURL=${r} */`:x.nil}function yv(t,e){if(Yp(t)&&(Qp(t),Gp(t))){bv(t,e);return}(0,Wp.boolOrEmptySchema)(t,e)}function Gp({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Yp(t){return typeof t.schema!="boolean"}function bv(t,e){let{schema:r,gen:o,opts:n}=t;n.$comment&&r.$comment&&ef(t),$v(t),zv(t);let s=o.const("_errs",T.default.errors);Xp(t,s),o.var(e,(0,x._)`${s} === ${T.default.errors}`)}function Qp(t){(0,rt.checkUnknownRules)(t),vv(t)}function Xp(t,e){if(t.opts.jtd)return Hp(t,[],!1,e);let r=(0,Vp.getSchemaTypes)(t.schema),o=(0,Vp.coerceAndCheckDataType)(t,r);Hp(t,r,!o,e)}function vv(t){let{schema:e,errSchemaPath:r,opts:o,self:n}=t;e.$ref&&o.ignoreKeywordsWithRef&&(0,rt.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function wv(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,rt.checkStrictMode)(t,"default is ignored in the schema root")}function $v(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,pv.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function zv(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ef({gen:t,schemaEnv:e,schema:r,errSchemaPath:o,opts:n}){let s=r.$comment;if(n.$comment===!0)t.code((0,x._)`${T.default.self}.logger.log(${s})`);else if(typeof n.$comment=="function"){let i=(0,x.str)`${o}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,x._)`${T.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function kv(t){let{gen:e,schemaEnv:r,validateName:o,ValidationError:n,opts:s}=t;r.$async?e.if((0,x._)`${T.default.errors} === 0`,()=>e.return(T.default.data),()=>e.throw((0,x._)`new ${n}(${T.default.vErrors})`)):(e.assign((0,x._)`${o}.errors`,T.default.vErrors),s.unevaluated&&xv(t),e.return((0,x._)`${T.default.errors} === 0`))}function xv({gen:t,evaluated:e,props:r,items:o}){r instanceof x.Name&&t.assign((0,x._)`${e}.props`,r),o instanceof x.Name&&t.assign((0,x._)`${e}.items`,o)}function Hp(t,e,r,o){let{gen:n,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,rt.schemaHasRulesButRef)(s,l))){n.block(()=>rf(t,"$ref",l.all.$ref.definition));return}c.jtd||Sv(t,e),n.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Ei.shouldUseGroup)(s,p)&&(p.type?(n.if((0,nn.checkDataType)(p.type,i,c.strictNumbers)),Bp(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,nn.reportTypeError)(t)),n.endIf()):Bp(t,p),a||n.if((0,x._)`${T.default.errors} === ${o||0}`))}}function Bp(t,e){let{gen:r,schema:o,opts:{useDefaults:n}}=t;n&&(0,dv.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Ei.shouldUseRule)(o,s)&&rf(t,s.keyword,s.definition,e.type)})}function Sv(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Pv(t,e),t.opts.allowUnionTypes||Ev(t,e),Tv(t,t.dataTypes))}function Pv(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{tf(t.dataTypes,r)||Ti(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Ov(t,e)}}function Ev(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ti(t,"use allowUnionTypes to allow union type keyword")}function Tv(t,e){let r=t.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&(0,Ei.shouldUseRule)(t.schema,n)){let{type:s}=n.definition;s.length&&!s.some(i=>Rv(e,i))&&Ti(t,`missing type "${s.join(",")}" for keyword "${o}"`)}}}function Rv(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function tf(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Ov(t,e){let r=[];for(let o of t.dataTypes)tf(e,o)?r.push(o):e.includes("integer")&&o==="number"&&r.push("integer");t.dataTypes=r}function Ti(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,rt.checkStrictMode)(t,e,t.opts.strictTypes)}var sn=class{constructor(e,r,o){if((0,Br.validateKeywordUsage)(e,r,o),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=o,this.data=e.data,this.schema=e.schema[o],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,rt.schemaRefOrVal)(e,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",of(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Br.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",T.default.errors))}result(e,r,o){this.failResult((0,x.not)(e),r,o)}failResult(e,r,o){this.gen.if(e),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,x.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,x._)`${r} !== undefined && (${(0,x.or)(this.invalid$data(),e)})`)}error(e,r,o){if(r){this.setParams(r),this._error(e,o),this.setParams({});return}this._error(e,o)}_error(e,r){(e?Hr.reportExtraError:Hr.reportError)(this,this.def.error,r)}$dataError(){(0,Hr.reportError)(this,this.def.$dataError||Hr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Hr.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,o=x.nil){this.gen.block(()=>{this.check$data(e,o),r()})}check$data(e=x.nil,r=x.nil){if(!this.$data)return;let{gen:o,schemaCode:n,schemaType:s,def:i}=this;o.if((0,x.or)((0,x._)`${n} === undefined`,r)),e!==x.nil&&o.assign(e,!0),(s.length||i.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),e!==x.nil&&o.assign(e,!1)),o.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:o,def:n,it:s}=this;return(0,x.or)(i(),a());function i(){if(o.length){if(!(r instanceof x.Name))throw new Error("ajv implementation error");let c=Array.isArray(o)?o:[o];return(0,x._)`${(0,nn.checkDataTypes)(c,r,s.opts.strictNumbers,nn.DataType.Wrong)}`}return x.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,x._)`!${c}(${r})`}return x.nil}}subschema(e,r){let o=(0,Pi.getSubschema)(this.it,e);(0,Pi.extendSubschemaData)(o,this.it,e),(0,Pi.extendSubschemaMode)(o,e);let n={...this.it,...o,items:void 0,props:void 0};return yv(n,r),n}mergeEvaluated(e,r){let{it:o,gen:n}=this;o.opts.unevaluated&&(o.props!==!0&&e.props!==void 0&&(o.props=rt.mergeEvaluated.props(n,e.props,o.props,r)),o.items!==!0&&e.items!==void 0&&(o.items=rt.mergeEvaluated.items(n,e.items,o.items,r)))}mergeValidEvaluated(e,r){let{it:o,gen:n}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,x.Name)),!0}};ht.KeywordCxt=sn;function rf(t,e,r,o){let n=new sn(t,r,e);"code"in r?r.code(n,o):n.$data&&r.validate?(0,Br.funcKeywordCode)(n,r):"macro"in r?(0,Br.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Br.funcKeywordCode)(n,r)}var Iv=/^\/(?:[^~]|~0|~1)*$/,Nv=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function of(t,{dataLevel:e,dataNames:r,dataPathArr:o}){let n,s;if(t==="")return T.default.rootData;if(t[0]==="/"){if(!Iv.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,s=T.default.rootData}else{let u=Nv.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=e)throw new Error(c("property/index",l));return o[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!n)return s}let i=s,a=n.split("/");for(let u of a)u&&(s=(0,x._)`${s}${(0,x.getProperty)((0,rt.unescapeJsonPointer)(u))}`,i=(0,x._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}ht.getData=of});var an=v(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var Ri=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Oi.default=Ri});var Kr=v(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var Ii=Jr(),Ni=class extends Error{constructor(e,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,Ii.resolveUrl)(e,r,o),this.missingSchema=(0,Ii.normalizeId)((0,Ii.getFullPath)(e,this.missingRef))}};Ai.default=Ni});var un=v(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.resolveSchema=Ze.getCompilingSchema=Ze.resolveRef=Ze.compileSchema=Ze.SchemaEnv=void 0;var qe=I(),Av=an(),St=tt(),Me=Jr(),nf=q(),Zv=Wr(),Kt=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let o;typeof e.schema=="object"&&(o=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Me.normalizeId)(o?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=o?.$async,this.refs={}}};Ze.SchemaEnv=Kt;function ji(t){let e=sf.call(this,t);if(e)return e;let r=(0,Me.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:s}=this.opts,i=new qe.CodeGen(this.scope,{es5:o,lines:n,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:Av.default,code:(0,qe._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:St.default.data,parentData:St.default.parentData,parentDataProperty:St.default.parentDataProperty,dataNames:[St.default.data],dataPathArr:[qe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,qe.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:qe.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,qe._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Zv.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(St.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${St.default.self}`,`${St.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:m,items:_}=u;f.evaluated={props:m instanceof qe.Name?void 0:m,items:_ instanceof qe.Name?void 0:_,dynamicProps:m instanceof qe.Name,dynamicItems:_ instanceof qe.Name},f.source&&(f.source.evaluated=(0,qe.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}Ze.compileSchema=ji;function jv(t,e,r){var o;r=(0,Me.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let s=qv.call(this,t,r);if(s===void 0){let i=(o=t.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;i&&(s=new Kt({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=Cv.call(this,s)}Ze.resolveRef=jv;function Cv(t){return(0,Me.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ji.call(this,t)}function sf(t){for(let e of this._compilations)if(Dv(e,t))return e}Ze.getCompilingSchema=sf;function Dv(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function qv(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||cn.call(this,t,e)}function cn(t,e){let r=this.opts.uriResolver.parse(e),o=(0,Me._getFullPath)(this.opts.uriResolver,r),n=(0,Me.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===n)return Zi.call(this,r,t);let s=(0,Me.normalizeId)(o),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=cn.call(this,t,i);return typeof a?.schema!="object"?void 0:Zi.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||ji.call(this,i),s===(0,Me.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(n=(0,Me.resolveUrl)(this.opts.uriResolver,n,u)),new Kt({schema:a,schemaId:c,root:t,baseId:n})}return Zi.call(this,r,i)}}Ze.resolveSchema=cn;var Mv=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Zi(t,{baseId:e,schema:r,root:o}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,nf.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Mv.has(a)&&u&&(e=(0,Me.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,nf.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Me.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=cn.call(this,o,a)}let{schemaId:i}=this.opts;if(s=s||new Kt({schema:r,schemaId:i,root:o,baseId:e}),s.schema!==s.root.schema)return s}});var af=v((dR,Lv)=>{Lv.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 qi=v((pR,ff)=>{"use strict";var Uv=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uf=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),Ci=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),lf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Fv=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Di(t){let e="",r=0,o=0;for(o=0;o<t.length;o++)if(r=t[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o];break}for(o+=1;o<t.length;o++){if(r=t[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o]}return e}var Vv=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cf(t){return t.length=0,!0}function Jv(t,e,r){if(t.length){let o=Di(t);if(o!=="")e.push(o);else return r.error=!0,!1;t.length=0}return!0}function Hv(t){let e=0,r={error:!1,address:"",zone:""},o=[],n=[],s=!1,i=!1,a=Jv;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(n,o,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),o.push(":");continue}else if(u==="%"){if(!a(n,o,r))break;a=cf}else{n.push(u);continue}}return n.length&&(a===cf?r.zone=n.join(""):i?o.push(n.join("")):o.push(Di(n))),r.address=o.join(""),r}function df(t){if(Bv(t,":")<2)return{host:t,isIPV6:!1};let e=Hv(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,o=e.address;return e.zone&&(r+="%"+e.zone,o+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:o}}}function Bv(t,e){let r=0;for(let o=0;o<t.length;o++)t[o]===e&&r++;return r}function Wv(t){let e=t,r=[],o=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((o=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,o)),e=e.slice(o)}return r.join("")}var Kv={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gv=/[@/?#:]/g,Yv=/[@/?#]/g;function pf(t,e){let r=e?Yv:Gv;return r.lastIndex=0,t.replace(r,o=>Kv[o])}function Qv(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let n=t.slice(o+1,o+3);if(Ci(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&lf(i)?r+=i:r+="%"+s,o+=2;continue}}r+=t[o]}return r}function Xv(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Ci(o)){let n=o.toUpperCase(),s=String.fromCharCode(parseInt(n,16));s!=="."&&lf(s)?e+=s:e+="%"+n,r+=2;continue}}Fv(t[r])?e+=t[r]:e+=escape(t[r])}return e}function ew(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Ci(o)){e+="%"+o.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function tw(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!uf(r)){let o=df(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=pf(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ff.exports={nonSimpleDomain:Vv,recomposeAuthority:tw,reescapeHostDelimiters:pf,normalizePercentEncoding:Qv,normalizePathEncoding:Xv,escapePreservingEscapes:ew,removeDotSegments:Wv,isIPv4:uf,isUUID:Uv,normalizeIPv6:df,stringArrayToHexStripped:Di}});var yf=v((fR,_f)=>{"use strict";var{isUUID:rw}=qi(),ow=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,nw=["http","https","ws","wss","urn","urn:uuid"];function sw(t){return nw.indexOf(t)!==-1}function Mi(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function mf(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function hf(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function iw(t){return t.secure=Mi(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function aw(t){if((t.port===(Mi(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function cw(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(ow);if(r){let o=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${o}:${e.nid||t.nid}`,s=Li(n);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function uw(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",o=t.nid.toLowerCase(),n=`${r}:${e.nid||o}`,s=Li(n);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${o||e.nid}:${a}`,e.skipEscape=!0,i}function lw(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!rw(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function dw(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var gf={scheme:"http",domainHost:!0,parse:mf,serialize:hf},pw={scheme:"https",domainHost:gf.domainHost,parse:mf,serialize:hf},ln={scheme:"ws",domainHost:!0,parse:iw,serialize:aw},fw={scheme:"wss",domainHost:ln.domainHost,parse:ln.parse,serialize:ln.serialize},mw={scheme:"urn",parse:cw,serialize:uw,skipNormalize:!0},hw={scheme:"urn:uuid",parse:lw,serialize:dw,skipNormalize:!0},dn={http:gf,https:pw,ws:ln,wss:fw,urn:mw,"urn:uuid":hw};Object.setPrototypeOf(dn,null);function Li(t){return t&&(dn[t]||dn[t.toLowerCase()])||void 0}_f.exports={wsIsSecure:Mi,SCHEMES:dn,isValidSchemeName:sw,getSchemeHandler:Li}});var kf=v((mR,pn)=>{"use strict";var{normalizeIPv6:gw,removeDotSegments:Gr,recomposeAuthority:_w,normalizePercentEncoding:yw,normalizePathEncoding:bw,escapePreservingEscapes:vw,reescapeHostDelimiters:ww,isIPv4:$w,nonSimpleDomain:zw}=qi(),{SCHEMES:kw,getSchemeHandler:vf}=yf();function xw(t,e){return typeof t=="string"?t=Rw(t,e):typeof t=="object"&&(t=Gt(Pt(t,e),e)),t}function Sw(t,e,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=wf(Gt(t,o),Gt(e,o),o,!0);return o.skipEscape=!0,Pt(n,o)}function wf(t,e,r,o){let n={};return o||(t=Gt(Pt(t,r),r),e=Gt(Pt(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Gr(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Gr(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Gr(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Gr(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function Pw(t,e,r){let o=bf(t,r),n=bf(e,r);return o!==void 0&&n!==void 0&&o.toLowerCase()===n.toLowerCase()}function Pt(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},o=Object.assign({},e),n=[],s=vf(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=yw(r.path):(r.path=vw(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let i=_w(r);if(i!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(i),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(a=Gr(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Ew=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Tw(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function $f(t,e){let r=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(Ew);if(i){o.scheme=i[1],o.userinfo=i[3],o.host=i[4],o.port=parseInt(i[5],10),o.path=i[6]||"",o.query=i[7],o.fragment=i[8],isNaN(o.port)&&(o.port=i[5]);let a=Tw(o,i);if(a!==void 0&&(o.error=o.error||a,n=!0),o.host)if($w(o.host)===!1){let l=gw(o.host);o.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let c=vf(r.scheme||o.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&zw(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(u){o.error=o.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=ww(unescape(o.host),s))),o.path&&(o.path=bw(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}c&&c.parse&&c.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:n}}function Gt(t,e){return $f(t,e).parsed}function Rw(t,e){return zf(t,e).normalized}function zf(t,e){let{parsed:r,malformedAuthorityOrPort:o}=$f(t,e);return{normalized:o?t:Pt(r,e),malformedAuthorityOrPort:o}}function bf(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:o}=zf(t,e);return o?void 0:r}if(typeof t=="object")return Pt(t,e)}var Ui={SCHEMES:kw,normalize:xw,resolve:Sw,resolveComponent:wf,equal:Pw,serialize:Pt,parse:Gt};pn.exports=Ui;pn.exports.default=Ui;pn.exports.fastUri=Ui});var Sf=v(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var xf=kf();xf.code='require("ajv/dist/runtime/uri").default';Fi.default=xf});var Af=v(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.CodeGen=le.Name=le.nil=le.stringify=le.str=le._=le.KeywordCxt=void 0;var Ow=Wr();Object.defineProperty(le,"KeywordCxt",{enumerable:!0,get:function(){return Ow.KeywordCxt}});var Yt=I();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return Yt._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return Yt.str}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return Yt.stringify}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return Yt.nil}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return Yt.Name}});Object.defineProperty(le,"CodeGen",{enumerable:!0,get:function(){return Yt.CodeGen}});var Iw=an(),Of=Kr(),Nw=_i(),Yr=un(),Aw=I(),Qr=Jr(),fn=Vr(),Ji=q(),Pf=af(),Zw=Sf(),If=(t,e)=>new RegExp(t,e);If.code="new RegExp";var jw=["removeAdditional","useDefaults","coerceTypes"],Cw=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Dw={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."},qw={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ef=200;function Mw(t){var e,r,o,n,s,i,a,c,u,l,d,p,f,m,_,y,b,P,z,S,$,ke,Te,ir,An;let ar=t.strict,Zn=(e=t.code)===null||e===void 0?void 0:e.optimize,Fa=Zn===!0||Zn===void 0?1:Zn||0,Va=(o=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:If,sh=(n=t.uriResolver)!==null&&n!==void 0?n:Zw.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:ar)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ar)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:ar)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ar)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:ar)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:Fa,regExp:Va}:{optimize:Fa,regExp:Va},loopRequired:(_=t.loopRequired)!==null&&_!==void 0?_:Ef,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:Ef,meta:(b=t.meta)!==null&&b!==void 0?b:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(z=t.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:($=t.addUsedSchema)!==null&&$!==void 0?$:!0,validateSchema:(ke=t.validateSchema)!==null&&ke!==void 0?ke:!0,validateFormats:(Te=t.validateFormats)!==null&&Te!==void 0?Te:!0,unicodeRegExp:(ir=t.unicodeRegExp)!==null&&ir!==void 0?ir:!0,int32range:(An=t.int32range)!==null&&An!==void 0?An:!0,uriResolver:sh}}var Xr=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Mw(e)};let{es5:r,lines:o}=this.opts.code;this.scope=new Aw.ValueScope({scope:{},prefixes:Cw,es5:r,lines:o}),this.logger=Hw(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Nw.getRules)(),Tf.call(this,Dw,e,"NOT SUPPORTED"),Tf.call(this,qw,e,"DEPRECATED","warn"),this._metaOpts=Vw.call(this),e.formats&&Uw.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Fw.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Lw.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:o}=this.opts,n=Pf;o==="id"&&(n={...Pf},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[o],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let o;if(typeof e=="string"){if(o=this.getSchema(e),!o)throw new Error(`no schema with key or ref "${e}"`)}else o=this.compile(e);let n=o(r);return"$async"in o||(this.errors=o.errors),n}compile(e,r){let o=this._addSchema(e,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return n.call(this,e,r);async function n(l,d){await s.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||i.call(this,p)}async function s(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Of.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.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 s.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]=o(l))}finally{delete this._loading[l]}}}addSchema(e,r,o,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,o,n);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,Qr.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,o,r,n,!0),this}addMetaSchema(e,r,o=this.opts.validateSchema){return this.addSchema(e,r,!0,o),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let o;if(o=e.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(o,e);if(!n&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return n}getSchema(e){let r;for(;typeof(r=Rf.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:o}=this.opts,n=new Yr.SchemaEnv({schema:{},schemaId:o});if(r=Yr.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Rf.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let o=e[this.opts.schemaId];return o&&(o=(0,Qr.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let o;if(typeof e=="string")o=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if(typeof e=="object"&&r===void 0){if(r=e,o=r.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Ww.call(this,o,r),!r)return(0,Ji.eachItem)(o,s=>Vi.call(this,s)),this;Gw.call(this,r);let n={...r,type:(0,fn.getJSONTypes)(r.type),schemaType:(0,fn.getJSONTypes)(r.schemaType)};return(0,Ji.eachItem)(o,n.type.length===0?s=>Vi.call(this,s,n):s=>n.type.forEach(i=>Vi.call(this,s,n,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let o of r.rules){let n=o.rules.findIndex(s=>s.keyword===e);n>=0&&o.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:o="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${o}${n.instancePath} ${n.message}`).reduce((n,s)=>n+r+s)}$dataMetaSchema(e,r){let o=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let s=n.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in o){let c=o[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=Nf(l))}}return e}_removeAllSchemas(e,r){for(let o in e){let n=e[o];(!r||r.test(o))&&(typeof n=="string"?delete e[o]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[o]))}}_addSchema(e,r,o,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;o=(0,Qr.normalizeId)(i||o);let u=Qr.getSchemaRefs.call(this,e,o);return c=new Yr.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:o,localRefs:u}),this._cache.set(c.schema,c),s&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Yr.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Yr.compileSchema.call(this,e)}finally{this.opts=r}}};Xr.ValidationError=Iw.default;Xr.MissingRefError=Of.default;le.default=Xr;function Tf(t,e,r,o="error"){for(let n in t){let s=n;s in e&&this.logger[o](`${r}: option ${n}. ${t[s]}`)}}function Rf(t){return t=(0,Qr.normalizeId)(t),this.schemas[t]||this.refs[t]}function Lw(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Uw(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Fw(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function Vw(){let t={...this.opts};for(let e of jw)delete t[e];return t}var Jw={log(){},warn(){},error(){}};function Hw(t){if(t===!1)return Jw;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Bw=/^[a-z_$][a-z0-9_$:-]*$/i;function Ww(t,e){let{RULES:r}=this;if((0,Ji.eachItem)(t,o=>{if(r.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!Bw.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Vi(t,e,r){var o;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=n?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,fn.getJSONTypes)(e.type),schemaType:(0,fn.getJSONTypes)(e.schemaType)}};e.before?Kw.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(o=e.implements)===null||o===void 0||o.forEach(c=>this.addKeyword(c))}function Kw(t,e,r){let o=t.rules.findIndex(n=>n.keyword===r);o>=0?t.rules.splice(o,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Gw(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Nf(e)),t.validateSchema=this.compile(e,!0))}var Yw={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Nf(t){return{anyOf:[t,Yw]}}});var Zf=v(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var Qw={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Hi.default=Qw});var qf=v(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.callRef=Et.getValidate=void 0;var Xw=Kr(),jf=Ae(),ze=I(),Qt=tt(),Cf=un(),mn=q(),e$={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:o}=t,{baseId:n,schemaEnv:s,validateName:i,opts:a,self:c}=o,{root:u}=s;if((r==="#"||r==="#/")&&n===u.baseId)return d();let l=Cf.resolveRef.call(c,u,n,r);if(l===void 0)throw new Xw.default(o.opts.uriResolver,n,r);if(l instanceof Cf.SchemaEnv)return p(l);return f(l);function d(){if(s===u)return hn(t,i,s,s.$async);let m=e.scopeValue("root",{ref:u});return hn(t,(0,ze._)`${m}.validate`,u,u.$async)}function p(m){let _=Df(t,m);hn(t,_,m,m.$async)}function f(m){let _=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,ze.stringify)(m)}:{ref:m}),y=e.name("valid"),b=t.subschema({schema:m,dataTypes:[],schemaPath:ze.nil,topSchemaRef:_,errSchemaPath:r},y);t.mergeEvaluated(b),t.ok(y)}}};function Df(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ze._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Et.getValidate=Df;function hn(t,e,r,o){let{gen:n,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?Qt.default.this:ze.nil;o?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,ze._)`await ${(0,jf.callValidateCode)(t,e,u)}`),f(e),i||n.assign(m,!0)},_=>{n.if((0,ze._)`!(${_} instanceof ${s.ValidationError})`,()=>n.throw(_)),p(_),i||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,jf.callValidateCode)(t,e,u),()=>f(e),()=>p(e))}function p(m){let _=(0,ze._)`${m}.errors`;n.assign(Qt.default.vErrors,(0,ze._)`${Qt.default.vErrors} === null ? ${_} : ${Qt.default.vErrors}.concat(${_})`),n.assign(Qt.default.errors,(0,ze._)`${Qt.default.vErrors}.length`)}function f(m){var _;if(!s.opts.unevaluated)return;let y=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=mn.mergeEvaluated.props(n,y.props,s.props));else{let b=n.var("props",(0,ze._)`${m}.evaluated.props`);s.props=mn.mergeEvaluated.props(n,b,s.props,ze.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=mn.mergeEvaluated.items(n,y.items,s.items));else{let b=n.var("items",(0,ze._)`${m}.evaluated.items`);s.items=mn.mergeEvaluated.items(n,b,s.items,ze.Name)}}}Et.callRef=hn;Et.default=e$});var Mf=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var t$=Zf(),r$=qf(),o$=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t$.default,r$.default];Bi.default=o$});var Lf=v(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var gn=I(),gt=gn.operators,_n={maximum:{okStr:"<=",ok:gt.LTE,fail:gt.GT},minimum:{okStr:">=",ok:gt.GTE,fail:gt.LT},exclusiveMaximum:{okStr:"<",ok:gt.LT,fail:gt.GTE},exclusiveMinimum:{okStr:">",ok:gt.GT,fail:gt.LTE}},n$={message:({keyword:t,schemaCode:e})=>(0,gn.str)`must be ${_n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,gn._)`{comparison: ${_n[t].okStr}, limit: ${e}}`},s$={keyword:Object.keys(_n),type:"number",schemaType:"number",$data:!0,error:n$,code(t){let{keyword:e,data:r,schemaCode:o}=t;t.fail$data((0,gn._)`${r} ${_n[e].fail} ${o} || isNaN(${r})`)}};Wi.default=s$});var Uf=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var eo=I(),i$={message:({schemaCode:t})=>(0,eo.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,eo._)`{multipleOf: ${t}}`},a$={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:i$,code(t){let{gen:e,data:r,schemaCode:o,it:n}=t,s=n.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,eo._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,eo._)`${i} !== parseInt(${i})`;t.fail$data((0,eo._)`(${o} === 0 || (${i} = ${r}/${o}, ${a}))`)}};Ki.default=a$});var Vf=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});function Ff(t){let e=t.length,r=0,o=0,n;for(;o<e;)r++,n=t.charCodeAt(o++),n>=55296&&n<=56319&&o<e&&(n=t.charCodeAt(o),(n&64512)===56320&&o++);return r}Gi.default=Ff;Ff.code='require("ajv/dist/runtime/ucs2length").default'});var Jf=v(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var Tt=I(),c$=q(),u$=Vf(),l$={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Tt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Tt._)`{limit: ${t}}`},d$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:l$,code(t){let{keyword:e,data:r,schemaCode:o,it:n}=t,s=e==="maxLength"?Tt.operators.GT:Tt.operators.LT,i=n.opts.unicode===!1?(0,Tt._)`${r}.length`:(0,Tt._)`${(0,c$.useFunc)(t.gen,u$.default)}(${r})`;t.fail$data((0,Tt._)`${i} ${s} ${o}`)}};Yi.default=d$});var Hf=v(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var p$=Ae(),f$=q(),Xt=I(),m$={message:({schemaCode:t})=>(0,Xt.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{pattern: ${t}}`},h$={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:m$,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(o){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,Xt._)`new RegExp`:(0,f$.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Xt._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Xt._)`!${l}`)}else{let c=(0,p$.usePattern)(t,n);t.fail$data((0,Xt._)`!${c}.test(${r})`)}}};Qi.default=h$});var Bf=v(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var to=I(),g$={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,to.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,to._)`{limit: ${t}}`},_$={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:g$,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxProperties"?to.operators.GT:to.operators.LT;t.fail$data((0,to._)`Object.keys(${r}).length ${n} ${o}`)}};Xi.default=_$});var Wf=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var ro=Ae(),oo=I(),y$=q(),b$={message:({params:{missingProperty:t}})=>(0,oo.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,oo._)`{missingProperty: ${t}}`},v$={keyword:"required",type:"object",schemaType:"array",$data:!0,error:b$,code(t){let{gen:e,schema:r,schemaCode:o,data:n,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let _ of r)if(f?.[_]===void 0&&!m.has(_)){let y=i.schemaEnv.baseId+i.errSchemaPath,b=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,y$.checkStrictMode)(i,b,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(oo.nil,d);else for(let f of r)(0,ro.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(c||s){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,ro.checkMissingProp)(t,r,f)),(0,ro.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",o,f=>{t.setParams({missingProperty:f}),e.if((0,ro.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,o,()=>{e.assign(m,(0,ro.propertyInData)(e,n,f,a.ownProperties)),e.if((0,oo.not)(m),()=>{t.error(),e.break()})},oo.nil)}}};ea.default=v$});var Kf=v(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var no=I(),w$={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,no.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,no._)`{limit: ${t}}`},$$={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:w$,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxItems"?no.operators.GT:no.operators.LT;t.fail$data((0,no._)`${r}.length ${n} ${o}`)}};ta.default=$$});var yn=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var Gf=xi();Gf.code='require("ajv/dist/runtime/equal").default';ra.default=Gf});var Yf=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var oa=Vr(),de=I(),z$=q(),k$=yn(),x$={message:({params:{i:t,j:e}})=>(0,de.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,de._)`{i: ${t}, j: ${e}}`},S$={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:x$,code(t){let{gen:e,data:r,$data:o,schema:n,parentSchema:s,schemaCode:i,it:a}=t;if(!o&&!n)return;let c=e.let("valid"),u=s.items?(0,oa.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,de._)`${i} === false`),t.ok(c);function l(){let m=e.let("i",(0,de._)`${r}.length`),_=e.let("j");t.setParams({i:m,j:_}),e.assign(c,!0),e.if((0,de._)`${m} > 1`,()=>(d()?p:f)(m,_))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function p(m,_){let y=e.name("item"),b=(0,oa.checkDataTypes)(u,y,a.opts.strictNumbers,oa.DataType.Wrong),P=e.const("indices",(0,de._)`{}`);e.for((0,de._)`;${m}--;`,()=>{e.let(y,(0,de._)`${r}[${m}]`),e.if(b,(0,de._)`continue`),u.length>1&&e.if((0,de._)`typeof ${y} == "string"`,(0,de._)`${y} += "_"`),e.if((0,de._)`typeof ${P}[${y}] == "number"`,()=>{e.assign(_,(0,de._)`${P}[${y}]`),t.error(),e.assign(c,!1).break()}).code((0,de._)`${P}[${y}] = ${m}`)})}function f(m,_){let y=(0,z$.useFunc)(e,k$.default),b=e.name("outer");e.label(b).for((0,de._)`;${m}--;`,()=>e.for((0,de._)`${_} = ${m}; ${_}--;`,()=>e.if((0,de._)`${y}(${r}[${m}], ${r}[${_}])`,()=>{t.error(),e.assign(c,!1).break(b)})))}}};na.default=S$});var Qf=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var sa=I(),P$=q(),E$=yn(),T$={message:"must be equal to constant",params:({schemaCode:t})=>(0,sa._)`{allowedValue: ${t}}`},R$={keyword:"const",$data:!0,error:T$,code(t){let{gen:e,data:r,$data:o,schemaCode:n,schema:s}=t;o||s&&typeof s=="object"?t.fail$data((0,sa._)`!${(0,P$.useFunc)(e,E$.default)}(${r}, ${n})`):t.fail((0,sa._)`${s} !== ${r}`)}};ia.default=R$});var Xf=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var so=I(),O$=q(),I$=yn(),N$={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,so._)`{allowedValues: ${t}}`},A$={keyword:"enum",schemaType:"array",$data:!0,error:N$,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t;if(!o&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,O$.useFunc)(e,I$.default)),l;if(a||o)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",s);l=(0,so.or)(...n.map((m,_)=>p(f,_)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,f=>e.if((0,so._)`${u()}(${r}, ${f})`,()=>e.assign(l,!0).break()))}function p(f,m){let _=n[m];return typeof _=="object"&&_!==null?(0,so._)`${u()}(${r}, ${f}[${m}])`:(0,so._)`${r} === ${_}`}}};aa.default=A$});var em=v(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var Z$=Lf(),j$=Uf(),C$=Jf(),D$=Hf(),q$=Bf(),M$=Wf(),L$=Kf(),U$=Yf(),F$=Qf(),V$=Xf(),J$=[Z$.default,j$.default,C$.default,D$.default,q$.default,M$.default,L$.default,U$.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},F$.default,V$.default];ca.default=J$});var la=v(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.validateAdditionalItems=void 0;var Rt=I(),ua=q(),H$={message:({params:{len:t}})=>(0,Rt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Rt._)`{limit: ${t}}`},B$={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:H$,code(t){let{parentSchema:e,it:r}=t,{items:o}=e;if(!Array.isArray(o)){(0,ua.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}tm(t,o)}};function tm(t,e){let{gen:r,schema:o,data:n,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Rt._)`${n}.length`);if(o===!1)t.setParams({len:e.length}),t.pass((0,Rt._)`${a} <= ${e.length}`);else if(typeof o=="object"&&!(0,ua.alwaysValidSchema)(i,o)){let u=r.var("valid",(0,Rt._)`${a} <= ${e.length}`);r.if((0,Rt.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:ua.Type.Num},u),i.allErrors||r.if((0,Rt.not)(u),()=>r.break())})}}io.validateAdditionalItems=tm;io.default=B$});var da=v(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.validateTuple=void 0;var rm=I(),bn=q(),W$=Ae(),K$={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return om(t,"additionalItems",e);r.items=!0,!(0,bn.alwaysValidSchema)(r,e)&&t.ok((0,W$.validateArray)(t))}};function om(t,e,r=t.schema){let{gen:o,parentSchema:n,data:s,keyword:i,it:a}=t;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=bn.mergeEvaluated.items(o,r.length,a.items));let c=o.name("valid"),u=o.const("len",(0,rm._)`${s}.length`);r.forEach((d,p)=>{(0,bn.alwaysValidSchema)(a,d)||(o.if((0,rm._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:f}=a,m=r.length,_=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!_){let y=`"${i}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,bn.checkStrictMode)(a,y,p.strictTuples)}}}ao.validateTuple=om;ao.default=K$});var nm=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var G$=da(),Y$={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,G$.validateTuple)(t,"items")};pa.default=Y$});var im=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var sm=I(),Q$=q(),X$=Ae(),e0=la(),t0={message:({params:{len:t}})=>(0,sm.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,sm._)`{limit: ${t}}`},r0={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:t0,code(t){let{schema:e,parentSchema:r,it:o}=t,{prefixItems:n}=r;o.items=!0,!(0,Q$.alwaysValidSchema)(o,e)&&(n?(0,e0.validateAdditionalItems)(t,n):t.ok((0,X$.validateArray)(t)))}};fa.default=r0});var am=v(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var je=I(),vn=q(),o0={message:({params:{min:t,max:e}})=>e===void 0?(0,je.str)`must contain at least ${t} valid item(s)`:(0,je.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,je._)`{minContains: ${t}}`:(0,je._)`{minContains: ${t}, maxContains: ${e}}`},n0={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:o0,code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t,i,a,{minContains:c,maxContains:u}=o;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,je._)`${n}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,vn.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,vn.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,vn.alwaysValidSchema)(s,r)){let _=(0,je._)`${l} >= ${i}`;a!==void 0&&(_=(0,je._)`${_} && ${l} <= ${a}`),t.pass(_);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?f(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,je._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let _=e.name("_valid"),y=e.let("count",0);f(_,()=>e.if(_,()=>m(y)))}function f(_,y){e.forRange("i",0,l,b=>{t.subschema({keyword:"contains",dataProp:b,dataPropType:vn.Type.Num,compositeRule:!0},_),y()})}function m(_){e.code((0,je._)`${_}++`),a===void 0?e.if((0,je._)`${_} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,je._)`${_} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,je._)`${_} >= ${i}`,()=>e.assign(d,!0)))}}};ma.default=n0});var lm=v(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.validateSchemaDeps=He.validatePropertyDeps=He.error=void 0;var ha=I(),s0=q(),co=Ae();He.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let o=e===1?"property":"properties";return(0,ha.str)`must have ${o} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:o}})=>(0,ha._)`{property: ${t},
7
7
  missingProperty: ${o},
8
8
  depsCount: ${e},
9
- deps: ${r}}`};var iw={keyword:"dependencies",type:"object",schemaType:"object",error:He.error,code(t){let[e,r]=aw(t);cm(t,e),um(t,r)}};function aw({schema:t}){let e={},r={};for(let o in t){if(o==="__proto__")continue;let n=Array.isArray(t[o])?e:r;n[o]=t[o]}return[e,r]}function cm(t,e=t.schema){let{gen:r,data:o,it:n}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,co.propertyInData)(r,o,i,n.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of a)(0,co.checkReportMissingProp)(t,u)}):(r.if((0,ha._)`${c} && (${(0,co.checkMissingProp)(t,a,s)})`),(0,co.reportMissingProp)(t,s),r.else())}}He.validatePropertyDeps=cm;function um(t,e=t.schema){let{gen:r,data:o,keyword:n,it:s}=t,i=r.name("valid");for(let a in e)(0,sw.alwaysValidSchema)(s,e[a])||(r.if((0,co.propertyInData)(r,o,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}He.validateSchemaDeps=um;He.default=iw});var pm=b(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var dm=I(),cw=q(),uw={message:"property name must be valid",params:({params:t})=>(0,dm._)`{propertyName: ${t.propertyName}}`},lw={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:uw,code(t){let{gen:e,schema:r,data:o,it:n}=t;if((0,cw.alwaysValidSchema)(n,r))return;let s=e.name("valid");e.forIn("key",o,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,dm.not)(s),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(s)}};ga.default=lw});var ya=b(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var $n=Ne(),Le=I(),dw=tt(),wn=q(),pw={message:"must NOT have additional properties",params:({params:t})=>(0,Le._)`{additionalProperty: ${t.additionalProperty}}`},fw={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:pw,code(t){let{gen:e,schema:r,parentSchema:o,data:n,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,wn.alwaysValidSchema)(i,r))return;let u=(0,$n.allSchemaProperties)(o.properties),l=(0,$n.allSchemaProperties)(o.patternProperties);d(),t.ok((0,Le._)`${s} === ${dw.default.errors}`);function d(){e.forIn("key",n,y=>{!u.length&&!l.length?m(y):e.if(p(y),()=>m(y))})}function p(y){let v;if(u.length>8){let P=(0,wn.schemaRefOrVal)(i,o.properties,"properties");v=(0,$n.isOwnProperty)(e,P,y)}else u.length?v=(0,Le.or)(...u.map(P=>(0,Le._)`${y} === ${P}`)):v=Le.nil;return l.length&&(v=(0,Le.or)(v,...l.map(P=>(0,Le._)`${(0,$n.usePattern)(t,P)}.test(${y})`))),(0,Le.not)(v)}function f(y){e.code((0,Le._)`delete ${n}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,wn.alwaysValidSchema)(i,r)){let v=e.name("valid");c.removeAdditional==="failing"?(_(y,v,!1),e.if((0,Le.not)(v),()=>{t.reset(),f(y)})):(_(y,v),a||e.if((0,Le.not)(v),()=>e.break()))}}function _(y,v,P){let x={keyword:"additionalProperties",dataProp:y,dataPropType:wn.Type.Str};P===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(x,v)}}};_a.default=fw});var hm=b(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var mw=Wr(),fm=Ne(),va=q(),mm=ya(),hw={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t;s.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&mm.default.code(new mw.KeywordCxt(s,mm.default,"additionalProperties"));let i=(0,fm.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=va.mergeEvaluated.props(e,(0,va.toHash)(i),s.props));let a=i.filter(d=>!(0,va.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,fm.propertyInData)(e,n,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};ba.default=hw});var vm=b($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var gm=Ne(),xn=I(),_m=q(),ym=q(),gw={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:o,parentSchema:n,it:s}=t,{opts:i}=s,a=(0,gm.allSchemaProperties)(r),c=a.filter(_=>(0,_m.alwaysValidSchema)(s,r[_]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&n.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof xn.Name)&&(s.props=(0,ym.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let _ of a)u&&f(_),s.allErrors?m(_):(e.var(l,!0),m(_),e.if(l))}function f(_){for(let y in u)new RegExp(_).test(y)&&(0,_m.checkStrictMode)(s,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function m(_){e.forIn("key",o,y=>{e.if((0,xn._)`${(0,gm.usePattern)(t,_)}.test(${y})`,()=>{let v=c.includes(_);v||t.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:ym.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,xn._)`${d}[${y}]`,!0):!v&&!s.allErrors&&e.if((0,xn.not)(l),()=>e.break())})})}}};$a.default=gw});var bm=b(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var _w=q(),yw={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:o}=t;if((0,_w.alwaysValidSchema)(o,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};wa.default=yw});var $m=b(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var vw=Ne(),bw={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:vw.validateUnion,error:{message:"must match a schema in anyOf"}};xa.default=bw});var wm=b(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var zn=I(),$w=q(),ww={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,zn._)`{passingSchemas: ${t.passing}}`},xw={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ww,code(t){let{gen:e,schema:r,parentSchema:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let p;(0,$w.alwaysValidSchema)(n,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,zn._)`${c} && ${i}`).assign(i,!1).assign(a,(0,zn._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,zn.Name)})})}}};za.default=xw});var xm=b(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var zw=q(),kw={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((s,i)=>{if((0,zw.alwaysValidSchema)(o,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},n);t.ok(n),t.mergeEvaluated(a)})}};ka.default=kw});var Sm=b(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var kn=I(),km=q(),Sw={message:({params:t})=>(0,kn.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,kn._)`{failingKeyword: ${t.ifClause}}`},Pw={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Sw,code(t){let{gen:e,parentSchema:r,it:o}=t;r.then===void 0&&r.else===void 0&&(0,km.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let n=zm(o,"then"),s=zm(o,"else");if(!n&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else n?e.if(a,u("then")):e.if((0,kn.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let p=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,kn._)`${l}`):t.setParams({ifClause:l})}}}};function zm(t,e){let r=t.schema[e];return r!==void 0&&!(0,km.alwaysValidSchema)(t,r)}Sa.default=Pw});var Pm=b(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Ew=q(),Tw={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Ew.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Pa.default=Tw});var Em=b(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var Rw=la(),Ow=nm(),Iw=da(),Nw=im(),Aw=am(),Zw=lm(),jw=pm(),Cw=ya(),Dw=hm(),qw=vm(),Mw=bm(),Lw=$m(),Uw=wm(),Fw=xm(),Vw=Sm(),Jw=Pm();function Hw(t=!1){let e=[Mw.default,Lw.default,Uw.default,Fw.default,Vw.default,Jw.default,jw.default,Cw.default,Zw.default,Dw.default,qw.default];return t?e.push(Ow.default,Nw.default):e.push(Rw.default,Iw.default),e.push(Aw.default),e}Ea.default=Hw});var Tm=b(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var oe=I(),Bw={message:({schemaCode:t})=>(0,oe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,oe._)`{format: ${t}}`},Ww={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Bw,code(t,e){let{gen:r,data:o,$data:n,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),_=r.const("fDef",(0,oe._)`${m}[${i}]`),y=r.let("fType"),v=r.let("format");r.if((0,oe._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(y,(0,oe._)`${_}.type || "string"`).assign(v,(0,oe._)`${_}.validate`),()=>r.assign(y,(0,oe._)`"string"`).assign(v,_)),t.fail$data((0,oe.or)(P(),x()));function P(){return c.strictSchema===!1?oe.nil:(0,oe._)`${i} && !${v}`}function x(){let S=l.$async?(0,oe._)`(${_}.async ? await ${v}(${o}) : ${v}(${o}))`:(0,oe._)`${v}(${o})`,w=(0,oe._)`(typeof ${v} == "function" ? ${S} : ${v}.test(${o}))`;return(0,oe._)`${v} && ${v} !== true && ${y} === ${e} && !${w}`}}function f(){let m=d.formats[s];if(!m){P();return}if(m===!0)return;let[_,y,v]=x(m);_===e&&t.pass(S());function P(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function x(w){let ze=w instanceof RegExp?(0,oe.regexpCode)(w):c.code.formats?(0,oe._)`${c.code.formats}${(0,oe.getProperty)(s)}`:void 0,Ee=r.scopeValue("formats",{key:s,ref:w,code:ze});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,oe._)`${Ee}.validate`]:["string",w,Ee]}function S(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,oe._)`await ${v}(${o})`}return typeof y=="function"?(0,oe._)`${v}(${o})`:(0,oe._)`${v}.test(${o})`}}}};Ta.default=Ww});var Rm=b(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Kw=Tm(),Gw=[Kw.default];Ra.default=Gw});var Om=b(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.contentVocabulary=er.metadataVocabulary=void 0;er.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];er.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Nm=b(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var Yw=Mf(),Qw=em(),Xw=Em(),ex=Rm(),Im=Om(),tx=[Yw.default,Qw.default,(0,Xw.default)(),ex.default,Im.metadataVocabulary,Im.contentVocabulary];Oa.default=tx});var Zm=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.DiscrError=void 0;var Am;(function(t){t.Tag="tag",t.Mapping="mapping"})(Am||(Sn.DiscrError=Am={}))});var Cm=b(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var tr=I(),Ia=Zm(),jm=un(),rx=Kr(),ox=q(),nx={message:({params:{discrError:t,tagName:e}})=>t===Ia.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,tr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},sx={keyword:"discriminator",type:"object",schemaType:"object",error:nx,code(t){let{gen:e,data:r,schema:o,parentSchema:n,it:s}=t,{oneOf:i}=n;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,tr._)`${r}${(0,tr.getProperty)(a)}`);e.if((0,tr._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Ia.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,tr._)`${u} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:Ia.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),_=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(_,tr.Name),m}function p(){var f;let m={},_=v(n),y=!0;for(let S=0;S<i.length;S++){let w=i[S];if(w?.$ref&&!(0,ox.schemaHasRulesButRef)(w,s.self.RULES)){let Ee=w.$ref;if(w=jm.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Ee),w instanceof jm.SchemaEnv&&(w=w.schema),w===void 0)throw new rx.default(s.opts.uriResolver,s.baseId,Ee)}let ze=(f=w?.properties)===null||f===void 0?void 0:f[a];if(typeof ze!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||v(w)),P(ze,S)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function v({required:S}){return Array.isArray(S)&&S.includes(a)}function P(S,w){if(S.const)x(S.const,w);else if(S.enum)for(let ze of S.enum)x(ze,w);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(S,w){if(typeof S!="string"||S in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[S]=w}}}};Na.default=sx});var Dm=b((rO,ix)=>{ix.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 Za=b((Y,Aa)=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.MissingRefError=Y.ValidationError=Y.CodeGen=Y.Name=Y.nil=Y.stringify=Y.str=Y._=Y.KeywordCxt=Y.Ajv=void 0;var ax=Af(),cx=Nm(),ux=Cm(),qm=Dm(),lx=["/properties"],Pn="http://json-schema.org/draft-07/schema",rr=class extends ax.default{_addVocabularies(){super._addVocabularies(),cx.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(ux.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(qm,lx):qm;this.addMetaSchema(e,Pn,!1),this.refs["http://json-schema.org/schema"]=Pn}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pn)?Pn:void 0)}};Y.Ajv=rr;Aa.exports=Y=rr;Aa.exports.Ajv=rr;Object.defineProperty(Y,"__esModule",{value:!0});Y.default=rr;var dx=Wr();Object.defineProperty(Y,"KeywordCxt",{enumerable:!0,get:function(){return dx.KeywordCxt}});var or=I();Object.defineProperty(Y,"_",{enumerable:!0,get:function(){return or._}});Object.defineProperty(Y,"str",{enumerable:!0,get:function(){return or.str}});Object.defineProperty(Y,"stringify",{enumerable:!0,get:function(){return or.stringify}});Object.defineProperty(Y,"nil",{enumerable:!0,get:function(){return or.nil}});Object.defineProperty(Y,"Name",{enumerable:!0,get:function(){return or.Name}});Object.defineProperty(Y,"CodeGen",{enumerable:!0,get:function(){return or.CodeGen}});var px=an();Object.defineProperty(Y,"ValidationError",{enumerable:!0,get:function(){return px.default}});var fx=Kr();Object.defineProperty(Y,"MissingRefError",{enumerable:!0,get:function(){return fx.default}})});var Bm=b(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.formatNames=We.fastFormats=We.fullFormats=void 0;function Be(t,e){return{validate:t,compare:e}}We.fullFormats={date:Be(Fm,qa),time:Be(Ca(!0),Ma),"date-time":Be(Mm(!0),Jm),"iso-time":Be(Ca(),Vm),"iso-date-time":Be(Mm(),Hm),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:vx,"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:Sx,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:bx,int32:{type:"number",validate:xx},int64:{type:"number",validate:zx},float:{type:"number",validate:Um},double:{type:"number",validate:Um},password:!0,binary:!0};We.fastFormats={...We.fullFormats,date:Be(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,qa),time:Be(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ma),"date-time":Be(/^\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,Jm),"iso-time":Be(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Vm),"iso-date-time":Be(/^\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,Hm),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};We.formatNames=Object.keys(We.fullFormats);function mx(t){return t%4===0&&(t%100!==0||t%400===0)}var hx=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,gx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Fm(t){let e=hx.exec(t);if(!e)return!1;let r=+e[1],o=+e[2],n=+e[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&mx(r)?29:gx[o])}function qa(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ja=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ca(t){return function(r){let o=ja.exec(r);if(!o)return!1;let n=+o[1],s=+o[2],i=+o[3],a=o[4],c=o[5]==="-"?-1:1,u=+(o[6]||0),l=+(o[7]||0);if(u>23||l>59||t&&!a)return!1;if(n<=23&&s<=59&&i<60)return!0;let d=s-l*c,p=n-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function Ma(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),o=new Date("2020-01-01T"+e).valueOf();if(r&&o)return r-o}function Vm(t,e){if(!(t&&e))return;let r=ja.exec(t),o=ja.exec(e);if(r&&o)return t=r[1]+r[2]+r[3],e=o[1]+o[2]+o[3],t>e?1:t<e?-1:0}var Da=/t|\s/i;function Mm(t){let e=Ca(t);return function(o){let n=o.split(Da);return n.length===2&&Fm(n[0])&&e(n[1])}}function Jm(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),o=new Date(e).valueOf();if(r&&o)return r-o}function Hm(t,e){if(!(t&&e))return;let[r,o]=t.split(Da),[n,s]=e.split(Da),i=qa(r,n);if(i!==void 0)return i||Ma(o,s)}var _x=/\/|:/,yx=/^(?:[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 vx(t){return _x.test(t)&&yx.test(t)}var Lm=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function bx(t){return Lm.lastIndex=0,Lm.test(t)}var $x=-(2**31),wx=2**31-1;function xx(t){return Number.isInteger(t)&&t<=wx&&t>=$x}function zx(t){return Number.isInteger(t)}function Um(){return!0}var kx=/[^\\]\\Z/;function Sx(t){if(kx.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Wm=b(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.formatLimitDefinition=void 0;var Px=Za(),Ue=I(),_t=Ue.operators,En={formatMaximum:{okStr:"<=",ok:_t.LTE,fail:_t.GT},formatMinimum:{okStr:">=",ok:_t.GTE,fail:_t.LT},formatExclusiveMaximum:{okStr:"<",ok:_t.LT,fail:_t.GTE},formatExclusiveMinimum:{okStr:">",ok:_t.GT,fail:_t.LTE}},Ex={message:({keyword:t,schemaCode:e})=>(0,Ue.str)`should be ${En[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ue._)`{comparison: ${En[t].okStr}, limit: ${e}}`};nr.formatLimitDefinition={keyword:Object.keys(En),type:"string",schemaType:"string",$data:!0,error:Ex,code(t){let{gen:e,data:r,schemaCode:o,keyword:n,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new Px.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=e.const("fmt",(0,Ue._)`${p}[${c.schemaCode}]`);t.fail$data((0,Ue.or)((0,Ue._)`typeof ${f} != "object"`,(0,Ue._)`${f} instanceof RegExp`,(0,Ue._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:i.code.formats?(0,Ue._)`${i.code.formats}${(0,Ue.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,Ue._)`${p}.compare(${r}, ${o}) ${En[n].fail} 0`}},dependencies:["format"]};var Tx=t=>(t.addKeyword(nr.formatLimitDefinition),t);nr.default=Tx});var Qm=b((uo,Ym)=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});var sr=Bm(),Rx=Wm(),La=I(),Km=new La.Name("fullFormats"),Ox=new La.Name("fastFormats"),Ua=(t,e={keywords:!0})=>{if(Array.isArray(e))return Gm(t,e,sr.fullFormats,Km),t;let[r,o]=e.mode==="fast"?[sr.fastFormats,Ox]:[sr.fullFormats,Km],n=e.formats||sr.formatNames;return Gm(t,n,r,o),e.keywords&&(0,Rx.default)(t),t};Ua.get=(t,e="full")=>{let o=(e==="fast"?sr.fastFormats:sr.fullFormats)[t];if(!o)throw new Error(`Unknown format "${t}"`);return o};function Gm(t,e,r,o){var n,s;(n=(s=t.opts.code).formats)!==null&&n!==void 0||(s.formats=(0,La._)`require("ajv-formats/dist/formats").${o}`);for(let i of e)t.addFormat(i,r[i])}Ym.exports=uo=Ua;Object.defineProperty(uo,"__esModule",{value:!0});uo.default=Ua});var Ba;function g(t,e,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Fe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Ba=globalThis).__zod_globalConfig??(Ba.__zod_globalConfig={});var It=globalThis.__zod_globalConfig;function ke(t){return t&&Object.assign(It,t),It}var D={};Ja(D,{BIGINT_FORMAT_RANGES:()=>Ya,Class:()=>Dn,NUMBER_FORMAT_RANGES:()=>Vn,aborted:()=>st,allowsEval:()=>Ln,assert:()=>gh,assertEqual:()=>ph,assertIs:()=>mh,assertNever:()=>hh,assertNotEqual:()=>fh,assignProp:()=>ot,base64ToUint8Array:()=>Xa,base64urlToUint8Array:()=>Nh,cached:()=>At,captureStackTrace:()=>mo,cleanEnum:()=>Ih,cleanRegex:()=>dr,clone:()=>Ce,cloneDef:()=>yh,createTransparentProxy:()=>zh,defineLazy:()=>U,esc:()=>fo,escapeRegex:()=>Ge,explicitlyAborted:()=>Jn,extend:()=>Ph,finalizeIssue:()=>Te,floatSafeRemainder:()=>qn,getElementAtPath:()=>vh,getEnumValues:()=>ur,getLengthableOrigin:()=>pr,getParsedType:()=>xh,getSizableOrigin:()=>Qa,hexToUint8Array:()=>Zh,isObject:()=>yt,isPlainObject:()=>nt,issue:()=>Zt,joinValues:()=>po,jsonStringifyReplacer:()=>Nt,merge:()=>Th,mergeDefs:()=>Ke,normalizeParams:()=>E,nullish:()=>lr,numKeys:()=>wh,objectClone:()=>_h,omit:()=>Sh,optionalKeys:()=>Fn,parsedType:()=>Hn,partial:()=>Rh,pick:()=>kh,prefixIssues:()=>Ye,primitiveTypes:()=>Ga,promiseAllObject:()=>bh,propertyKeyTypes:()=>Un,randomString:()=>$h,required:()=>Oh,safeExtend:()=>Eh,shallowClone:()=>Ka,slugify:()=>Mn,stringifyPrimitive:()=>ho,uint8ArrayToBase64:()=>ec,uint8ArrayToBase64url:()=>Ah,uint8ArrayToHex:()=>jh,unwrapMessage:()=>cr});function ph(t){return t}function fh(t){return t}function mh(t){}function hh(t){throw new Error("Unexpected value in exhaustive check")}function gh(t){}function ur(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,n])=>e.indexOf(+o)===-1).map(([o,n])=>n)}function po(t,e="|"){return t.map(r=>ho(r)).join(e)}function Nt(t,e){return typeof e=="bigint"?e.toString():e}function At(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function lr(t){return t==null}function dr(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function qn(t,e){let r=t/e,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Wa=Symbol("evaluating");function U(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==Wa)return o===void 0&&(o=Wa,o=r()),o},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function _h(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ot(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ke(...t){let e={};for(let r of t){let o=Object.getOwnPropertyDescriptors(r);Object.assign(e,o)}return Object.defineProperties({},e)}function yh(t){return Ke(t._zod.def)}function vh(t,e){return e?e.reduce((r,o)=>r?.[o],t):t}function bh(t){let e=Object.keys(t),r=e.map(o=>t[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<e.length;s++)n[e[s]]=o[s];return n})}function $h(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<t;o++)r+=e[Math.floor(Math.random()*e.length)];return r}function fo(t){return JSON.stringify(t)}function Mn(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mo="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function yt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Ln=At(()=>{if(It.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nt(t){if(yt(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(yt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ka(t){return nt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function wh(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var xh=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Un=new Set(["string","number","symbol"]),Ga=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(t,e,r){let o=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(o._zod.parent=t),o}function E(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function zh(t){let e;return new Proxy({},{get(r,o,n){return e??(e=t()),Reflect.get(e,o,n)},set(r,o,n,s){return e??(e=t()),Reflect.set(e,o,n,s)},has(r,o){return e??(e=t()),Reflect.has(e,o)},deleteProperty(r,o){return e??(e=t()),Reflect.deleteProperty(e,o)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,o){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(r,o,n){return e??(e=t()),Reflect.defineProperty(e,o,n)}})}function ho(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Fn(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Vn={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]},Ya={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function kh(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Ke(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return ot(this,"shape",i),i},checks:[]});return Ce(t,s)}function Sh(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Ke(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return ot(this,"shape",i),i},checks:[]});return Ce(t,s)}function Ph(t,e){if(!nt(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ke(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return ot(this,"shape",s),s}});return Ce(t,n)}function Eh(t,e){if(!nt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ke(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return ot(this,"shape",o),o}});return Ce(t,r)}function Th(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ke(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e._zod.def.shape};return ot(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ce(t,r)}function Rh(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Ke(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return ot(this,"shape",c),c},checks:[]});return Ce(e,i)}function Oh(t,e,r){let o=Ke(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new t({type:"nonoptional",innerType:n[i]});return ot(this,"shape",s),s}});return Ce(e,o)}function st(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Jn(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ye(t,e){return e.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(t),r})}function cr(t){return typeof t=="string"?t:t?.message}function Te(t,e,r){let o=t.message?t.message:cr(t.inst?._zod.def?.error?.(t))??cr(e?.error?.(t))??cr(r.customError?.(t))??cr(r.localeError?.(t))??"Invalid input",{inst:n,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=o,e?.reportInput&&(a.input=i),a}function Qa(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function pr(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Hn(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Zt(...t){let[e,r,o]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:o}:{...e}}function Ih(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Xa(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r}function ec(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Nh(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Xa(e+r)}function Ah(t){return ec(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zh(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let o=0;o<e.length;o+=2)r[o/2]=Number.parseInt(e.slice(o,o+2),16);return r}function jh(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Dn=class{constructor(...e){}};var tc=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Nt,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},go=g("$ZodError",tc),Bn=g("$ZodError",tc,{Parent:Error});function rc(t,e=r=>r.message){let r={},o=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):o.push(e(n));return{formErrors:o,fieldErrors:r}}function oc(t,e=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(t),r}var _o=t=>(e,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Fe;if(i.issues.length){let a=new(n?.Err??t)(i.issues.map(c=>Te(c,s,ke())));throw mo(a,n?.callee),a}return i.value};var yo=t=>async(e,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??t)(i.issues.map(c=>Te(c,s,ke())));throw mo(a,n?.callee),a}return i.value};var fr=t=>(e,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Fe;return s.issues.length?{success:!1,error:new(t??go)(s.issues.map(i=>Te(i,n,ke())))}:{success:!0,data:s.value}},mr=fr(Bn),hr=t=>async(e,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>Te(i,n,ke())))}:{success:!0,data:s.value}},vo=hr(Bn),nc=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _o(t)(e,r,n)};var sc=t=>(e,r,o)=>_o(t)(e,r,o);var ic=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yo(t)(e,r,n)};var ac=t=>async(e,r,o)=>yo(t)(e,r,o);var cc=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fr(t)(e,r,n)};var uc=t=>(e,r,o)=>fr(t)(e,r,o);var lc=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return hr(t)(e,r,n)};var dc=t=>async(e,r,o)=>hr(t)(e,r,o);var pc=/^[cC][0-9a-z]{6,}$/,fc=/^[0-9a-z]+$/,mc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hc=/^[0-9a-vA-V]{20}$/,gc=/^[A-Za-z0-9]{27}$/,_c=/^[a-zA-Z0-9_-]{21}$/,yc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var vc=/^([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})$/,Wn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var bc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Dh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function $c(){return new RegExp(Dh,"u")}var wc=/^(?:(?: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])$/,xc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var zc=/^((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])$/,kc=/^(([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])$/,Sc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kn=/^[A-Za-z0-9_-]*$/;var Pc=/^https?$/,Ec=/^\+[1-9]\d{6,14}$/,Tc="(?:(?:\\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])))",Rc=new RegExp(`^${Tc}$`);function Oc(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ic(t){return new RegExp(`^${Oc(t)}$`)}function Nc(t){let e=Oc({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${r.join("|")})`;return new RegExp(`^${Tc}T(?:${o})$`)}var Ac=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Zc=/^-?\d+$/,Gn=/^-?\d+(?:\.\d+)?$/,jc=/^(?:true|false)$/i,Cc=/^null$/i;var Dc=/^[^A-Z]*$/,qc=/^[^a-z]*$/;var ie=g("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Mc={number:"number",bigint:"bigint",object:"date"},Yn=g("$ZodCheckLessThan",(t,e)=>{ie.init(t,e);let r=Mc[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Qn=g("$ZodCheckGreaterThan",(t,e)=>{ie.init(t,e);let r=Mc[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Lc=g("$ZodCheckMultipleOf",(t,e)=>{ie.init(t,e),t._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):qn(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Uc=g("$ZodCheckNumberFormat",(t,e)=>{ie.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),o=r?"int":"number",[n,s]=Vn[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,r&&(a.pattern=Zc)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Fc=g("$ZodCheckMaxLength",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let n=o.value;if(n.length<=e.maximum)return;let i=pr(n);o.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Vc=g("$ZodCheckMinLength",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let n=o.value;if(n.length>=e.minimum)return;let i=pr(n);o.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Jc=g("$ZodCheckLengthEquals",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=o=>{let n=o.value,s=n.length;if(s===e.length)return;let i=pr(n),a=s>e.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),gr=g("$ZodCheckStringFormat",(t,e)=>{var r,o;ie.init(t,e),t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),Hc=g("$ZodCheckRegex",(t,e)=>{gr.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Bc=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Dc),gr.init(t,e)}),Wc=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=qc),gr.init(t,e)}),Kc=g("$ZodCheckIncludes",(t,e)=>{ie.init(t,e);let r=Ge(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),Gc=g("$ZodCheckStartsWith",(t,e)=>{ie.init(t,e);let r=new RegExp(`^${Ge(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:t,continue:!e.abort})}}),Yc=g("$ZodCheckEndsWith",(t,e)=>{ie.init(t,e);let r=new RegExp(`.*${Ge(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:t,continue:!e.abort})}});var Qc=g("$ZodCheckOverwrite",(t,e)=>{ie.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var $o=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
9
+ deps: ${r}}`};var i0={keyword:"dependencies",type:"object",schemaType:"object",error:He.error,code(t){let[e,r]=a0(t);cm(t,e),um(t,r)}};function a0({schema:t}){let e={},r={};for(let o in t){if(o==="__proto__")continue;let n=Array.isArray(t[o])?e:r;n[o]=t[o]}return[e,r]}function cm(t,e=t.schema){let{gen:r,data:o,it:n}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,co.propertyInData)(r,o,i,n.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of a)(0,co.checkReportMissingProp)(t,u)}):(r.if((0,ha._)`${c} && (${(0,co.checkMissingProp)(t,a,s)})`),(0,co.reportMissingProp)(t,s),r.else())}}He.validatePropertyDeps=cm;function um(t,e=t.schema){let{gen:r,data:o,keyword:n,it:s}=t,i=r.name("valid");for(let a in e)(0,s0.alwaysValidSchema)(s,e[a])||(r.if((0,co.propertyInData)(r,o,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}He.validateSchemaDeps=um;He.default=i0});var pm=v(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var dm=I(),c0=q(),u0={message:"property name must be valid",params:({params:t})=>(0,dm._)`{propertyName: ${t.propertyName}}`},l0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:u0,code(t){let{gen:e,schema:r,data:o,it:n}=t;if((0,c0.alwaysValidSchema)(n,r))return;let s=e.name("valid");e.forIn("key",o,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,dm.not)(s),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(s)}};ga.default=l0});var ya=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var wn=Ae(),Le=I(),d0=tt(),$n=q(),p0={message:"must NOT have additional properties",params:({params:t})=>(0,Le._)`{additionalProperty: ${t.additionalProperty}}`},f0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:p0,code(t){let{gen:e,schema:r,parentSchema:o,data:n,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,$n.alwaysValidSchema)(i,r))return;let u=(0,wn.allSchemaProperties)(o.properties),l=(0,wn.allSchemaProperties)(o.patternProperties);d(),t.ok((0,Le._)`${s} === ${d0.default.errors}`);function d(){e.forIn("key",n,y=>{!u.length&&!l.length?m(y):e.if(p(y),()=>m(y))})}function p(y){let b;if(u.length>8){let P=(0,$n.schemaRefOrVal)(i,o.properties,"properties");b=(0,wn.isOwnProperty)(e,P,y)}else u.length?b=(0,Le.or)(...u.map(P=>(0,Le._)`${y} === ${P}`)):b=Le.nil;return l.length&&(b=(0,Le.or)(b,...l.map(P=>(0,Le._)`${(0,wn.usePattern)(t,P)}.test(${y})`))),(0,Le.not)(b)}function f(y){e.code((0,Le._)`delete ${n}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,$n.alwaysValidSchema)(i,r)){let b=e.name("valid");c.removeAdditional==="failing"?(_(y,b,!1),e.if((0,Le.not)(b),()=>{t.reset(),f(y)})):(_(y,b),a||e.if((0,Le.not)(b),()=>e.break()))}}function _(y,b,P){let z={keyword:"additionalProperties",dataProp:y,dataPropType:$n.Type.Str};P===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(z,b)}}};_a.default=f0});var hm=v(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var m0=Wr(),fm=Ae(),ba=q(),mm=ya(),h0={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t;s.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&mm.default.code(new m0.KeywordCxt(s,mm.default,"additionalProperties"));let i=(0,fm.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=ba.mergeEvaluated.props(e,(0,ba.toHash)(i),s.props));let a=i.filter(d=>!(0,ba.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,fm.propertyInData)(e,n,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};va.default=h0});var bm=v(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var gm=Ae(),zn=I(),_m=q(),ym=q(),g0={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:o,parentSchema:n,it:s}=t,{opts:i}=s,a=(0,gm.allSchemaProperties)(r),c=a.filter(_=>(0,_m.alwaysValidSchema)(s,r[_]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&n.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof zn.Name)&&(s.props=(0,ym.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let _ of a)u&&f(_),s.allErrors?m(_):(e.var(l,!0),m(_),e.if(l))}function f(_){for(let y in u)new RegExp(_).test(y)&&(0,_m.checkStrictMode)(s,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function m(_){e.forIn("key",o,y=>{e.if((0,zn._)`${(0,gm.usePattern)(t,_)}.test(${y})`,()=>{let b=c.includes(_);b||t.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:ym.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,zn._)`${d}[${y}]`,!0):!b&&!s.allErrors&&e.if((0,zn.not)(l),()=>e.break())})})}}};wa.default=g0});var vm=v($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var _0=q(),y0={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:o}=t;if((0,_0.alwaysValidSchema)(o,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};$a.default=y0});var wm=v(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var b0=Ae(),v0={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:b0.validateUnion,error:{message:"must match a schema in anyOf"}};za.default=v0});var $m=v(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var kn=I(),w0=q(),$0={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,kn._)`{passingSchemas: ${t.passing}}`},z0={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:$0,code(t){let{gen:e,schema:r,parentSchema:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let p;(0,w0.alwaysValidSchema)(n,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,kn._)`${c} && ${i}`).assign(i,!1).assign(a,(0,kn._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,kn.Name)})})}}};ka.default=z0});var zm=v(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var k0=q(),x0={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((s,i)=>{if((0,k0.alwaysValidSchema)(o,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},n);t.ok(n),t.mergeEvaluated(a)})}};xa.default=x0});var Sm=v(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var xn=I(),xm=q(),S0={message:({params:t})=>(0,xn.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,xn._)`{failingKeyword: ${t.ifClause}}`},P0={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:S0,code(t){let{gen:e,parentSchema:r,it:o}=t;r.then===void 0&&r.else===void 0&&(0,xm.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let n=km(o,"then"),s=km(o,"else");if(!n&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else n?e.if(a,u("then")):e.if((0,xn.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let p=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,xn._)`${l}`):t.setParams({ifClause:l})}}}};function km(t,e){let r=t.schema[e];return r!==void 0&&!(0,xm.alwaysValidSchema)(t,r)}Sa.default=P0});var Pm=v(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var E0=q(),T0={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,E0.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Pa.default=T0});var Em=v(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var R0=la(),O0=nm(),I0=da(),N0=im(),A0=am(),Z0=lm(),j0=pm(),C0=ya(),D0=hm(),q0=bm(),M0=vm(),L0=wm(),U0=$m(),F0=zm(),V0=Sm(),J0=Pm();function H0(t=!1){let e=[M0.default,L0.default,U0.default,F0.default,V0.default,J0.default,j0.default,C0.default,Z0.default,D0.default,q0.default];return t?e.push(O0.default,N0.default):e.push(R0.default,I0.default),e.push(A0.default),e}Ea.default=H0});var Tm=v(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var oe=I(),B0={message:({schemaCode:t})=>(0,oe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,oe._)`{format: ${t}}`},W0={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:B0,code(t,e){let{gen:r,data:o,$data:n,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),_=r.const("fDef",(0,oe._)`${m}[${i}]`),y=r.let("fType"),b=r.let("format");r.if((0,oe._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(y,(0,oe._)`${_}.type || "string"`).assign(b,(0,oe._)`${_}.validate`),()=>r.assign(y,(0,oe._)`"string"`).assign(b,_)),t.fail$data((0,oe.or)(P(),z()));function P(){return c.strictSchema===!1?oe.nil:(0,oe._)`${i} && !${b}`}function z(){let S=l.$async?(0,oe._)`(${_}.async ? await ${b}(${o}) : ${b}(${o}))`:(0,oe._)`${b}(${o})`,$=(0,oe._)`(typeof ${b} == "function" ? ${S} : ${b}.test(${o}))`;return(0,oe._)`${b} && ${b} !== true && ${y} === ${e} && !${$}`}}function f(){let m=d.formats[s];if(!m){P();return}if(m===!0)return;let[_,y,b]=z(m);_===e&&t.pass(S());function P(){if(c.strictSchema===!1){d.logger.warn($());return}throw new Error($());function $(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function z($){let ke=$ instanceof RegExp?(0,oe.regexpCode)($):c.code.formats?(0,oe._)`${c.code.formats}${(0,oe.getProperty)(s)}`:void 0,Te=r.scopeValue("formats",{key:s,ref:$,code:ke});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,oe._)`${Te}.validate`]:["string",$,Te]}function S(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,oe._)`await ${b}(${o})`}return typeof y=="function"?(0,oe._)`${b}(${o})`:(0,oe._)`${b}.test(${o})`}}}};Ta.default=W0});var Rm=v(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var K0=Tm(),G0=[K0.default];Ra.default=G0});var Om=v(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.contentVocabulary=er.metadataVocabulary=void 0;er.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];er.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Nm=v(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var Y0=Mf(),Q0=em(),X0=Em(),ez=Rm(),Im=Om(),tz=[Y0.default,Q0.default,(0,X0.default)(),ez.default,Im.metadataVocabulary,Im.contentVocabulary];Oa.default=tz});var Zm=v(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.DiscrError=void 0;var Am;(function(t){t.Tag="tag",t.Mapping="mapping"})(Am||(Sn.DiscrError=Am={}))});var Cm=v(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var tr=I(),Ia=Zm(),jm=un(),rz=Kr(),oz=q(),nz={message:({params:{discrError:t,tagName:e}})=>t===Ia.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,tr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},sz={keyword:"discriminator",type:"object",schemaType:"object",error:nz,code(t){let{gen:e,data:r,schema:o,parentSchema:n,it:s}=t,{oneOf:i}=n;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,tr._)`${r}${(0,tr.getProperty)(a)}`);e.if((0,tr._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Ia.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,tr._)`${u} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:Ia.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),_=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(_,tr.Name),m}function p(){var f;let m={},_=b(n),y=!0;for(let S=0;S<i.length;S++){let $=i[S];if($?.$ref&&!(0,oz.schemaHasRulesButRef)($,s.self.RULES)){let Te=$.$ref;if($=jm.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Te),$ instanceof jm.SchemaEnv&&($=$.schema),$===void 0)throw new rz.default(s.opts.uriResolver,s.baseId,Te)}let ke=(f=$?.properties)===null||f===void 0?void 0:f[a];if(typeof ke!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||b($)),P(ke,S)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function b({required:S}){return Array.isArray(S)&&S.includes(a)}function P(S,$){if(S.const)z(S.const,$);else if(S.enum)for(let ke of S.enum)z(ke,$);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function z(S,$){if(typeof S!="string"||S in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[S]=$}}}};Na.default=sz});var Dm=v((rO,iz)=>{iz.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 Za=v((Y,Aa)=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.MissingRefError=Y.ValidationError=Y.CodeGen=Y.Name=Y.nil=Y.stringify=Y.str=Y._=Y.KeywordCxt=Y.Ajv=void 0;var az=Af(),cz=Nm(),uz=Cm(),qm=Dm(),lz=["/properties"],Pn="http://json-schema.org/draft-07/schema",rr=class extends az.default{_addVocabularies(){super._addVocabularies(),cz.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(uz.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(qm,lz):qm;this.addMetaSchema(e,Pn,!1),this.refs["http://json-schema.org/schema"]=Pn}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pn)?Pn:void 0)}};Y.Ajv=rr;Aa.exports=Y=rr;Aa.exports.Ajv=rr;Object.defineProperty(Y,"__esModule",{value:!0});Y.default=rr;var dz=Wr();Object.defineProperty(Y,"KeywordCxt",{enumerable:!0,get:function(){return dz.KeywordCxt}});var or=I();Object.defineProperty(Y,"_",{enumerable:!0,get:function(){return or._}});Object.defineProperty(Y,"str",{enumerable:!0,get:function(){return or.str}});Object.defineProperty(Y,"stringify",{enumerable:!0,get:function(){return or.stringify}});Object.defineProperty(Y,"nil",{enumerable:!0,get:function(){return or.nil}});Object.defineProperty(Y,"Name",{enumerable:!0,get:function(){return or.Name}});Object.defineProperty(Y,"CodeGen",{enumerable:!0,get:function(){return or.CodeGen}});var pz=an();Object.defineProperty(Y,"ValidationError",{enumerable:!0,get:function(){return pz.default}});var fz=Kr();Object.defineProperty(Y,"MissingRefError",{enumerable:!0,get:function(){return fz.default}})});var Bm=v(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.formatNames=We.fastFormats=We.fullFormats=void 0;function Be(t,e){return{validate:t,compare:e}}We.fullFormats={date:Be(Fm,qa),time:Be(Ca(!0),Ma),"date-time":Be(Mm(!0),Jm),"iso-time":Be(Ca(),Vm),"iso-date-time":Be(Mm(),Hm),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:bz,"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:Sz,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:vz,int32:{type:"number",validate:zz},int64:{type:"number",validate:kz},float:{type:"number",validate:Um},double:{type:"number",validate:Um},password:!0,binary:!0};We.fastFormats={...We.fullFormats,date:Be(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,qa),time:Be(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ma),"date-time":Be(/^\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,Jm),"iso-time":Be(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Vm),"iso-date-time":Be(/^\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,Hm),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};We.formatNames=Object.keys(We.fullFormats);function mz(t){return t%4===0&&(t%100!==0||t%400===0)}var hz=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,gz=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Fm(t){let e=hz.exec(t);if(!e)return!1;let r=+e[1],o=+e[2],n=+e[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&mz(r)?29:gz[o])}function qa(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ja=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ca(t){return function(r){let o=ja.exec(r);if(!o)return!1;let n=+o[1],s=+o[2],i=+o[3],a=o[4],c=o[5]==="-"?-1:1,u=+(o[6]||0),l=+(o[7]||0);if(u>23||l>59||t&&!a)return!1;if(n<=23&&s<=59&&i<60)return!0;let d=s-l*c,p=n-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function Ma(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),o=new Date("2020-01-01T"+e).valueOf();if(r&&o)return r-o}function Vm(t,e){if(!(t&&e))return;let r=ja.exec(t),o=ja.exec(e);if(r&&o)return t=r[1]+r[2]+r[3],e=o[1]+o[2]+o[3],t>e?1:t<e?-1:0}var Da=/t|\s/i;function Mm(t){let e=Ca(t);return function(o){let n=o.split(Da);return n.length===2&&Fm(n[0])&&e(n[1])}}function Jm(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),o=new Date(e).valueOf();if(r&&o)return r-o}function Hm(t,e){if(!(t&&e))return;let[r,o]=t.split(Da),[n,s]=e.split(Da),i=qa(r,n);if(i!==void 0)return i||Ma(o,s)}var _z=/\/|:/,yz=/^(?:[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 bz(t){return _z.test(t)&&yz.test(t)}var Lm=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function vz(t){return Lm.lastIndex=0,Lm.test(t)}var wz=-(2**31),$z=2**31-1;function zz(t){return Number.isInteger(t)&&t<=$z&&t>=wz}function kz(t){return Number.isInteger(t)}function Um(){return!0}var xz=/[^\\]\\Z/;function Sz(t){if(xz.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Wm=v(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.formatLimitDefinition=void 0;var Pz=Za(),Ue=I(),_t=Ue.operators,En={formatMaximum:{okStr:"<=",ok:_t.LTE,fail:_t.GT},formatMinimum:{okStr:">=",ok:_t.GTE,fail:_t.LT},formatExclusiveMaximum:{okStr:"<",ok:_t.LT,fail:_t.GTE},formatExclusiveMinimum:{okStr:">",ok:_t.GT,fail:_t.LTE}},Ez={message:({keyword:t,schemaCode:e})=>(0,Ue.str)`should be ${En[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ue._)`{comparison: ${En[t].okStr}, limit: ${e}}`};nr.formatLimitDefinition={keyword:Object.keys(En),type:"string",schemaType:"string",$data:!0,error:Ez,code(t){let{gen:e,data:r,schemaCode:o,keyword:n,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new Pz.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=e.const("fmt",(0,Ue._)`${p}[${c.schemaCode}]`);t.fail$data((0,Ue.or)((0,Ue._)`typeof ${f} != "object"`,(0,Ue._)`${f} instanceof RegExp`,(0,Ue._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:i.code.formats?(0,Ue._)`${i.code.formats}${(0,Ue.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,Ue._)`${p}.compare(${r}, ${o}) ${En[n].fail} 0`}},dependencies:["format"]};var Tz=t=>(t.addKeyword(nr.formatLimitDefinition),t);nr.default=Tz});var Qm=v((uo,Ym)=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});var sr=Bm(),Rz=Wm(),La=I(),Km=new La.Name("fullFormats"),Oz=new La.Name("fastFormats"),Ua=(t,e={keywords:!0})=>{if(Array.isArray(e))return Gm(t,e,sr.fullFormats,Km),t;let[r,o]=e.mode==="fast"?[sr.fastFormats,Oz]:[sr.fullFormats,Km],n=e.formats||sr.formatNames;return Gm(t,n,r,o),e.keywords&&(0,Rz.default)(t),t};Ua.get=(t,e="full")=>{let o=(e==="fast"?sr.fastFormats:sr.fullFormats)[t];if(!o)throw new Error(`Unknown format "${t}"`);return o};function Gm(t,e,r,o){var n,s;(n=(s=t.opts.code).formats)!==null&&n!==void 0||(s.formats=(0,La._)`require("ajv-formats/dist/formats").${o}`);for(let i of e)t.addFormat(i,r[i])}Ym.exports=uo=Ua;Object.defineProperty(uo,"__esModule",{value:!0});uo.default=Ua});var Ba;function g(t,e,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Fe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Ba=globalThis).__zod_globalConfig??(Ba.__zod_globalConfig={});var It=globalThis.__zod_globalConfig;function xe(t){return t&&Object.assign(It,t),It}var D={};Ja(D,{BIGINT_FORMAT_RANGES:()=>Ya,Class:()=>Dn,NUMBER_FORMAT_RANGES:()=>Vn,aborted:()=>st,allowsEval:()=>Ln,assert:()=>gh,assertEqual:()=>ph,assertIs:()=>mh,assertNever:()=>hh,assertNotEqual:()=>fh,assignProp:()=>ot,base64ToUint8Array:()=>Xa,base64urlToUint8Array:()=>Nh,cached:()=>At,captureStackTrace:()=>mo,cleanEnum:()=>Ih,cleanRegex:()=>dr,clone:()=>Ce,cloneDef:()=>yh,createTransparentProxy:()=>kh,defineLazy:()=>U,esc:()=>fo,escapeRegex:()=>Ge,explicitlyAborted:()=>Jn,extend:()=>Ph,finalizeIssue:()=>Re,floatSafeRemainder:()=>qn,getElementAtPath:()=>bh,getEnumValues:()=>ur,getLengthableOrigin:()=>pr,getParsedType:()=>zh,getSizableOrigin:()=>Qa,hexToUint8Array:()=>Zh,isObject:()=>yt,isPlainObject:()=>nt,issue:()=>Zt,joinValues:()=>po,jsonStringifyReplacer:()=>Nt,merge:()=>Th,mergeDefs:()=>Ke,normalizeParams:()=>E,nullish:()=>lr,numKeys:()=>$h,objectClone:()=>_h,omit:()=>Sh,optionalKeys:()=>Fn,parsedType:()=>Hn,partial:()=>Rh,pick:()=>xh,prefixIssues:()=>Ye,primitiveTypes:()=>Ga,promiseAllObject:()=>vh,propertyKeyTypes:()=>Un,randomString:()=>wh,required:()=>Oh,safeExtend:()=>Eh,shallowClone:()=>Ka,slugify:()=>Mn,stringifyPrimitive:()=>ho,uint8ArrayToBase64:()=>ec,uint8ArrayToBase64url:()=>Ah,uint8ArrayToHex:()=>jh,unwrapMessage:()=>cr});function ph(t){return t}function fh(t){return t}function mh(t){}function hh(t){throw new Error("Unexpected value in exhaustive check")}function gh(t){}function ur(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,n])=>e.indexOf(+o)===-1).map(([o,n])=>n)}function po(t,e="|"){return t.map(r=>ho(r)).join(e)}function Nt(t,e){return typeof e=="bigint"?e.toString():e}function At(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function lr(t){return t==null}function dr(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function qn(t,e){let r=t/e,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Wa=Symbol("evaluating");function U(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==Wa)return o===void 0&&(o=Wa,o=r()),o},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function _h(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ot(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ke(...t){let e={};for(let r of t){let o=Object.getOwnPropertyDescriptors(r);Object.assign(e,o)}return Object.defineProperties({},e)}function yh(t){return Ke(t._zod.def)}function bh(t,e){return e?e.reduce((r,o)=>r?.[o],t):t}function vh(t){let e=Object.keys(t),r=e.map(o=>t[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<e.length;s++)n[e[s]]=o[s];return n})}function wh(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<t;o++)r+=e[Math.floor(Math.random()*e.length)];return r}function fo(t){return JSON.stringify(t)}function Mn(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mo="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function yt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Ln=At(()=>{if(It.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nt(t){if(yt(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(yt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ka(t){return nt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function $h(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var zh=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Un=new Set(["string","number","symbol"]),Ga=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(t,e,r){let o=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(o._zod.parent=t),o}function E(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function kh(t){let e;return new Proxy({},{get(r,o,n){return e??(e=t()),Reflect.get(e,o,n)},set(r,o,n,s){return e??(e=t()),Reflect.set(e,o,n,s)},has(r,o){return e??(e=t()),Reflect.has(e,o)},deleteProperty(r,o){return e??(e=t()),Reflect.deleteProperty(e,o)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,o){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(r,o,n){return e??(e=t()),Reflect.defineProperty(e,o,n)}})}function ho(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Fn(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Vn={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]},Ya={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xh(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Ke(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return ot(this,"shape",i),i},checks:[]});return Ce(t,s)}function Sh(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Ke(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return ot(this,"shape",i),i},checks:[]});return Ce(t,s)}function Ph(t,e){if(!nt(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ke(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return ot(this,"shape",s),s}});return Ce(t,n)}function Eh(t,e){if(!nt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ke(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return ot(this,"shape",o),o}});return Ce(t,r)}function Th(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ke(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e._zod.def.shape};return ot(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ce(t,r)}function Rh(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Ke(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return ot(this,"shape",c),c},checks:[]});return Ce(e,i)}function Oh(t,e,r){let o=Ke(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new t({type:"nonoptional",innerType:n[i]});return ot(this,"shape",s),s}});return Ce(e,o)}function st(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Jn(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ye(t,e){return e.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(t),r})}function cr(t){return typeof t=="string"?t:t?.message}function Re(t,e,r){let o=t.message?t.message:cr(t.inst?._zod.def?.error?.(t))??cr(e?.error?.(t))??cr(r.customError?.(t))??cr(r.localeError?.(t))??"Invalid input",{inst:n,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=o,e?.reportInput&&(a.input=i),a}function Qa(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function pr(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Hn(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Zt(...t){let[e,r,o]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:o}:{...e}}function Ih(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Xa(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r}function ec(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Nh(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Xa(e+r)}function Ah(t){return ec(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zh(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let o=0;o<e.length;o+=2)r[o/2]=Number.parseInt(e.slice(o,o+2),16);return r}function jh(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Dn=class{constructor(...e){}};var tc=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Nt,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},go=g("$ZodError",tc),Bn=g("$ZodError",tc,{Parent:Error});function rc(t,e=r=>r.message){let r={},o=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):o.push(e(n));return{formErrors:o,fieldErrors:r}}function oc(t,e=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(t),r}var _o=t=>(e,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Fe;if(i.issues.length){let a=new(n?.Err??t)(i.issues.map(c=>Re(c,s,xe())));throw mo(a,n?.callee),a}return i.value};var yo=t=>async(e,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??t)(i.issues.map(c=>Re(c,s,xe())));throw mo(a,n?.callee),a}return i.value};var fr=t=>(e,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Fe;return s.issues.length?{success:!1,error:new(t??go)(s.issues.map(i=>Re(i,n,xe())))}:{success:!0,data:s.value}},mr=fr(Bn),hr=t=>async(e,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>Re(i,n,xe())))}:{success:!0,data:s.value}},bo=hr(Bn),nc=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return _o(t)(e,r,n)};var sc=t=>(e,r,o)=>_o(t)(e,r,o);var ic=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yo(t)(e,r,n)};var ac=t=>async(e,r,o)=>yo(t)(e,r,o);var cc=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fr(t)(e,r,n)};var uc=t=>(e,r,o)=>fr(t)(e,r,o);var lc=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return hr(t)(e,r,n)};var dc=t=>async(e,r,o)=>hr(t)(e,r,o);var pc=/^[cC][0-9a-z]{6,}$/,fc=/^[0-9a-z]+$/,mc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hc=/^[0-9a-vA-V]{20}$/,gc=/^[A-Za-z0-9]{27}$/,_c=/^[a-zA-Z0-9_-]{21}$/,yc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var bc=/^([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})$/,Wn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var vc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Dh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wc(){return new RegExp(Dh,"u")}var $c=/^(?:(?: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])$/,zc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var kc=/^((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])$/,xc=/^(([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])$/,Sc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kn=/^[A-Za-z0-9_-]*$/;var Pc=/^https?$/,Ec=/^\+[1-9]\d{6,14}$/,Tc="(?:(?:\\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])))",Rc=new RegExp(`^${Tc}$`);function Oc(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ic(t){return new RegExp(`^${Oc(t)}$`)}function Nc(t){let e=Oc({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${r.join("|")})`;return new RegExp(`^${Tc}T(?:${o})$`)}var Ac=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Zc=/^-?\d+$/,Gn=/^-?\d+(?:\.\d+)?$/,jc=/^(?:true|false)$/i,Cc=/^null$/i;var Dc=/^[^A-Z]*$/,qc=/^[^a-z]*$/;var ie=g("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Mc={number:"number",bigint:"bigint",object:"date"},Yn=g("$ZodCheckLessThan",(t,e)=>{ie.init(t,e);let r=Mc[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Qn=g("$ZodCheckGreaterThan",(t,e)=>{ie.init(t,e);let r=Mc[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Lc=g("$ZodCheckMultipleOf",(t,e)=>{ie.init(t,e),t._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):qn(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Uc=g("$ZodCheckNumberFormat",(t,e)=>{ie.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),o=r?"int":"number",[n,s]=Vn[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,r&&(a.pattern=Zc)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Fc=g("$ZodCheckMaxLength",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let n=o.value;if(n.length<=e.maximum)return;let i=pr(n);o.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Vc=g("$ZodCheckMinLength",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let n=o.value;if(n.length>=e.minimum)return;let i=pr(n);o.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Jc=g("$ZodCheckLengthEquals",(t,e)=>{var r;ie.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!lr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=o=>{let n=o.value,s=n.length;if(s===e.length)return;let i=pr(n),a=s>e.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),gr=g("$ZodCheckStringFormat",(t,e)=>{var r,o;ie.init(t,e),t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),Hc=g("$ZodCheckRegex",(t,e)=>{gr.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Bc=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Dc),gr.init(t,e)}),Wc=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=qc),gr.init(t,e)}),Kc=g("$ZodCheckIncludes",(t,e)=>{ie.init(t,e);let r=Ge(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),Gc=g("$ZodCheckStartsWith",(t,e)=>{ie.init(t,e);let r=new RegExp(`^${Ge(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:t,continue:!e.abort})}}),Yc=g("$ZodCheckEndsWith",(t,e)=>{ie.init(t,e);let r=new RegExp(`.*${Ge(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:t,continue:!e.abort})}});var Qc=g("$ZodCheckOverwrite",(t,e)=>{ie.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var wo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
10
10
  `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,n.join(`
11
- `))}};var eu={major:4,minor:4,patch:3};var B=g("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=eu;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let n of o)for(let s of n._zod.onattach)s(t);if(o.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(i,a,c)=>{let u=st(i),l;for(let d of a){if(d._zod.def.when){if(Jn(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,f=d._zod.check(i);if(f instanceof Promise&&c?.async===!1)throw new Fe;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,i.issues.length!==p&&(u||(u=st(i,p)))});else{if(i.issues.length===p)continue;u||(u=st(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(st(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Fe;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Fe;return c.then(u=>n(u,o,a))}return n(c,o,a)}}U(t,"~standard",()=>({validate:n=>{try{let s=mr(t,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vo(t,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),zo=g("$ZodString",(t,e)=>{B.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ac(t._zod.bag),t._zod.parse=(r,o)=>{if(e.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:t}),r}}),W=g("$ZodStringFormat",(t,e)=>{gr.init(t,e),zo.init(t,e)}),uu=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=vc),W.init(t,e)}),lu=g("$ZodUUID",(t,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Wn(o))}else e.pattern??(e.pattern=Wn());W.init(t,e)}),du=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=bc),W.init(t,e)}),pu=g("$ZodURL",(t,e)=>{W.init(t,e),t._zod.check=r=>{try{let o=r.value.trim();if(!e.normalize&&e.protocol?.source===Pc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),fu=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=$c()),W.init(t,e)}),mu=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=_c),W.init(t,e)}),hu=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=pc),W.init(t,e)}),gu=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=fc),W.init(t,e)}),_u=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=mc),W.init(t,e)}),yu=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=hc),W.init(t,e)}),vu=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=gc),W.init(t,e)}),bu=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Nc(e)),W.init(t,e)}),$u=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Rc),W.init(t,e)}),wu=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Ic(e)),W.init(t,e)}),xu=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=yc),W.init(t,e)}),zu=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=wc),W.init(t,e),t._zod.bag.format="ipv4"}),ku=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=xc),W.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var Su=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=zc),W.init(t,e)}),Pu=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=kc),W.init(t,e),t._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)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:t,continue:!e.abort})}}});function Eu(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Tu=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Sc),W.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Eu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Lh(t){if(!Kn.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Eu(r)}var Ru=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Kn),W.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Lh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Ou=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Ec),W.init(t,e)});function Uh(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var Iu=g("$ZodJWT",(t,e)=>{W.init(t,e),t._zod.check=r=>{Uh(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var es=g("$ZodNumber",(t,e)=>{B.init(t,e),t._zod.pattern=t._zod.bag.pattern??Gn,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...s?{received:s}:{}}),r}}),Nu=g("$ZodNumberFormat",(t,e)=>{Uc.init(t,e),es.init(t,e)}),Au=g("$ZodBoolean",(t,e)=>{B.init(t,e),t._zod.pattern=jc,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}});var Zu=g("$ZodNull",(t,e)=>{B.init(t,e),t._zod.pattern=Cc,t._zod.values=new Set([null]),t._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}});var ju=g("$ZodUnknown",(t,e)=>{B.init(t,e),t._zod.parse=r=>r}),Cu=g("$ZodNever",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function tu(t,e,r){t.issues.length&&e.issues.push(...Ye(r,t.issues)),e.value[r]=t.value}var Du=g("$ZodArray",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=e.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>tu(u,r,i))):tu(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function xo(t,e,r,o,n,s){let i=r in o;if(t.issues.length){if(n&&s&&!i)return;e.issues.push(...Ye(r,t.issues))}if(!i&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function qu(t){let e=Object.keys(t.shape);for(let o of e)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Fn(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Mu(t,e,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let p in e){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let f=c.run({value:e[p],issues:[]},o);f instanceof Promise?t.push(f.then(m=>xo(m,r,p,e,l,d))):xo(f,r,p,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var Fh=g("$ZodObject",(t,e)=>{if(B.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let o=At(()=>qu(e));U(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=yt,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let p of i.keys){let f=d[p],m=f._zod.optin==="optional",_=f._zod.optout==="optional",y=f._zod.run({value:u[p],issues:[]},c);y instanceof Promise?l.push(y.then(v=>xo(v,a,p,u,m,_))):xo(y,a,p,u,m,_)}return s?Mu(l,u,a,c,o.value,t):l.length?Promise.all(l).then(()=>a):a}}),Lu=g("$ZodObjectJIT",(t,e)=>{Fh.init(t,e);let r=t._zod.parse,o=At(()=>qu(e)),n=p=>{let f=new $o(["shape","payload","ctx"]),m=o.value,_=x=>{let S=fo(x);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),v=0;for(let x of m.keys)y[x]=`key_${v++}`;f.write("const newResult = {};");for(let x of m.keys){let S=y[x],w=fo(x),ze=p[x],Ee=ze?._zod?.optin==="optional",ir=ze?._zod?.optout==="optional";f.write(`const ${S} = ${_(x)};`),Ee&&ir?f.write(`
11
+ `))}};var eu={major:4,minor:4,patch:3};var B=g("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=eu;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let n of o)for(let s of n._zod.onattach)s(t);if(o.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(i,a,c)=>{let u=st(i),l;for(let d of a){if(d._zod.def.when){if(Jn(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,f=d._zod.check(i);if(f instanceof Promise&&c?.async===!1)throw new Fe;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,i.issues.length!==p&&(u||(u=st(i,p)))});else{if(i.issues.length===p)continue;u||(u=st(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(st(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Fe;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Fe;return c.then(u=>n(u,o,a))}return n(c,o,a)}}U(t,"~standard",()=>({validate:n=>{try{let s=mr(t,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return bo(t,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),ko=g("$ZodString",(t,e)=>{B.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ac(t._zod.bag),t._zod.parse=(r,o)=>{if(e.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:t}),r}}),W=g("$ZodStringFormat",(t,e)=>{gr.init(t,e),ko.init(t,e)}),uu=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=bc),W.init(t,e)}),lu=g("$ZodUUID",(t,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Wn(o))}else e.pattern??(e.pattern=Wn());W.init(t,e)}),du=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=vc),W.init(t,e)}),pu=g("$ZodURL",(t,e)=>{W.init(t,e),t._zod.check=r=>{try{let o=r.value.trim();if(!e.normalize&&e.protocol?.source===Pc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),fu=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=wc()),W.init(t,e)}),mu=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=_c),W.init(t,e)}),hu=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=pc),W.init(t,e)}),gu=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=fc),W.init(t,e)}),_u=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=mc),W.init(t,e)}),yu=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=hc),W.init(t,e)}),bu=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=gc),W.init(t,e)}),vu=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Nc(e)),W.init(t,e)}),wu=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Rc),W.init(t,e)}),$u=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Ic(e)),W.init(t,e)}),zu=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=yc),W.init(t,e)}),ku=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=$c),W.init(t,e),t._zod.bag.format="ipv4"}),xu=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=zc),W.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var Su=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=kc),W.init(t,e)}),Pu=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=xc),W.init(t,e),t._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)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:t,continue:!e.abort})}}});function Eu(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Tu=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Sc),W.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Eu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Lh(t){if(!Kn.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Eu(r)}var Ru=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Kn),W.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Lh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Ou=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Ec),W.init(t,e)});function Uh(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var Iu=g("$ZodJWT",(t,e)=>{W.init(t,e),t._zod.check=r=>{Uh(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var es=g("$ZodNumber",(t,e)=>{B.init(t,e),t._zod.pattern=t._zod.bag.pattern??Gn,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...s?{received:s}:{}}),r}}),Nu=g("$ZodNumberFormat",(t,e)=>{Uc.init(t,e),es.init(t,e)}),Au=g("$ZodBoolean",(t,e)=>{B.init(t,e),t._zod.pattern=jc,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}});var Zu=g("$ZodNull",(t,e)=>{B.init(t,e),t._zod.pattern=Cc,t._zod.values=new Set([null]),t._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}});var ju=g("$ZodUnknown",(t,e)=>{B.init(t,e),t._zod.parse=r=>r}),Cu=g("$ZodNever",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function tu(t,e,r){t.issues.length&&e.issues.push(...Ye(r,t.issues)),e.value[r]=t.value}var Du=g("$ZodArray",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=e.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>tu(u,r,i))):tu(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function zo(t,e,r,o,n,s){let i=r in o;if(t.issues.length){if(n&&s&&!i)return;e.issues.push(...Ye(r,t.issues))}if(!i&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function qu(t){let e=Object.keys(t.shape);for(let o of e)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Fn(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Mu(t,e,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let p in e){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let f=c.run({value:e[p],issues:[]},o);f instanceof Promise?t.push(f.then(m=>zo(m,r,p,e,l,d))):zo(f,r,p,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var Fh=g("$ZodObject",(t,e)=>{if(B.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let o=At(()=>qu(e));U(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=yt,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let p of i.keys){let f=d[p],m=f._zod.optin==="optional",_=f._zod.optout==="optional",y=f._zod.run({value:u[p],issues:[]},c);y instanceof Promise?l.push(y.then(b=>zo(b,a,p,u,m,_))):zo(y,a,p,u,m,_)}return s?Mu(l,u,a,c,o.value,t):l.length?Promise.all(l).then(()=>a):a}}),Lu=g("$ZodObjectJIT",(t,e)=>{Fh.init(t,e);let r=t._zod.parse,o=At(()=>qu(e)),n=p=>{let f=new wo(["shape","payload","ctx"]),m=o.value,_=z=>{let S=fo(z);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),b=0;for(let z of m.keys)y[z]=`key_${b++}`;f.write("const newResult = {};");for(let z of m.keys){let S=y[z],$=fo(z),ke=p[z],Te=ke?._zod?.optin==="optional",ir=ke?._zod?.optout==="optional";f.write(`const ${S} = ${_(z)};`),Te&&ir?f.write(`
12
12
  if (${S}.issues.length) {
13
- if (${w} in input) {
13
+ if (${$} in input) {
14
14
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
15
15
  ...iss,
16
- path: iss.path ? [${w}, ...iss.path] : [${w}]
16
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
17
17
  })));
18
18
  }
19
19
  }
20
20
 
21
21
  if (${S}.value === undefined) {
22
- if (${w} in input) {
23
- newResult[${w}] = undefined;
22
+ if (${$} in input) {
23
+ newResult[${$}] = undefined;
24
24
  }
25
25
  } else {
26
- newResult[${w}] = ${S}.value;
26
+ newResult[${$}] = ${S}.value;
27
27
  }
28
28
 
29
- `):Ee?f.write(`
29
+ `):Te?f.write(`
30
30
  if (${S}.issues.length) {
31
31
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
32
32
  ...iss,
33
- path: iss.path ? [${w}, ...iss.path] : [${w}]
33
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
34
34
  })));
35
35
  }
36
36
 
37
37
  if (${S}.value === undefined) {
38
- if (${w} in input) {
39
- newResult[${w}] = undefined;
38
+ if (${$} in input) {
39
+ newResult[${$}] = undefined;
40
40
  }
41
41
  } else {
42
- newResult[${w}] = ${S}.value;
42
+ newResult[${$}] = ${S}.value;
43
43
  }
44
44
 
45
45
  `):f.write(`
46
- const ${S}_present = ${w} in input;
46
+ const ${S}_present = ${$} in input;
47
47
  if (${S}.issues.length) {
48
48
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
49
49
  ...iss,
50
- path: iss.path ? [${w}, ...iss.path] : [${w}]
50
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
51
51
  })));
52
52
  }
53
53
  if (!${S}_present && !${S}.issues.length) {
@@ -55,23 +55,23 @@ var ih=Object.create;var jn=Object.defineProperty;var ah=Object.getOwnPropertyDe
55
55
  code: "invalid_type",
56
56
  expected: "nonoptional",
57
57
  input: undefined,
58
- path: [${w}]
58
+ path: [${$}]
59
59
  });
60
60
  }
61
61
 
62
62
  if (${S}_present) {
63
63
  if (${S}.value === undefined) {
64
- newResult[${w}] = undefined;
64
+ newResult[${$}] = undefined;
65
65
  } else {
66
- newResult[${w}] = ${S}.value;
66
+ newResult[${$}] = ${S}.value;
67
67
  }
68
68
  }
69
69
 
70
- `)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(x,S)=>P(p,x,S)},s,i=yt,a=!It.jitless,u=a&&Ln.value,l=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=o.value);let m=p.value;return i(m)?a&&u&&f?.async===!1&&f.jitless!==!0?(s||(s=n(e.shape)),p=s(p,f),l?Mu([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function ru(t,e,r,o){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let n=t.filter(s=>!st(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>Te(i,o,ke())))}),e)}var ts=g("$ZodUnion",(t,e)=>{B.init(t,e),U(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),U(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),U(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),U(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>dr(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>ru(a,o,t,n)):ru(i,o,t,n)}});var Uu=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ts.init(t,e);let r=t._zod.parse;U(t._zod,"propValues",()=>{let n={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=At(()=>{let n=e.options,s=new Map;for(let i of n){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(n,s)=>{let i=n.value;if(!yt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),n;let a=o.value.get(i?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(o.value.keys()),input:i,path:[e.discriminator],inst:t}),n)}}),Fu=g("$ZodIntersection",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value,s=e.left._zod.run({value:n,issues:[]},o),i=e.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>ou(r,c,u)):ou(r,s,i)}});function Xn(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(nt(t)&&nt(e)){let r=Object.keys(e),o=Object.keys(t).filter(s=>r.indexOf(s)!==-1),n={...t,...e};for(let s of o){let i=Xn(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let n=t[o],s=e[o],i=Xn(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ou(t,e,r){let o=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else t.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&t.issues.push({...n,keys:s}),st(t))return t;let i=Xn(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var Vu=g("$ZodRecord",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!nt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Te(f,o,ke())),input:u,path:[u],inst:t});continue}let d=l.value,p=e.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?s.push(p.then(f=>{f.issues.length&&r.issues.push(...Ye(u,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...Ye(u,p.issues)),r.value[d]=p.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Gn.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Te(d,o,ke())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Ye(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ye(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Ju=g("$ZodEnum",(t,e)=>{B.init(t,e);let r=ur(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(n=>Un.has(typeof n)).map(n=>typeof n=="string"?Ge(n):n.toString()).join("|")})$`),t._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:t}),n}}),Hu=g("$ZodLiteral",(t,e)=>{if(B.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?Ge(o):o?Ge(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),o}});var Bu=g("$ZodTransform",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ot(t.constructor.name);let n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r.fallback=!0,r));if(n instanceof Promise)throw new Fe;return r.value=n,r.fallback=!0,r}});function nu(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var rs=g("$ZodOptional",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.optout="optional",U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dr(r.source)})?$`):void 0}),t._zod.parse=(r,o)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,s=e.innerType._zod.run(r,o);return s instanceof Promise?s.then(i=>nu(i,n)):nu(s,n)}return r.value===void 0?r:e.innerType._zod.run(r,o)}}),Wu=g("$ZodExactOptional",(t,e)=>{rs.init(t,e),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,o)=>e.innerType._zod.run(r,o)}),Ku=g("$ZodNullable",(t,e)=>{B.init(t,e),U(t._zod,"optin",()=>e.innerType._zod.optin),U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dr(r.source)}|null)$`):void 0}),U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,o)=>r.value===null?r:e.innerType._zod.run(r,o)}),Gu=g("$ZodDefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>su(s,e)):su(n,e)}});function su(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Yu=g("$ZodPrefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,o))}),Qu=g("$ZodNonOptional",(t,e)=>{B.init(t,e),U(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),t._zod.parse=(r,o)=>{let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>iu(s,t)):iu(n,t)}});function iu(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var Xu=g("$ZodCatch",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>Te(i,o,ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(s=>Te(s,o,ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var os=g("$ZodPipe",(t,e)=>{B.init(t,e),U(t._zod,"values",()=>e.in._zod.values),U(t._zod,"optin",()=>e.in._zod.optin),U(t._zod,"optout",()=>e.out._zod.optout),U(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=e.out._zod.run(r,o);return s instanceof Promise?s.then(i=>wo(i,e.in,o)):wo(s,e.in,o)}let n=e.in._zod.run(r,o);return n instanceof Promise?n.then(s=>wo(s,e.out,o)):wo(n,e.out,o)}});function wo(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var el=g("$ZodPreprocess",(t,e)=>{os.init(t,e)}),tl=g("$ZodReadonly",(t,e)=>{B.init(t,e),U(t._zod,"propValues",()=>e.innerType._zod.propValues),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"optin",()=>e.innerType?._zod?.optin),U(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(au):au(n)}});function au(t){return t.value=Object.freeze(t.value),t}var rl=g("$ZodCustom",(t,e)=>{ie.init(t,e),B.init(t,e),t._zod.parse=(r,o)=>r,t._zod.check=r=>{let o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(s=>cu(s,r,o,t));cu(n,r,o,t)}});function cu(t,e,r,o){if(!t){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),e.issues.push(Zt(n))}}var Vh=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=Hn(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${ho(n.values[0])}`:`Invalid option: expected one of ${po(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=e(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=e(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${po(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function ol(){return{localeError:Vh()}}var nl;var ns=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let o=r[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Jh(){return new ns}(nl=globalThis).__zod_globalRegistry??(nl.__zod_globalRegistry=Jh());var vt=globalThis.__zod_globalRegistry;function sl(t,e){return new t({type:"string",...E(e)})}function il(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function ss(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function al(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function cl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function ul(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function ll(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function dl(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function pl(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function fl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function ml(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function hl(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function gl(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function _l(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function yl(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function vl(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function bl(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function $l(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function wl(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function xl(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function zl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function kl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Sl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function Pl(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function El(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Tl(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Rl(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Ol(t,e){return new t({type:"number",checks:[],...E(e)})}function Il(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Nl(t,e){return new t({type:"boolean",...E(e)})}function Al(t,e){return new t({type:"null",...E(e)})}function Zl(t){return new t({type:"unknown"})}function jl(t,e){return new t({type:"never",...E(e)})}function ko(t,e){return new Yn({check:"less_than",...E(e),value:t,inclusive:!1})}function _r(t,e){return new Yn({check:"less_than",...E(e),value:t,inclusive:!0})}function So(t,e){return new Qn({check:"greater_than",...E(e),value:t,inclusive:!1})}function yr(t,e){return new Qn({check:"greater_than",...E(e),value:t,inclusive:!0})}function Po(t,e){return new Lc({check:"multiple_of",...E(e),value:t})}function Eo(t,e){return new Fc({check:"max_length",...E(e),maximum:t})}function jt(t,e){return new Vc({check:"min_length",...E(e),minimum:t})}function To(t,e){return new Jc({check:"length_equals",...E(e),length:t})}function is(t,e){return new Hc({check:"string_format",format:"regex",...E(e),pattern:t})}function as(t){return new Bc({check:"string_format",format:"lowercase",...E(t)})}function cs(t){return new Wc({check:"string_format",format:"uppercase",...E(t)})}function us(t,e){return new Kc({check:"string_format",format:"includes",...E(e),includes:t})}function ls(t,e){return new Gc({check:"string_format",format:"starts_with",...E(e),prefix:t})}function ds(t,e){return new Yc({check:"string_format",format:"ends_with",...E(e),suffix:t})}function it(t){return new Qc({check:"overwrite",tx:t})}function ps(t){return it(e=>e.normalize(t))}function fs(){return it(t=>t.trim())}function ms(){return it(t=>t.toLowerCase())}function hs(){return it(t=>t.toUpperCase())}function gs(){return it(t=>Mn(t))}function Cl(t,e,r){return new t({type:"array",element:e,...E(r)})}function Dl(t,e,r){let o=E(r);return o.abort??(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}function ql(t,e,r){return new t({type:"custom",check:"custom",fn:e,...E(r)})}function Ml(t,e){let r=Hh(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Zt(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(Zt(s))}},t(o.value,o)),e);return r}function Hh(t,e){let r=new ie({check:"custom",...E(e)});return r._zod.check=t,r}function _s(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??vt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function re(t,e,r={path:[],schemaPath:[]}){var o;let n=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let p=i.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),re(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&he(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function ys(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,p=t.external.uri??(m=>m);if(d)return{ref:p(d)};let f=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
70
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(z,S)=>P(p,z,S)},s,i=yt,a=!It.jitless,u=a&&Ln.value,l=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=o.value);let m=p.value;return i(m)?a&&u&&f?.async===!1&&f.jitless!==!0?(s||(s=n(e.shape)),p=s(p,f),l?Mu([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function ru(t,e,r,o){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let n=t.filter(s=>!st(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>Re(i,o,xe())))}),e)}var ts=g("$ZodUnion",(t,e)=>{B.init(t,e),U(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),U(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),U(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),U(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>dr(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>ru(a,o,t,n)):ru(i,o,t,n)}});var Uu=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ts.init(t,e);let r=t._zod.parse;U(t._zod,"propValues",()=>{let n={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=At(()=>{let n=e.options,s=new Map;for(let i of n){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(n,s)=>{let i=n.value;if(!yt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),n;let a=o.value.get(i?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(o.value.keys()),input:i,path:[e.discriminator],inst:t}),n)}}),Fu=g("$ZodIntersection",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value,s=e.left._zod.run({value:n,issues:[]},o),i=e.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>ou(r,c,u)):ou(r,s,i)}});function Xn(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(nt(t)&&nt(e)){let r=Object.keys(e),o=Object.keys(t).filter(s=>r.indexOf(s)!==-1),n={...t,...e};for(let s of o){let i=Xn(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let n=t[o],s=e[o],i=Xn(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ou(t,e,r){let o=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else t.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&t.issues.push({...n,keys:s}),st(t))return t;let i=Xn(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var Vu=g("$ZodRecord",(t,e)=>{B.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!nt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Re(f,o,xe())),input:u,path:[u],inst:t});continue}let d=l.value,p=e.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?s.push(p.then(f=>{f.issues.length&&r.issues.push(...Ye(u,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...Ye(u,p.issues)),r.value[d]=p.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Gn.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Re(d,o,xe())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Ye(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ye(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Ju=g("$ZodEnum",(t,e)=>{B.init(t,e);let r=ur(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(n=>Un.has(typeof n)).map(n=>typeof n=="string"?Ge(n):n.toString()).join("|")})$`),t._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:t}),n}}),Hu=g("$ZodLiteral",(t,e)=>{if(B.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?Ge(o):o?Ge(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),o}});var Bu=g("$ZodTransform",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ot(t.constructor.name);let n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r.fallback=!0,r));if(n instanceof Promise)throw new Fe;return r.value=n,r.fallback=!0,r}});function nu(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var rs=g("$ZodOptional",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.optout="optional",U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dr(r.source)})?$`):void 0}),t._zod.parse=(r,o)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,s=e.innerType._zod.run(r,o);return s instanceof Promise?s.then(i=>nu(i,n)):nu(s,n)}return r.value===void 0?r:e.innerType._zod.run(r,o)}}),Wu=g("$ZodExactOptional",(t,e)=>{rs.init(t,e),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,o)=>e.innerType._zod.run(r,o)}),Ku=g("$ZodNullable",(t,e)=>{B.init(t,e),U(t._zod,"optin",()=>e.innerType._zod.optin),U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dr(r.source)}|null)$`):void 0}),U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,o)=>r.value===null?r:e.innerType._zod.run(r,o)}),Gu=g("$ZodDefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>su(s,e)):su(n,e)}});function su(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Yu=g("$ZodPrefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,o))}),Qu=g("$ZodNonOptional",(t,e)=>{B.init(t,e),U(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),t._zod.parse=(r,o)=>{let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>iu(s,t)):iu(n,t)}});function iu(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var Xu=g("$ZodCatch",(t,e)=>{B.init(t,e),t._zod.optin="optional",U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>Re(i,o,xe()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(s=>Re(s,o,xe()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var os=g("$ZodPipe",(t,e)=>{B.init(t,e),U(t._zod,"values",()=>e.in._zod.values),U(t._zod,"optin",()=>e.in._zod.optin),U(t._zod,"optout",()=>e.out._zod.optout),U(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=e.out._zod.run(r,o);return s instanceof Promise?s.then(i=>$o(i,e.in,o)):$o(s,e.in,o)}let n=e.in._zod.run(r,o);return n instanceof Promise?n.then(s=>$o(s,e.out,o)):$o(n,e.out,o)}});function $o(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var el=g("$ZodPreprocess",(t,e)=>{os.init(t,e)}),tl=g("$ZodReadonly",(t,e)=>{B.init(t,e),U(t._zod,"propValues",()=>e.innerType._zod.propValues),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"optin",()=>e.innerType?._zod?.optin),U(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(au):au(n)}});function au(t){return t.value=Object.freeze(t.value),t}var rl=g("$ZodCustom",(t,e)=>{ie.init(t,e),B.init(t,e),t._zod.parse=(r,o)=>r,t._zod.check=r=>{let o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(s=>cu(s,r,o,t));cu(n,r,o,t)}});function cu(t,e,r,o){if(!t){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),e.issues.push(Zt(n))}}var Vh=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=Hn(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${ho(n.values[0])}`:`Invalid option: expected one of ${po(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=e(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=e(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${po(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function ol(){return{localeError:Vh()}}var nl;var ns=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let o=r[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Jh(){return new ns}(nl=globalThis).__zod_globalRegistry??(nl.__zod_globalRegistry=Jh());var bt=globalThis.__zod_globalRegistry;function sl(t,e){return new t({type:"string",...E(e)})}function il(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function ss(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function al(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function cl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function ul(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function ll(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function dl(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function pl(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function fl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function ml(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function hl(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function gl(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function _l(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function yl(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function bl(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function vl(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function wl(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function $l(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function zl(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function kl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function xl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Sl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function Pl(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function El(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Tl(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Rl(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Ol(t,e){return new t({type:"number",checks:[],...E(e)})}function Il(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Nl(t,e){return new t({type:"boolean",...E(e)})}function Al(t,e){return new t({type:"null",...E(e)})}function Zl(t){return new t({type:"unknown"})}function jl(t,e){return new t({type:"never",...E(e)})}function xo(t,e){return new Yn({check:"less_than",...E(e),value:t,inclusive:!1})}function _r(t,e){return new Yn({check:"less_than",...E(e),value:t,inclusive:!0})}function So(t,e){return new Qn({check:"greater_than",...E(e),value:t,inclusive:!1})}function yr(t,e){return new Qn({check:"greater_than",...E(e),value:t,inclusive:!0})}function Po(t,e){return new Lc({check:"multiple_of",...E(e),value:t})}function Eo(t,e){return new Fc({check:"max_length",...E(e),maximum:t})}function jt(t,e){return new Vc({check:"min_length",...E(e),minimum:t})}function To(t,e){return new Jc({check:"length_equals",...E(e),length:t})}function is(t,e){return new Hc({check:"string_format",format:"regex",...E(e),pattern:t})}function as(t){return new Bc({check:"string_format",format:"lowercase",...E(t)})}function cs(t){return new Wc({check:"string_format",format:"uppercase",...E(t)})}function us(t,e){return new Kc({check:"string_format",format:"includes",...E(e),includes:t})}function ls(t,e){return new Gc({check:"string_format",format:"starts_with",...E(e),prefix:t})}function ds(t,e){return new Yc({check:"string_format",format:"ends_with",...E(e),suffix:t})}function it(t){return new Qc({check:"overwrite",tx:t})}function ps(t){return it(e=>e.normalize(t))}function fs(){return it(t=>t.trim())}function ms(){return it(t=>t.toLowerCase())}function hs(){return it(t=>t.toUpperCase())}function gs(){return it(t=>Mn(t))}function Cl(t,e,r){return new t({type:"array",element:e,...E(r)})}function Dl(t,e,r){let o=E(r);return o.abort??(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}function ql(t,e,r){return new t({type:"custom",check:"custom",fn:e,...E(r)})}function Ml(t,e){let r=Hh(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Zt(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(Zt(s))}},t(o.value,o)),e);return r}function Hh(t,e){let r=new ie({check:"custom",...E(e)});return r._zod.check=t,r}function _s(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??bt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function re(t,e,r={path:[],schemaPath:[]}){var o;let n=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let p=i.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),re(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&he(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function ys(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,p=t.external.uri??(m=>m);if(d)return{ref:p(d)};let f=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
71
71
 
72
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function vs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let f=t.seen.get(d),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(m.$ref&&f.def)for(let y in u)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(u[y])===JSON.stringify(f.def[y])&&delete u[y]}let p=a._zod.parent;if(p&&p!==d){o(p);let f=t.seen.get(p);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let m in u)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(u[m])===JSON.stringify(f.def[m])&&delete u[m]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())o(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&n.id===s&&delete n.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:vr(e,"input",t.processors),output:vr(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function he(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return he(o.element,r);if(o.type==="set")return he(o.valueType,r);if(o.type==="lazy")return he(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return he(o.innerType,r);if(o.type==="intersection")return he(o.left,r)||he(o.right,r);if(o.type==="record"||o.type==="map")return he(o.keyType,r)||he(o.valueType,r);if(o.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:he(o.in,r)||he(o.out,r);if(o.type==="object"){for(let n in o.shape)if(he(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(he(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(he(n,r))return!0;return!!(o.rest&&he(o.rest,r))}return!1}var Ll=(t,e={})=>r=>{let o=_s({...r,processors:e});return re(t,o),ys(o,t),vs(o,t)},vr=(t,e,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=_s({...n??{},target:s,io:e,processors:r});return re(t,i),ys(i,t),vs(i,t)};var Bh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ul=(t,e,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=Bh[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Fl=(t,e,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof s=="number"&&(n.minimum=s),p?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof c=="number"&&(n.multipleOf=c)},Vl=(t,e,r,o)=>{r.type="boolean"};var Jl=(t,e,r,o)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Hl=(t,e,r,o)=>{r.not={}};var Bl=(t,e,r,o)=>{};var Wl=(t,e,r,o)=>{let n=t._zod.def,s=ur(n.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},Kl=(t,e,r,o)=>{let n=t._zod.def,s=[];for(let i of n.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var Gl=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var Yl=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var Ql=(t,e,r,o)=>{let n=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=re(s.element,e,{...o,path:[...o.path,"items"]})},Xl=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=re(i[u],e,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=re(s.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},ed=(t,e,r,o)=>{let n=t._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>re(a,e,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},td=(t,e,r,o)=>{let n=t._zod.def,s=re(n.left,e,{...o,path:[...o.path,"allOf",0]}),i=re(n.right,e,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var rd=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=re(s.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=re(s.keyType,e,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=re(s.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},od=(t,e,r,o)=>{let n=t._zod.def,s=re(n.innerType,e,o),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},nd=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType},sd=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},id=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},ad=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},cd=(t,e,r,o)=>{let n=t._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?n.out:n.in:n.out;re(i,e,o);let a=e.seen.get(t);a.ref=i},ud=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.readOnly=!0};var bs=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType};function Ct(t){return!!t._zod}function at(t,e){return Ct(t)?mr(t,e):t.safeParse(e)}function Ro(t){if(!t)return;let e;if(Ct(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function ld(t){if(Ct(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._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 o=t.value;if(o!==void 0)return o}var $r={};Ja($r,{ZodISODate:()=>pd,ZodISODateTime:()=>dd,ZodISODuration:()=>md,ZodISOTime:()=>fd,date:()=>ws,datetime:()=>$s,duration:()=>zs,time:()=>xs});var dd=g("ZodISODateTime",(t,e)=>{bu.init(t,e),Q.init(t,e)});function $s(t){return Pl(dd,t)}var pd=g("ZodISODate",(t,e)=>{$u.init(t,e),Q.init(t,e)});function ws(t){return El(pd,t)}var fd=g("ZodISOTime",(t,e)=>{wu.init(t,e),Q.init(t,e)});function xs(t){return Tl(fd,t)}var md=g("ZodISODuration",(t,e)=>{xu.init(t,e),Q.init(t,e)});function zs(t){return Rl(md,t)}var rg=(t,e)=>{go.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>oc(t,r)},flatten:{value:r=>rc(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Nt,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Nt,2)}},isEmpty:{get(){return t.issues.length===0}}})};var Se=g("ZodError",rg,{Parent:Error});var hd=_o(Se),gd=yo(Se),_d=fr(Se),yd=hr(Se),vd=nc(Se),bd=sc(Se),$d=ic(Se),wd=ac(Se),xd=cc(Se),zd=uc(Se),kd=lc(Se),Sd=dc(Se);var Pd=new WeakMap;function wr(t,e,r){let o=Object.getPrototypeOf(t),n=Pd.get(o);if(n||(n=new Set,Pd.set(o,n)),!n.has(e)){n.add(e);for(let s in r){let i=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var te=g("ZodType",(t,e)=>(B.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:vr(t,"input"),output:vr(t,"output")}}),t.toJSONSchema=Ll(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,o)=>hd(t,r,o,{callee:t.parse}),t.safeParse=(r,o)=>_d(t,r,o),t.parseAsync=async(r,o)=>gd(t,r,o,{callee:t.parseAsync}),t.safeParseAsync=async(r,o)=>yd(t,r,o),t.spa=t.safeParseAsync,t.encode=(r,o)=>vd(t,r,o),t.decode=(r,o)=>bd(t,r,o),t.encodeAsync=async(r,o)=>$d(t,r,o),t.decodeAsync=async(r,o)=>wd(t,r,o),t.safeEncode=(r,o)=>xd(t,r,o),t.safeDecode=(r,o)=>zd(t,r,o),t.safeEncodeAsync=async(r,o)=>kd(t,r,o),t.safeDecodeAsync=async(r,o)=>Sd(t,r,o),wr(t,"ZodType",{check(...r){let o=this.def;return this.clone(D.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Ce(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Hg(r,o))},superRefine(r,o){return this.check(Bg(r,o))},overwrite(r){return this.check(it(r))},optional(){return ee(this)},exactOptional(){return Ag(this)},nullable(){return Od(this)},nullish(){return ee(Od(this))},nonoptional(r){return Mg(this,r)},array(){return j(this)},or(r){return K([this,r])},and(r){return Io(this,r)},transform(r){return Id(this,Dd(r))},default(r){return Cg(this,r)},prefault(r){return qg(this,r)},catch(r){return Ug(this,r)},pipe(r){return Id(this,r)},readonly(){return Jg(this)},describe(r){let o=this.clone();return vt.add(o,{description:r}),o},meta(...r){if(r.length===0)return vt.get(this);let o=this.clone();return vt.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return vt.get(t)?.description},configurable:!0}),t)),Nd=g("_ZodString",(t,e)=>{zo.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Ul(t,o,n,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,wr(t,"_ZodString",{regex(...o){return this.check(is(...o))},includes(...o){return this.check(us(...o))},startsWith(...o){return this.check(ls(...o))},endsWith(...o){return this.check(ds(...o))},min(...o){return this.check(jt(...o))},max(...o){return this.check(Eo(...o))},length(...o){return this.check(To(...o))},nonempty(...o){return this.check(jt(1,...o))},lowercase(o){return this.check(as(o))},uppercase(o){return this.check(cs(o))},trim(){return this.check(fs())},normalize(...o){return this.check(ps(...o))},toLowerCase(){return this.check(ms())},toUpperCase(){return this.check(hs())},slugify(){return this.check(gs())}})}),ng=g("ZodString",(t,e)=>{zo.init(t,e),Nd.init(t,e),t.email=r=>t.check(il(sg,r)),t.url=r=>t.check(dl(ig,r)),t.jwt=r=>t.check(Sl($g,r)),t.emoji=r=>t.check(pl(ag,r)),t.guid=r=>t.check(ss(Ed,r)),t.uuid=r=>t.check(al(Oo,r)),t.uuidv4=r=>t.check(cl(Oo,r)),t.uuidv6=r=>t.check(ul(Oo,r)),t.uuidv7=r=>t.check(ll(Oo,r)),t.nanoid=r=>t.check(fl(cg,r)),t.guid=r=>t.check(ss(Ed,r)),t.cuid=r=>t.check(ml(ug,r)),t.cuid2=r=>t.check(hl(lg,r)),t.ulid=r=>t.check(gl(dg,r)),t.base64=r=>t.check(xl(yg,r)),t.base64url=r=>t.check(zl(vg,r)),t.xid=r=>t.check(_l(pg,r)),t.ksuid=r=>t.check(yl(fg,r)),t.ipv4=r=>t.check(vl(mg,r)),t.ipv6=r=>t.check(bl(hg,r)),t.cidrv4=r=>t.check($l(gg,r)),t.cidrv6=r=>t.check(wl(_g,r)),t.e164=r=>t.check(kl(bg,r)),t.datetime=r=>t.check($s(r)),t.date=r=>t.check(ws(r)),t.time=r=>t.check(xs(r)),t.duration=r=>t.check(zs(r))});function h(t){return sl(ng,t)}var Q=g("ZodStringFormat",(t,e)=>{W.init(t,e),Nd.init(t,e)}),sg=g("ZodEmail",(t,e)=>{du.init(t,e),Q.init(t,e)});var Ed=g("ZodGUID",(t,e)=>{uu.init(t,e),Q.init(t,e)});var Oo=g("ZodUUID",(t,e)=>{lu.init(t,e),Q.init(t,e)});var ig=g("ZodURL",(t,e)=>{pu.init(t,e),Q.init(t,e)});var ag=g("ZodEmoji",(t,e)=>{fu.init(t,e),Q.init(t,e)});var cg=g("ZodNanoID",(t,e)=>{mu.init(t,e),Q.init(t,e)});var ug=g("ZodCUID",(t,e)=>{hu.init(t,e),Q.init(t,e)});var lg=g("ZodCUID2",(t,e)=>{gu.init(t,e),Q.init(t,e)});var dg=g("ZodULID",(t,e)=>{_u.init(t,e),Q.init(t,e)});var pg=g("ZodXID",(t,e)=>{yu.init(t,e),Q.init(t,e)});var fg=g("ZodKSUID",(t,e)=>{vu.init(t,e),Q.init(t,e)});var mg=g("ZodIPv4",(t,e)=>{zu.init(t,e),Q.init(t,e)});var hg=g("ZodIPv6",(t,e)=>{ku.init(t,e),Q.init(t,e)});var gg=g("ZodCIDRv4",(t,e)=>{Su.init(t,e),Q.init(t,e)});var _g=g("ZodCIDRv6",(t,e)=>{Pu.init(t,e),Q.init(t,e)});var yg=g("ZodBase64",(t,e)=>{Tu.init(t,e),Q.init(t,e)});var vg=g("ZodBase64URL",(t,e)=>{Ru.init(t,e),Q.init(t,e)});var bg=g("ZodE164",(t,e)=>{Ou.init(t,e),Q.init(t,e)});var $g=g("ZodJWT",(t,e)=>{Iu.init(t,e),Q.init(t,e)});var Ad=g("ZodNumber",(t,e)=>{es.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Fl(t,o,n,s),wr(t,"ZodNumber",{gt(o,n){return this.check(So(o,n))},gte(o,n){return this.check(yr(o,n))},min(o,n){return this.check(yr(o,n))},lt(o,n){return this.check(ko(o,n))},lte(o,n){return this.check(_r(o,n))},max(o,n){return this.check(_r(o,n))},int(o){return this.check(Td(o))},safe(o){return this.check(Td(o))},positive(o){return this.check(So(0,o))},nonnegative(o){return this.check(yr(0,o))},negative(o){return this.check(ko(0,o))},nonpositive(o){return this.check(_r(0,o))},multipleOf(o,n){return this.check(Po(o,n))},step(o,n){return this.check(Po(o,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function F(t){return Ol(Ad,t)}var wg=g("ZodNumberFormat",(t,e)=>{Nu.init(t,e),Ad.init(t,e)});function Td(t){return Il(wg,t)}var xg=g("ZodBoolean",(t,e)=>{Au.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Vl(t,r,o,n)});function se(t){return Nl(xg,t)}var zg=g("ZodNull",(t,e)=>{Zu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Jl(t,r,o,n)});function Zd(t){return Al(zg,t)}var kg=g("ZodUnknown",(t,e)=>{ju.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Bl(t,r,o,n)});function X(){return Zl(kg)}var Sg=g("ZodNever",(t,e)=>{Cu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Hl(t,r,o,n)});function Pg(t){return jl(Sg,t)}var Eg=g("ZodArray",(t,e)=>{Du.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ql(t,r,o,n),t.element=e.element,wr(t,"ZodArray",{min(r,o){return this.check(jt(r,o))},nonempty(r){return this.check(jt(1,r))},max(r,o){return this.check(Eo(r,o))},length(r,o){return this.check(To(r,o))},unwrap(){return this.element}})});function j(t,e){return Cl(Eg,t,e)}var jd=g("ZodObject",(t,e)=>{Lu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Xl(t,r,o,n),D.defineLazy(t,"shape",()=>e.shape),wr(t,"ZodObject",{keyof(){return ve(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:X()})},loose(){return this.clone({...this._zod.def,catchall:X()})},strict(){return this.clone({...this._zod.def,catchall:Pg()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return D.extend(this,r)},safeExtend(r){return D.safeExtend(this,r)},merge(r){return D.merge(this,r)},pick(r){return D.pick(this,r)},omit(r){return D.omit(this,r)},partial(...r){return D.partial(qd,this,r[0])},required(...r){return D.required(Md,this,r[0])}})});function $(t,e){let r={type:"object",shape:t??{},...D.normalizeParams(e)};return new jd(r)}function ge(t,e){return new jd({type:"object",shape:t,catchall:X(),...D.normalizeParams(e)})}var Cd=g("ZodUnion",(t,e)=>{ts.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ed(t,r,o,n),t.options=e.options});function K(t,e){return new Cd({type:"union",options:t,...D.normalizeParams(e)})}var Tg=g("ZodDiscriminatedUnion",(t,e)=>{Cd.init(t,e),Uu.init(t,e)});function Ss(t,e,r){return new Tg({type:"union",options:e,discriminator:t,...D.normalizeParams(r)})}var Rg=g("ZodIntersection",(t,e)=>{Fu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>td(t,r,o,n)});function Io(t,e){return new Rg({type:"intersection",left:t,right:e})}var Rd=g("ZodRecord",(t,e)=>{Vu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>rd(t,r,o,n),t.keyType=e.keyType,t.valueType=e.valueType});function H(t,e,r){return!e||!e._zod?new Rd({type:"record",keyType:h(),valueType:t,...D.normalizeParams(e)}):new Rd({type:"record",keyType:t,valueType:e,...D.normalizeParams(r)})}var ks=g("ZodEnum",(t,e)=>{Ju.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Wl(t,o,n,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ks({...e,checks:[],...D.normalizeParams(n),entries:s})},t.exclude=(o,n)=>{let s={...e.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new ks({...e,checks:[],...D.normalizeParams(n),entries:s})}});function ve(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new ks({type:"enum",entries:r,...D.normalizeParams(e)})}var Og=g("ZodLiteral",(t,e)=>{Hu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Kl(t,r,o,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function z(t,e){return new Og({type:"literal",values:Array.isArray(t)?t:[t],...D.normalizeParams(e)})}var Ig=g("ZodTransform",(t,e)=>{Bu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Yl(t,r,o,n),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ot(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(D.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(D.issue(i))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Dd(t){return new Ig({type:"transform",transform:t})}var qd=g("ZodOptional",(t,e)=>{rs.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>bs(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function ee(t){return new qd({type:"optional",innerType:t})}var Ng=g("ZodExactOptional",(t,e)=>{Wu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>bs(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Ag(t){return new Ng({type:"optional",innerType:t})}var Zg=g("ZodNullable",(t,e)=>{Ku.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>od(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Od(t){return new Zg({type:"nullable",innerType:t})}var jg=g("ZodDefault",(t,e)=>{Gu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>sd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Cg(t,e){return new jg({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Dg=g("ZodPrefault",(t,e)=>{Yu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>id(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function qg(t,e){return new Dg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Md=g("ZodNonOptional",(t,e)=>{Qu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>nd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Mg(t,e){return new Md({type:"nonoptional",innerType:t,...D.normalizeParams(e)})}var Lg=g("ZodCatch",(t,e)=>{Xu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ad(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Ug(t,e){return new Lg({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Ld=g("ZodPipe",(t,e)=>{os.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>cd(t,r,o,n),t.in=e.in,t.out=e.out});function Id(t,e){return new Ld({type:"pipe",in:t,out:e})}var Fg=g("ZodPreprocess",(t,e)=>{Ld.init(t,e),el.init(t,e)}),Vg=g("ZodReadonly",(t,e)=>{tl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ud(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Jg(t){return new Vg({type:"readonly",innerType:t})}var Ud=g("ZodCustom",(t,e)=>{rl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Gl(t,r,o,n)});function Fd(t,e){return Dl(Ud,t??(()=>!0),e)}function Hg(t,e={}){return ql(Ud,t,e)}function Bg(t,e){return Ml(t,e)}function Ps(t,e){return new Fg({type:"pipe",in:Dd(t),out:e})}ke(ol());var Ts="2025-11-25";var Vd=[Ts,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ct="io.modelcontextprotocol/related-task",Ao="2.0",ne=Fd(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Jd=K([h(),F().int()]),Hd=h(),rS=ge({ttl:F().optional(),pollInterval:F().optional()}),Wg=$({ttl:F().optional()}),Kg=$({taskId:h()}),Rs=ge({progressToken:Jd.optional(),[ct]:Kg.optional()}),Pe=$({_meta:Rs.optional()}),xr=Pe.extend({task:Wg.optional()}),Bd=t=>xr.safeParse(t).success,ae=$({method:h(),params:Pe.loose().optional()}),Re=$({_meta:Rs.optional()}),Oe=$({method:h(),params:Re.loose().optional()}),ce=ge({_meta:Rs.optional()}),Zo=K([h(),F().int()]),Wd=$({jsonrpc:z(Ao),id:Zo,...ae.shape}).strict(),Os=t=>Wd.safeParse(t).success,Kd=$({jsonrpc:z(Ao),...Oe.shape}).strict(),Gd=t=>Kd.safeParse(t).success,Is=$({jsonrpc:z(Ao),id:Zo,result:ce}).strict(),zr=t=>Is.safeParse(t).success;var Z;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Z||(Z={}));var Ns=$({jsonrpc:z(Ao),id:Zo.optional(),error:$({code:F().int(),message:h(),data:X().optional()})}).strict();var Yd=t=>Ns.safeParse(t).success;var Qd=K([Wd,Kd,Is,Ns]),oS=K([Is,Ns]),jo=ce.strict(),Gg=Re.extend({requestId:Zo.optional(),reason:h().optional()}),Co=Oe.extend({method:z("notifications/cancelled"),params:Gg}),Yg=$({src:h(),mimeType:h().optional(),sizes:j(h()).optional(),theme:ve(["light","dark"]).optional()}),kr=$({icons:j(Yg).optional()}),Dt=$({name:h(),title:h().optional()}),Xd=Dt.extend({...Dt.shape,...kr.shape,version:h(),websiteUrl:h().optional(),description:h().optional()}),Qg=Io($({applyDefaults:se().optional()}),H(h(),X())),Xg=Ps(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Io($({form:Qg.optional(),url:ne.optional()}),H(h(),X()).optional())),e_=ge({list:ne.optional(),cancel:ne.optional(),requests:ge({sampling:ge({createMessage:ne.optional()}).optional(),elicitation:ge({create:ne.optional()}).optional()}).optional()}),t_=ge({list:ne.optional(),cancel:ne.optional(),requests:ge({tools:ge({call:ne.optional()}).optional()}).optional()}),r_=$({experimental:H(h(),ne).optional(),sampling:$({context:ne.optional(),tools:ne.optional()}).optional(),elicitation:Xg.optional(),roots:$({listChanged:se().optional()}).optional(),tasks:e_.optional(),extensions:H(h(),ne).optional()}),o_=Pe.extend({protocolVersion:h(),capabilities:r_,clientInfo:Xd}),As=ae.extend({method:z("initialize"),params:o_});var n_=$({experimental:H(h(),ne).optional(),logging:ne.optional(),completions:ne.optional(),prompts:$({listChanged:se().optional()}).optional(),resources:$({subscribe:se().optional(),listChanged:se().optional()}).optional(),tools:$({listChanged:se().optional()}).optional(),tasks:t_.optional(),extensions:H(h(),ne).optional()}),s_=ce.extend({protocolVersion:h(),capabilities:n_,serverInfo:Xd,instructions:h().optional()}),Zs=Oe.extend({method:z("notifications/initialized"),params:Re.optional()});var Do=ae.extend({method:z("ping"),params:Pe.optional()}),i_=$({progress:F(),total:ee(F()),message:ee(h())}),a_=$({...Re.shape,...i_.shape,progressToken:Jd}),qo=Oe.extend({method:z("notifications/progress"),params:a_}),c_=Pe.extend({cursor:Hd.optional()}),Sr=ae.extend({params:c_.optional()}),Pr=ce.extend({nextCursor:Hd.optional()}),u_=ve(["working","input_required","completed","failed","cancelled"]),Er=$({taskId:h(),status:u_,ttl:K([F(),Zd()]),createdAt:h(),lastUpdatedAt:h(),pollInterval:ee(F()),statusMessage:ee(h())}),qt=ce.extend({task:Er}),l_=Re.merge(Er),Tr=Oe.extend({method:z("notifications/tasks/status"),params:l_}),Mo=ae.extend({method:z("tasks/get"),params:Pe.extend({taskId:h()})}),Lo=ce.merge(Er),Uo=ae.extend({method:z("tasks/result"),params:Pe.extend({taskId:h()})}),nS=ce.loose(),Fo=Sr.extend({method:z("tasks/list")}),Vo=Pr.extend({tasks:j(Er)}),Jo=ae.extend({method:z("tasks/cancel"),params:Pe.extend({taskId:h()})}),ep=ce.merge(Er),tp=$({uri:h(),mimeType:ee(h()),_meta:H(h(),X()).optional()}),rp=tp.extend({text:h()}),js=h().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),op=tp.extend({blob:js}),Rr=ve(["user","assistant"]),Mt=$({audience:j(Rr).optional(),priority:F().min(0).max(1).optional(),lastModified:$r.datetime({offset:!0}).optional()}),np=$({...Dt.shape,...kr.shape,uri:h(),description:ee(h()),mimeType:ee(h()),size:ee(F()),annotations:Mt.optional(),_meta:ee(ge({}))}),d_=$({...Dt.shape,...kr.shape,uriTemplate:h(),description:ee(h()),mimeType:ee(h()),annotations:Mt.optional(),_meta:ee(ge({}))}),Cs=Sr.extend({method:z("resources/list")}),p_=Pr.extend({resources:j(np)}),f_=Sr.extend({method:z("resources/templates/list")}),m_=Pr.extend({resourceTemplates:j(d_)}),Ds=Pe.extend({uri:h()}),h_=Ds,qs=ae.extend({method:z("resources/read"),params:h_}),g_=ce.extend({contents:j(K([rp,op]))}),__=Oe.extend({method:z("notifications/resources/list_changed"),params:Re.optional()}),y_=Ds,v_=ae.extend({method:z("resources/subscribe"),params:y_}),b_=Ds,$_=ae.extend({method:z("resources/unsubscribe"),params:b_}),w_=Re.extend({uri:h()}),x_=Oe.extend({method:z("notifications/resources/updated"),params:w_}),z_=$({name:h(),description:ee(h()),required:ee(se())}),k_=$({...Dt.shape,...kr.shape,description:ee(h()),arguments:ee(j(z_)),_meta:ee(ge({}))}),S_=Sr.extend({method:z("prompts/list")}),P_=Pr.extend({prompts:j(k_)}),E_=Pe.extend({name:h(),arguments:H(h(),h()).optional()}),T_=ae.extend({method:z("prompts/get"),params:E_}),Ms=$({type:z("text"),text:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),Ls=$({type:z("image"),data:js,mimeType:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),Us=$({type:z("audio"),data:js,mimeType:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),R_=$({type:z("tool_use"),name:h(),id:h(),input:H(h(),X()),_meta:H(h(),X()).optional()}),O_=$({type:z("resource"),resource:K([rp,op]),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),I_=np.extend({type:z("resource_link")}),Fs=K([Ms,Ls,Us,I_,O_]),N_=$({role:Rr,content:Fs}),A_=ce.extend({description:h().optional(),messages:j(N_)}),Z_=Oe.extend({method:z("notifications/prompts/list_changed"),params:Re.optional()}),j_=$({title:h().optional(),readOnlyHint:se().optional(),destructiveHint:se().optional(),idempotentHint:se().optional(),openWorldHint:se().optional()}),C_=$({taskSupport:ve(["required","optional","forbidden"]).optional()}),sp=$({...Dt.shape,...kr.shape,description:h().optional(),inputSchema:$({type:z("object"),properties:H(h(),ne).optional(),required:j(h()).optional()}).catchall(X()),outputSchema:$({type:z("object"),properties:H(h(),ne).optional(),required:j(h()).optional()}).catchall(X()).optional(),annotations:j_.optional(),execution:C_.optional(),_meta:H(h(),X()).optional()}),Vs=Sr.extend({method:z("tools/list")}),D_=Pr.extend({tools:j(sp)}),Ho=ce.extend({content:j(Fs).default([]),structuredContent:H(h(),X()).optional(),isError:se().optional()}),sS=Ho.or(ce.extend({toolResult:X()})),q_=xr.extend({name:h(),arguments:H(h(),X()).optional()}),Or=ae.extend({method:z("tools/call"),params:q_}),M_=Oe.extend({method:z("notifications/tools/list_changed"),params:Re.optional()}),iS=$({autoRefresh:se().default(!0),debounceMs:F().int().nonnegative().default(300)}),Ir=ve(["debug","info","notice","warning","error","critical","alert","emergency"]),L_=Pe.extend({level:Ir}),Js=ae.extend({method:z("logging/setLevel"),params:L_}),U_=Re.extend({level:Ir,logger:h().optional(),data:X()}),F_=Oe.extend({method:z("notifications/message"),params:U_}),V_=$({name:h().optional()}),J_=$({hints:j(V_).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),H_=$({mode:ve(["auto","required","none"]).optional()}),B_=$({type:z("tool_result"),toolUseId:h().describe("The unique identifier for the corresponding tool call."),content:j(Fs).default([]),structuredContent:$({}).loose().optional(),isError:se().optional(),_meta:H(h(),X()).optional()}),W_=Ss("type",[Ms,Ls,Us]),No=Ss("type",[Ms,Ls,Us,R_,B_]),K_=$({role:Rr,content:K([No,j(No)]),_meta:H(h(),X()).optional()}),G_=xr.extend({messages:j(K_),modelPreferences:J_.optional(),systemPrompt:h().optional(),includeContext:ve(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:j(h()).optional(),metadata:ne.optional(),tools:j(sp).optional(),toolChoice:H_.optional()}),Y_=ae.extend({method:z("sampling/createMessage"),params:G_}),Nr=ce.extend({model:h(),stopReason:ee(ve(["endTurn","stopSequence","maxTokens"]).or(h())),role:Rr,content:W_}),Hs=ce.extend({model:h(),stopReason:ee(ve(["endTurn","stopSequence","maxTokens","toolUse"]).or(h())),role:Rr,content:K([No,j(No)])}),Q_=$({type:z("boolean"),title:h().optional(),description:h().optional(),default:se().optional()}),X_=$({type:z("string"),title:h().optional(),description:h().optional(),minLength:F().optional(),maxLength:F().optional(),format:ve(["email","uri","date","date-time"]).optional(),default:h().optional()}),ey=$({type:ve(["number","integer"]),title:h().optional(),description:h().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),ty=$({type:z("string"),title:h().optional(),description:h().optional(),enum:j(h()),default:h().optional()}),ry=$({type:z("string"),title:h().optional(),description:h().optional(),oneOf:j($({const:h(),title:h()})),default:h().optional()}),oy=$({type:z("string"),title:h().optional(),description:h().optional(),enum:j(h()),enumNames:j(h()).optional(),default:h().optional()}),ny=K([ty,ry]),sy=$({type:z("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:$({type:z("string"),enum:j(h())}),default:j(h()).optional()}),iy=$({type:z("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:$({anyOf:j($({const:h(),title:h()}))}),default:j(h()).optional()}),ay=K([sy,iy]),cy=K([oy,ny,ay]),uy=K([cy,Q_,X_,ey]),ly=xr.extend({mode:z("form").optional(),message:h(),requestedSchema:$({type:z("object"),properties:H(h(),uy),required:j(h()).optional()})}),dy=xr.extend({mode:z("url"),message:h(),elicitationId:h(),url:h().url()}),py=K([ly,dy]),fy=ae.extend({method:z("elicitation/create"),params:py}),my=Re.extend({elicitationId:h()}),hy=Oe.extend({method:z("notifications/elicitation/complete"),params:my}),Lt=ce.extend({action:ve(["accept","decline","cancel"]),content:Ps(t=>t===null?void 0:t,H(h(),K([h(),F(),se(),j(h())])).optional())}),gy=$({type:z("ref/resource"),uri:h()});var _y=$({type:z("ref/prompt"),name:h()}),yy=Pe.extend({ref:K([_y,gy]),argument:$({name:h(),value:h()}),context:$({arguments:H(h(),h()).optional()}).optional()}),vy=ae.extend({method:z("completion/complete"),params:yy});var by=ce.extend({completion:ge({values:j(h()).max(100),total:ee(F().int()),hasMore:ee(se())})}),$y=$({uri:h().startsWith("file://"),name:h().optional(),_meta:H(h(),X()).optional()}),wy=ae.extend({method:z("roots/list"),params:Pe.optional()}),Bs=ce.extend({roots:j($y)}),xy=Oe.extend({method:z("notifications/roots/list_changed"),params:Re.optional()}),aS=K([Do,As,vy,Js,T_,S_,Cs,f_,qs,v_,$_,Or,Vs,Mo,Uo,Fo,Jo]),cS=K([Co,qo,Zs,xy,Tr]),uS=K([jo,Nr,Hs,Lt,Bs,Lo,Vo,qt]),lS=K([Do,Y_,fy,wy,Mo,Uo,Fo,Jo]),dS=K([Co,qo,F_,x_,__,M_,Z_,Tr,hy]),pS=K([jo,s_,by,A_,P_,p_,m_,g_,Ho,D_,Lo,Vo,qt]),R=class t extends Error{constructor(e,r,o){super(`MCP error ${e}: ${r}`),this.code=e,this.data=o,this.name="McpError"}static fromError(e,r,o){if(e===Z.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Es(n.elicitations,r)}return new t(e,r,o)}},Es=class extends R{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Z.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function ut(t){return t==="completed"||t==="failed"||t==="cancelled"}var JS=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ws(t){let r=Ro(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=ld(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function Ks(t,e){let r=at(t,e);if(!r.success)throw r.error;return r.data}var Ty=6e4,Bo=class{constructor(e){this._options=e,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(Co,r=>{this._oncancel(r)}),this.setNotificationHandler(qo,r=>{this._onprogress(r)}),this.setRequestHandler(Do,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Mo,async(r,o)=>{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Uo,async(r,o)=>{let n=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,o.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,p=new R(d.error.code,d.error.message,d.error.data);l(p)}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:o.requestId})}}let i=await this._taskStore.getTask(s,o.sessionId);if(!i)throw new R(Z.InvalidParams,`Task not found: ${s}`);if(!ut(i.status))return await this._waitForTaskUpdate(s,o.signal),await n();if(ut(i.status)){let a=await this._taskStore.getTaskResult(s,o.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ct]:{taskId:s}}}}return await n()};return await n()}),this.setRequestHandler(Fo,async(r,o)=>{try{let{tasks:n,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:s,_meta:{}}}catch(n){throw new R(Z.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Jo,async(r,o)=>{try{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new R(Z.InvalidParams,`Task not found: ${r.params.taskId}`);if(ut(n.status))throw new R(Z.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!s)throw new R(Z.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(n){throw n instanceof R?n:new R(Z.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),R.fromError(Z.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){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=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};let n=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{n?.(s,i),zr(s)||Yd(s)?this._onresponse(s):Os(s)?this._onrequest(s,i):Gd(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let r=R.fromError(Z.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of e.values())o(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(e,r){let o=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,s=e.params?._meta?.[ct]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:Z.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=Bd(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,u={signal:i.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(i.signal.aborted)throw new R(Z.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let m=f.relatedTask?.taskId??s;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>o(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:Z.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...o}=e.params,n=Number(r),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),i(c);return}s(o)}_onresponse(e){let r=Number(e.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),zr(e))o(e);else{let i=new R(e.error.code,e.error.message,e.error.data);o(i)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(zr(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),zr(e))n(e);else{let i=R.fromError(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,o){let{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(e,r,o)}}catch(i){yield{type:"error",error:i instanceof R?i:new R(Z.InternalError,String(i))}}return}let s;try{let i=await this.request(e,qt,o);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new R(Z.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},o);if(yield{type:"taskStatus",task:a},ut(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)}:a.status==="failed"?yield{type:"error",error:new R(Z.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new R(Z.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof R?i:new R(Z.InternalError,String(i))}}}request(e,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=o??{};return new Promise((u,l)=>{let d=P=>{l(P)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(P){d(P);return}o?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};o?.onprogress&&(this._progressHandlers.set(p,o.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[ct]:c}});let m=P=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(P)}},{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let x=P instanceof R?P:new R(Z.RequestTimeout,String(P));l(x)};this._responseHandlers.set(p,P=>{if(!o?.signal?.aborted){if(P instanceof Error)return l(P);try{let x=at(r,P.result);x.success?u(x.data):l(x.error)}catch(x){l(x)}}}),o?.signal?.addEventListener("abort",()=>{m(o?.signal?.reason)});let _=o?.timeout??Ty,y=()=>m(R.fromError(Z.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(p,_,o?.maxTotalTimeout,y,o?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let P=x=>{let S=this._responseHandlers.get(p);S?S(x):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,P),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(p),l(x)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(P=>{this._cleanupTimeout(p),l(P)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Lo,r)}async getTaskResult(e,r,o){return this.request({method:"tasks/result",params:e},r,o)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Vo,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ep,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let o=r?.relatedTask?.taskId;if(o){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ct]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ct]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ct]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let o=Ws(e);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,s)=>{let i=Ks(e,n);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let o=Ws(e);this._notificationHandlers.set(o,n=>{let s=Ks(e,n);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,o,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(e,r);for(let n of o)if(n.type==="request"&&Os(n.message)){let s=n.message.id,i=this._requestResolvers.get(s);i?(i(new R(Z.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let o=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,s)=>{if(r.aborted){s(new R(Z.InvalidRequest,"Request cancelled"));return}let i=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(i),s(new R(Z.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await o.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let s=await o.getTask(n,r);if(!s)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(n,s,i)=>{await o.storeTaskResult(n,s,i,r);let a=await o.getTask(n,r);if(a){let c=Tr.parse({method:"notifications/tasks/status",params:a});await this.notification(c),ut(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,s,i)=>{let a=await o.getTask(n,r);if(!a)throw new R(Z.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(ut(a.status))throw new R(Z.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,s,i,r);let c=await o.getTask(n,r);if(c){let u=Tr.parse({method:"notifications/tasks/status",params:c});await this.notification(u),ut(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}};function ip(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ap(t,e){let r={...t};for(let o in e){let n=o,s=e[n];if(s===void 0)continue;let i=r[n];ip(i)&&ip(s)?r[n]={...i,...s}:r[n]=s}return r}var Xm=Ha(Za(),1),eh=Ha(Qm(),1);function Ix(){let t=new Xm.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,eh.default)(t),t}var Tn=class{constructor(e){this._ajv=e??Ix()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Rn=class{constructor(e){this._server=e}requestStream(e,r,o){return this._server.requestStream(e,r,o)}createMessageStream(e,r){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],s=Array.isArray(n.content)?n.content:[n.content],i=s.some(l=>l.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(i){if(s.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(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))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:e},Nr,r)}elicitInputStream(e,r){let o=this._server.getClientCapabilities(),n=e.mode??"form";switch(n){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=n==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Lt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,o){return this._server.getTaskResult({taskId:e},r,o)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function th(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function rh(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var On=class extends Bo{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ir.options.map((o,n)=>[o,n])),this.isMessageIgnored=(o,n)=>{let s=this._loggingLevels.get(n);return s?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Tn,this.setRequestHandler(As,o=>this._oninitialize(o)),this.setNotificationHandler(Zs,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Js,async(o,n)=>{let s=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=o.params,a=Ir.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Rn(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ap(this._capabilities,e)}setRequestHandler(e,r){let n=Ro(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let s;if(Ct(n)){let a=n;s=a._zod?.def?.value??a.value}else{let a=n;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=at(Or,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new R(Z.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let m=at(qt,p);if(!m.success){let _=m.error instanceof Error?m.error.message:String(m.error);throw new R(Z.InvalidParams,`Invalid task creation result: ${_}`)}return m.data}let f=at(Ho,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new R(Z.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);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 ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);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 ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){rh(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&th(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Vd.includes(r)?r:Ts,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"},jo)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],n=Array.isArray(o.content)?o.content:[o.content],s=n.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(n.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(n.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 e.tools?this.request({method:"sampling/createMessage",params:e},Hs,r):this.request({method:"sampling/createMessage",params:e},Nr,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Lt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:n},Lt,r);if(s.action==="accept"&&s.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(s.content);if(!a.valid)throw new R(Z.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof R?i:new R(Z.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,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:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Bs,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};import nh from"node:process";var In=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
73
- `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Nx(r)}clear(){this._buffer=void 0}};function Nx(t){return Qd.parse(JSON.parse(t))}function oh(t){return JSON.stringify(t)+`
74
- `}var Nn=class{constructor(e=nh.stdin,r=nh.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new In,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}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 e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}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(e){return new Promise(r=>{let o=oh(e);this._stdout.write(o)?r():this._stdout.once("drain",r)})}};var je={general:`
72
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function bs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let f=t.seen.get(d),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(m.$ref&&f.def)for(let y in u)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(u[y])===JSON.stringify(f.def[y])&&delete u[y]}let p=a._zod.parent;if(p&&p!==d){o(p);let f=t.seen.get(p);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let m in u)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(u[m])===JSON.stringify(f.def[m])&&delete u[m]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())o(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&n.id===s&&delete n.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:br(e,"input",t.processors),output:br(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function he(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return he(o.element,r);if(o.type==="set")return he(o.valueType,r);if(o.type==="lazy")return he(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return he(o.innerType,r);if(o.type==="intersection")return he(o.left,r)||he(o.right,r);if(o.type==="record"||o.type==="map")return he(o.keyType,r)||he(o.valueType,r);if(o.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:he(o.in,r)||he(o.out,r);if(o.type==="object"){for(let n in o.shape)if(he(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(he(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(he(n,r))return!0;return!!(o.rest&&he(o.rest,r))}return!1}var Ll=(t,e={})=>r=>{let o=_s({...r,processors:e});return re(t,o),ys(o,t),bs(o,t)},br=(t,e,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=_s({...n??{},target:s,io:e,processors:r});return re(t,i),ys(i,t),bs(i,t)};var Bh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ul=(t,e,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=Bh[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Fl=(t,e,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof s=="number"&&(n.minimum=s),p?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof c=="number"&&(n.multipleOf=c)},Vl=(t,e,r,o)=>{r.type="boolean"};var Jl=(t,e,r,o)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Hl=(t,e,r,o)=>{r.not={}};var Bl=(t,e,r,o)=>{};var Wl=(t,e,r,o)=>{let n=t._zod.def,s=ur(n.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},Kl=(t,e,r,o)=>{let n=t._zod.def,s=[];for(let i of n.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var Gl=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var Yl=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var Ql=(t,e,r,o)=>{let n=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=re(s.element,e,{...o,path:[...o.path,"items"]})},Xl=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=re(i[u],e,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=re(s.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},ed=(t,e,r,o)=>{let n=t._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>re(a,e,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},td=(t,e,r,o)=>{let n=t._zod.def,s=re(n.left,e,{...o,path:[...o.path,"allOf",0]}),i=re(n.right,e,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var rd=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=re(s.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=re(s.keyType,e,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=re(s.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},od=(t,e,r,o)=>{let n=t._zod.def,s=re(n.innerType,e,o),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},nd=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType},sd=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},id=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},ad=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},cd=(t,e,r,o)=>{let n=t._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?n.out:n.in:n.out;re(i,e,o);let a=e.seen.get(t);a.ref=i},ud=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.readOnly=!0};var vs=(t,e,r,o)=>{let n=t._zod.def;re(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType};function Ct(t){return!!t._zod}function at(t,e){return Ct(t)?mr(t,e):t.safeParse(e)}function Ro(t){if(!t)return;let e;if(Ct(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function ld(t){if(Ct(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._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 o=t.value;if(o!==void 0)return o}var wr={};Ja(wr,{ZodISODate:()=>pd,ZodISODateTime:()=>dd,ZodISODuration:()=>md,ZodISOTime:()=>fd,date:()=>$s,datetime:()=>ws,duration:()=>ks,time:()=>zs});var dd=g("ZodISODateTime",(t,e)=>{vu.init(t,e),Q.init(t,e)});function ws(t){return Pl(dd,t)}var pd=g("ZodISODate",(t,e)=>{wu.init(t,e),Q.init(t,e)});function $s(t){return El(pd,t)}var fd=g("ZodISOTime",(t,e)=>{$u.init(t,e),Q.init(t,e)});function zs(t){return Tl(fd,t)}var md=g("ZodISODuration",(t,e)=>{zu.init(t,e),Q.init(t,e)});function ks(t){return Rl(md,t)}var rg=(t,e)=>{go.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>oc(t,r)},flatten:{value:r=>rc(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Nt,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Nt,2)}},isEmpty:{get(){return t.issues.length===0}}})};var Se=g("ZodError",rg,{Parent:Error});var hd=_o(Se),gd=yo(Se),_d=fr(Se),yd=hr(Se),bd=nc(Se),vd=sc(Se),wd=ic(Se),$d=ac(Se),zd=cc(Se),kd=uc(Se),xd=lc(Se),Sd=dc(Se);var Pd=new WeakMap;function $r(t,e,r){let o=Object.getPrototypeOf(t),n=Pd.get(o);if(n||(n=new Set,Pd.set(o,n)),!n.has(e)){n.add(e);for(let s in r){let i=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var te=g("ZodType",(t,e)=>(B.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:br(t,"input"),output:br(t,"output")}}),t.toJSONSchema=Ll(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,o)=>hd(t,r,o,{callee:t.parse}),t.safeParse=(r,o)=>_d(t,r,o),t.parseAsync=async(r,o)=>gd(t,r,o,{callee:t.parseAsync}),t.safeParseAsync=async(r,o)=>yd(t,r,o),t.spa=t.safeParseAsync,t.encode=(r,o)=>bd(t,r,o),t.decode=(r,o)=>vd(t,r,o),t.encodeAsync=async(r,o)=>wd(t,r,o),t.decodeAsync=async(r,o)=>$d(t,r,o),t.safeEncode=(r,o)=>zd(t,r,o),t.safeDecode=(r,o)=>kd(t,r,o),t.safeEncodeAsync=async(r,o)=>xd(t,r,o),t.safeDecodeAsync=async(r,o)=>Sd(t,r,o),$r(t,"ZodType",{check(...r){let o=this.def;return this.clone(D.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Ce(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Hg(r,o))},superRefine(r,o){return this.check(Bg(r,o))},overwrite(r){return this.check(it(r))},optional(){return ee(this)},exactOptional(){return Ag(this)},nullable(){return Od(this)},nullish(){return ee(Od(this))},nonoptional(r){return Mg(this,r)},array(){return j(this)},or(r){return K([this,r])},and(r){return Io(this,r)},transform(r){return Id(this,Dd(r))},default(r){return Cg(this,r)},prefault(r){return qg(this,r)},catch(r){return Ug(this,r)},pipe(r){return Id(this,r)},readonly(){return Jg(this)},describe(r){let o=this.clone();return bt.add(o,{description:r}),o},meta(...r){if(r.length===0)return bt.get(this);let o=this.clone();return bt.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return bt.get(t)?.description},configurable:!0}),t)),Nd=g("_ZodString",(t,e)=>{ko.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Ul(t,o,n,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,$r(t,"_ZodString",{regex(...o){return this.check(is(...o))},includes(...o){return this.check(us(...o))},startsWith(...o){return this.check(ls(...o))},endsWith(...o){return this.check(ds(...o))},min(...o){return this.check(jt(...o))},max(...o){return this.check(Eo(...o))},length(...o){return this.check(To(...o))},nonempty(...o){return this.check(jt(1,...o))},lowercase(o){return this.check(as(o))},uppercase(o){return this.check(cs(o))},trim(){return this.check(fs())},normalize(...o){return this.check(ps(...o))},toLowerCase(){return this.check(ms())},toUpperCase(){return this.check(hs())},slugify(){return this.check(gs())}})}),ng=g("ZodString",(t,e)=>{ko.init(t,e),Nd.init(t,e),t.email=r=>t.check(il(sg,r)),t.url=r=>t.check(dl(ig,r)),t.jwt=r=>t.check(Sl(wg,r)),t.emoji=r=>t.check(pl(ag,r)),t.guid=r=>t.check(ss(Ed,r)),t.uuid=r=>t.check(al(Oo,r)),t.uuidv4=r=>t.check(cl(Oo,r)),t.uuidv6=r=>t.check(ul(Oo,r)),t.uuidv7=r=>t.check(ll(Oo,r)),t.nanoid=r=>t.check(fl(cg,r)),t.guid=r=>t.check(ss(Ed,r)),t.cuid=r=>t.check(ml(ug,r)),t.cuid2=r=>t.check(hl(lg,r)),t.ulid=r=>t.check(gl(dg,r)),t.base64=r=>t.check(zl(yg,r)),t.base64url=r=>t.check(kl(bg,r)),t.xid=r=>t.check(_l(pg,r)),t.ksuid=r=>t.check(yl(fg,r)),t.ipv4=r=>t.check(bl(mg,r)),t.ipv6=r=>t.check(vl(hg,r)),t.cidrv4=r=>t.check(wl(gg,r)),t.cidrv6=r=>t.check($l(_g,r)),t.e164=r=>t.check(xl(vg,r)),t.datetime=r=>t.check(ws(r)),t.date=r=>t.check($s(r)),t.time=r=>t.check(zs(r)),t.duration=r=>t.check(ks(r))});function h(t){return sl(ng,t)}var Q=g("ZodStringFormat",(t,e)=>{W.init(t,e),Nd.init(t,e)}),sg=g("ZodEmail",(t,e)=>{du.init(t,e),Q.init(t,e)});var Ed=g("ZodGUID",(t,e)=>{uu.init(t,e),Q.init(t,e)});var Oo=g("ZodUUID",(t,e)=>{lu.init(t,e),Q.init(t,e)});var ig=g("ZodURL",(t,e)=>{pu.init(t,e),Q.init(t,e)});var ag=g("ZodEmoji",(t,e)=>{fu.init(t,e),Q.init(t,e)});var cg=g("ZodNanoID",(t,e)=>{mu.init(t,e),Q.init(t,e)});var ug=g("ZodCUID",(t,e)=>{hu.init(t,e),Q.init(t,e)});var lg=g("ZodCUID2",(t,e)=>{gu.init(t,e),Q.init(t,e)});var dg=g("ZodULID",(t,e)=>{_u.init(t,e),Q.init(t,e)});var pg=g("ZodXID",(t,e)=>{yu.init(t,e),Q.init(t,e)});var fg=g("ZodKSUID",(t,e)=>{bu.init(t,e),Q.init(t,e)});var mg=g("ZodIPv4",(t,e)=>{ku.init(t,e),Q.init(t,e)});var hg=g("ZodIPv6",(t,e)=>{xu.init(t,e),Q.init(t,e)});var gg=g("ZodCIDRv4",(t,e)=>{Su.init(t,e),Q.init(t,e)});var _g=g("ZodCIDRv6",(t,e)=>{Pu.init(t,e),Q.init(t,e)});var yg=g("ZodBase64",(t,e)=>{Tu.init(t,e),Q.init(t,e)});var bg=g("ZodBase64URL",(t,e)=>{Ru.init(t,e),Q.init(t,e)});var vg=g("ZodE164",(t,e)=>{Ou.init(t,e),Q.init(t,e)});var wg=g("ZodJWT",(t,e)=>{Iu.init(t,e),Q.init(t,e)});var Ad=g("ZodNumber",(t,e)=>{es.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Fl(t,o,n,s),$r(t,"ZodNumber",{gt(o,n){return this.check(So(o,n))},gte(o,n){return this.check(yr(o,n))},min(o,n){return this.check(yr(o,n))},lt(o,n){return this.check(xo(o,n))},lte(o,n){return this.check(_r(o,n))},max(o,n){return this.check(_r(o,n))},int(o){return this.check(Td(o))},safe(o){return this.check(Td(o))},positive(o){return this.check(So(0,o))},nonnegative(o){return this.check(yr(0,o))},negative(o){return this.check(xo(0,o))},nonpositive(o){return this.check(_r(0,o))},multipleOf(o,n){return this.check(Po(o,n))},step(o,n){return this.check(Po(o,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function F(t){return Ol(Ad,t)}var $g=g("ZodNumberFormat",(t,e)=>{Nu.init(t,e),Ad.init(t,e)});function Td(t){return Il($g,t)}var zg=g("ZodBoolean",(t,e)=>{Au.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Vl(t,r,o,n)});function se(t){return Nl(zg,t)}var kg=g("ZodNull",(t,e)=>{Zu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Jl(t,r,o,n)});function Zd(t){return Al(kg,t)}var xg=g("ZodUnknown",(t,e)=>{ju.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Bl(t,r,o,n)});function X(){return Zl(xg)}var Sg=g("ZodNever",(t,e)=>{Cu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Hl(t,r,o,n)});function Pg(t){return jl(Sg,t)}var Eg=g("ZodArray",(t,e)=>{Du.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ql(t,r,o,n),t.element=e.element,$r(t,"ZodArray",{min(r,o){return this.check(jt(r,o))},nonempty(r){return this.check(jt(1,r))},max(r,o){return this.check(Eo(r,o))},length(r,o){return this.check(To(r,o))},unwrap(){return this.element}})});function j(t,e){return Cl(Eg,t,e)}var jd=g("ZodObject",(t,e)=>{Lu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Xl(t,r,o,n),D.defineLazy(t,"shape",()=>e.shape),$r(t,"ZodObject",{keyof(){return be(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:X()})},loose(){return this.clone({...this._zod.def,catchall:X()})},strict(){return this.clone({...this._zod.def,catchall:Pg()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return D.extend(this,r)},safeExtend(r){return D.safeExtend(this,r)},merge(r){return D.merge(this,r)},pick(r){return D.pick(this,r)},omit(r){return D.omit(this,r)},partial(...r){return D.partial(qd,this,r[0])},required(...r){return D.required(Md,this,r[0])}})});function w(t,e){let r={type:"object",shape:t??{},...D.normalizeParams(e)};return new jd(r)}function ge(t,e){return new jd({type:"object",shape:t,catchall:X(),...D.normalizeParams(e)})}var Cd=g("ZodUnion",(t,e)=>{ts.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ed(t,r,o,n),t.options=e.options});function K(t,e){return new Cd({type:"union",options:t,...D.normalizeParams(e)})}var Tg=g("ZodDiscriminatedUnion",(t,e)=>{Cd.init(t,e),Uu.init(t,e)});function Ss(t,e,r){return new Tg({type:"union",options:e,discriminator:t,...D.normalizeParams(r)})}var Rg=g("ZodIntersection",(t,e)=>{Fu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>td(t,r,o,n)});function Io(t,e){return new Rg({type:"intersection",left:t,right:e})}var Rd=g("ZodRecord",(t,e)=>{Vu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>rd(t,r,o,n),t.keyType=e.keyType,t.valueType=e.valueType});function H(t,e,r){return!e||!e._zod?new Rd({type:"record",keyType:h(),valueType:t,...D.normalizeParams(e)}):new Rd({type:"record",keyType:t,valueType:e,...D.normalizeParams(r)})}var xs=g("ZodEnum",(t,e)=>{Ju.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>Wl(t,o,n,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new xs({...e,checks:[],...D.normalizeParams(n),entries:s})},t.exclude=(o,n)=>{let s={...e.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new xs({...e,checks:[],...D.normalizeParams(n),entries:s})}});function be(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new xs({type:"enum",entries:r,...D.normalizeParams(e)})}var Og=g("ZodLiteral",(t,e)=>{Hu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Kl(t,r,o,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function k(t,e){return new Og({type:"literal",values:Array.isArray(t)?t:[t],...D.normalizeParams(e)})}var Ig=g("ZodTransform",(t,e)=>{Bu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Yl(t,r,o,n),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ot(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(D.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(D.issue(i))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Dd(t){return new Ig({type:"transform",transform:t})}var qd=g("ZodOptional",(t,e)=>{rs.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>vs(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function ee(t){return new qd({type:"optional",innerType:t})}var Ng=g("ZodExactOptional",(t,e)=>{Wu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>vs(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Ag(t){return new Ng({type:"optional",innerType:t})}var Zg=g("ZodNullable",(t,e)=>{Ku.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>od(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Od(t){return new Zg({type:"nullable",innerType:t})}var jg=g("ZodDefault",(t,e)=>{Gu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>sd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Cg(t,e){return new jg({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Dg=g("ZodPrefault",(t,e)=>{Yu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>id(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function qg(t,e){return new Dg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Md=g("ZodNonOptional",(t,e)=>{Qu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>nd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Mg(t,e){return new Md({type:"nonoptional",innerType:t,...D.normalizeParams(e)})}var Lg=g("ZodCatch",(t,e)=>{Xu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ad(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Ug(t,e){return new Lg({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Ld=g("ZodPipe",(t,e)=>{os.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>cd(t,r,o,n),t.in=e.in,t.out=e.out});function Id(t,e){return new Ld({type:"pipe",in:t,out:e})}var Fg=g("ZodPreprocess",(t,e)=>{Ld.init(t,e),el.init(t,e)}),Vg=g("ZodReadonly",(t,e)=>{tl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ud(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Jg(t){return new Vg({type:"readonly",innerType:t})}var Ud=g("ZodCustom",(t,e)=>{rl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Gl(t,r,o,n)});function Fd(t,e){return Dl(Ud,t??(()=>!0),e)}function Hg(t,e={}){return ql(Ud,t,e)}function Bg(t,e){return Ml(t,e)}function Ps(t,e){return new Fg({type:"pipe",in:Dd(t),out:e})}xe(ol());var Ts="2025-11-25";var Vd=[Ts,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ct="io.modelcontextprotocol/related-task",Ao="2.0",ne=Fd(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Jd=K([h(),F().int()]),Hd=h(),rS=ge({ttl:F().optional(),pollInterval:F().optional()}),Wg=w({ttl:F().optional()}),Kg=w({taskId:h()}),Rs=ge({progressToken:Jd.optional(),[ct]:Kg.optional()}),Pe=w({_meta:Rs.optional()}),zr=Pe.extend({task:Wg.optional()}),Bd=t=>zr.safeParse(t).success,ae=w({method:h(),params:Pe.loose().optional()}),Oe=w({_meta:Rs.optional()}),Ie=w({method:h(),params:Oe.loose().optional()}),ce=ge({_meta:Rs.optional()}),Zo=K([h(),F().int()]),Wd=w({jsonrpc:k(Ao),id:Zo,...ae.shape}).strict(),Os=t=>Wd.safeParse(t).success,Kd=w({jsonrpc:k(Ao),...Ie.shape}).strict(),Gd=t=>Kd.safeParse(t).success,Is=w({jsonrpc:k(Ao),id:Zo,result:ce}).strict(),kr=t=>Is.safeParse(t).success;var Z;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Z||(Z={}));var Ns=w({jsonrpc:k(Ao),id:Zo.optional(),error:w({code:F().int(),message:h(),data:X().optional()})}).strict();var Yd=t=>Ns.safeParse(t).success;var Qd=K([Wd,Kd,Is,Ns]),oS=K([Is,Ns]),jo=ce.strict(),Gg=Oe.extend({requestId:Zo.optional(),reason:h().optional()}),Co=Ie.extend({method:k("notifications/cancelled"),params:Gg}),Yg=w({src:h(),mimeType:h().optional(),sizes:j(h()).optional(),theme:be(["light","dark"]).optional()}),xr=w({icons:j(Yg).optional()}),Dt=w({name:h(),title:h().optional()}),Xd=Dt.extend({...Dt.shape,...xr.shape,version:h(),websiteUrl:h().optional(),description:h().optional()}),Qg=Io(w({applyDefaults:se().optional()}),H(h(),X())),Xg=Ps(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Io(w({form:Qg.optional(),url:ne.optional()}),H(h(),X()).optional())),e_=ge({list:ne.optional(),cancel:ne.optional(),requests:ge({sampling:ge({createMessage:ne.optional()}).optional(),elicitation:ge({create:ne.optional()}).optional()}).optional()}),t_=ge({list:ne.optional(),cancel:ne.optional(),requests:ge({tools:ge({call:ne.optional()}).optional()}).optional()}),r_=w({experimental:H(h(),ne).optional(),sampling:w({context:ne.optional(),tools:ne.optional()}).optional(),elicitation:Xg.optional(),roots:w({listChanged:se().optional()}).optional(),tasks:e_.optional(),extensions:H(h(),ne).optional()}),o_=Pe.extend({protocolVersion:h(),capabilities:r_,clientInfo:Xd}),As=ae.extend({method:k("initialize"),params:o_});var n_=w({experimental:H(h(),ne).optional(),logging:ne.optional(),completions:ne.optional(),prompts:w({listChanged:se().optional()}).optional(),resources:w({subscribe:se().optional(),listChanged:se().optional()}).optional(),tools:w({listChanged:se().optional()}).optional(),tasks:t_.optional(),extensions:H(h(),ne).optional()}),s_=ce.extend({protocolVersion:h(),capabilities:n_,serverInfo:Xd,instructions:h().optional()}),Zs=Ie.extend({method:k("notifications/initialized"),params:Oe.optional()});var Do=ae.extend({method:k("ping"),params:Pe.optional()}),i_=w({progress:F(),total:ee(F()),message:ee(h())}),a_=w({...Oe.shape,...i_.shape,progressToken:Jd}),qo=Ie.extend({method:k("notifications/progress"),params:a_}),c_=Pe.extend({cursor:Hd.optional()}),Sr=ae.extend({params:c_.optional()}),Pr=ce.extend({nextCursor:Hd.optional()}),u_=be(["working","input_required","completed","failed","cancelled"]),Er=w({taskId:h(),status:u_,ttl:K([F(),Zd()]),createdAt:h(),lastUpdatedAt:h(),pollInterval:ee(F()),statusMessage:ee(h())}),qt=ce.extend({task:Er}),l_=Oe.merge(Er),Tr=Ie.extend({method:k("notifications/tasks/status"),params:l_}),Mo=ae.extend({method:k("tasks/get"),params:Pe.extend({taskId:h()})}),Lo=ce.merge(Er),Uo=ae.extend({method:k("tasks/result"),params:Pe.extend({taskId:h()})}),nS=ce.loose(),Fo=Sr.extend({method:k("tasks/list")}),Vo=Pr.extend({tasks:j(Er)}),Jo=ae.extend({method:k("tasks/cancel"),params:Pe.extend({taskId:h()})}),ep=ce.merge(Er),tp=w({uri:h(),mimeType:ee(h()),_meta:H(h(),X()).optional()}),rp=tp.extend({text:h()}),js=h().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),op=tp.extend({blob:js}),Rr=be(["user","assistant"]),Mt=w({audience:j(Rr).optional(),priority:F().min(0).max(1).optional(),lastModified:wr.datetime({offset:!0}).optional()}),np=w({...Dt.shape,...xr.shape,uri:h(),description:ee(h()),mimeType:ee(h()),size:ee(F()),annotations:Mt.optional(),_meta:ee(ge({}))}),d_=w({...Dt.shape,...xr.shape,uriTemplate:h(),description:ee(h()),mimeType:ee(h()),annotations:Mt.optional(),_meta:ee(ge({}))}),Cs=Sr.extend({method:k("resources/list")}),p_=Pr.extend({resources:j(np)}),f_=Sr.extend({method:k("resources/templates/list")}),m_=Pr.extend({resourceTemplates:j(d_)}),Ds=Pe.extend({uri:h()}),h_=Ds,qs=ae.extend({method:k("resources/read"),params:h_}),g_=ce.extend({contents:j(K([rp,op]))}),__=Ie.extend({method:k("notifications/resources/list_changed"),params:Oe.optional()}),y_=Ds,b_=ae.extend({method:k("resources/subscribe"),params:y_}),v_=Ds,w_=ae.extend({method:k("resources/unsubscribe"),params:v_}),$_=Oe.extend({uri:h()}),z_=Ie.extend({method:k("notifications/resources/updated"),params:$_}),k_=w({name:h(),description:ee(h()),required:ee(se())}),x_=w({...Dt.shape,...xr.shape,description:ee(h()),arguments:ee(j(k_)),_meta:ee(ge({}))}),S_=Sr.extend({method:k("prompts/list")}),P_=Pr.extend({prompts:j(x_)}),E_=Pe.extend({name:h(),arguments:H(h(),h()).optional()}),T_=ae.extend({method:k("prompts/get"),params:E_}),Ms=w({type:k("text"),text:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),Ls=w({type:k("image"),data:js,mimeType:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),Us=w({type:k("audio"),data:js,mimeType:h(),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),R_=w({type:k("tool_use"),name:h(),id:h(),input:H(h(),X()),_meta:H(h(),X()).optional()}),O_=w({type:k("resource"),resource:K([rp,op]),annotations:Mt.optional(),_meta:H(h(),X()).optional()}),I_=np.extend({type:k("resource_link")}),Fs=K([Ms,Ls,Us,I_,O_]),N_=w({role:Rr,content:Fs}),A_=ce.extend({description:h().optional(),messages:j(N_)}),Z_=Ie.extend({method:k("notifications/prompts/list_changed"),params:Oe.optional()}),j_=w({title:h().optional(),readOnlyHint:se().optional(),destructiveHint:se().optional(),idempotentHint:se().optional(),openWorldHint:se().optional()}),C_=w({taskSupport:be(["required","optional","forbidden"]).optional()}),sp=w({...Dt.shape,...xr.shape,description:h().optional(),inputSchema:w({type:k("object"),properties:H(h(),ne).optional(),required:j(h()).optional()}).catchall(X()),outputSchema:w({type:k("object"),properties:H(h(),ne).optional(),required:j(h()).optional()}).catchall(X()).optional(),annotations:j_.optional(),execution:C_.optional(),_meta:H(h(),X()).optional()}),Vs=Sr.extend({method:k("tools/list")}),D_=Pr.extend({tools:j(sp)}),Ho=ce.extend({content:j(Fs).default([]),structuredContent:H(h(),X()).optional(),isError:se().optional()}),sS=Ho.or(ce.extend({toolResult:X()})),q_=zr.extend({name:h(),arguments:H(h(),X()).optional()}),Or=ae.extend({method:k("tools/call"),params:q_}),M_=Ie.extend({method:k("notifications/tools/list_changed"),params:Oe.optional()}),iS=w({autoRefresh:se().default(!0),debounceMs:F().int().nonnegative().default(300)}),Ir=be(["debug","info","notice","warning","error","critical","alert","emergency"]),L_=Pe.extend({level:Ir}),Js=ae.extend({method:k("logging/setLevel"),params:L_}),U_=Oe.extend({level:Ir,logger:h().optional(),data:X()}),F_=Ie.extend({method:k("notifications/message"),params:U_}),V_=w({name:h().optional()}),J_=w({hints:j(V_).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),H_=w({mode:be(["auto","required","none"]).optional()}),B_=w({type:k("tool_result"),toolUseId:h().describe("The unique identifier for the corresponding tool call."),content:j(Fs).default([]),structuredContent:w({}).loose().optional(),isError:se().optional(),_meta:H(h(),X()).optional()}),W_=Ss("type",[Ms,Ls,Us]),No=Ss("type",[Ms,Ls,Us,R_,B_]),K_=w({role:Rr,content:K([No,j(No)]),_meta:H(h(),X()).optional()}),G_=zr.extend({messages:j(K_),modelPreferences:J_.optional(),systemPrompt:h().optional(),includeContext:be(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:j(h()).optional(),metadata:ne.optional(),tools:j(sp).optional(),toolChoice:H_.optional()}),Y_=ae.extend({method:k("sampling/createMessage"),params:G_}),Nr=ce.extend({model:h(),stopReason:ee(be(["endTurn","stopSequence","maxTokens"]).or(h())),role:Rr,content:W_}),Hs=ce.extend({model:h(),stopReason:ee(be(["endTurn","stopSequence","maxTokens","toolUse"]).or(h())),role:Rr,content:K([No,j(No)])}),Q_=w({type:k("boolean"),title:h().optional(),description:h().optional(),default:se().optional()}),X_=w({type:k("string"),title:h().optional(),description:h().optional(),minLength:F().optional(),maxLength:F().optional(),format:be(["email","uri","date","date-time"]).optional(),default:h().optional()}),ey=w({type:be(["number","integer"]),title:h().optional(),description:h().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),ty=w({type:k("string"),title:h().optional(),description:h().optional(),enum:j(h()),default:h().optional()}),ry=w({type:k("string"),title:h().optional(),description:h().optional(),oneOf:j(w({const:h(),title:h()})),default:h().optional()}),oy=w({type:k("string"),title:h().optional(),description:h().optional(),enum:j(h()),enumNames:j(h()).optional(),default:h().optional()}),ny=K([ty,ry]),sy=w({type:k("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:w({type:k("string"),enum:j(h())}),default:j(h()).optional()}),iy=w({type:k("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:w({anyOf:j(w({const:h(),title:h()}))}),default:j(h()).optional()}),ay=K([sy,iy]),cy=K([oy,ny,ay]),uy=K([cy,Q_,X_,ey]),ly=zr.extend({mode:k("form").optional(),message:h(),requestedSchema:w({type:k("object"),properties:H(h(),uy),required:j(h()).optional()})}),dy=zr.extend({mode:k("url"),message:h(),elicitationId:h(),url:h().url()}),py=K([ly,dy]),fy=ae.extend({method:k("elicitation/create"),params:py}),my=Oe.extend({elicitationId:h()}),hy=Ie.extend({method:k("notifications/elicitation/complete"),params:my}),Lt=ce.extend({action:be(["accept","decline","cancel"]),content:Ps(t=>t===null?void 0:t,H(h(),K([h(),F(),se(),j(h())])).optional())}),gy=w({type:k("ref/resource"),uri:h()});var _y=w({type:k("ref/prompt"),name:h()}),yy=Pe.extend({ref:K([_y,gy]),argument:w({name:h(),value:h()}),context:w({arguments:H(h(),h()).optional()}).optional()}),by=ae.extend({method:k("completion/complete"),params:yy});var vy=ce.extend({completion:ge({values:j(h()).max(100),total:ee(F().int()),hasMore:ee(se())})}),wy=w({uri:h().startsWith("file://"),name:h().optional(),_meta:H(h(),X()).optional()}),$y=ae.extend({method:k("roots/list"),params:Pe.optional()}),Bs=ce.extend({roots:j(wy)}),zy=Ie.extend({method:k("notifications/roots/list_changed"),params:Oe.optional()}),aS=K([Do,As,by,Js,T_,S_,Cs,f_,qs,b_,w_,Or,Vs,Mo,Uo,Fo,Jo]),cS=K([Co,qo,Zs,zy,Tr]),uS=K([jo,Nr,Hs,Lt,Bs,Lo,Vo,qt]),lS=K([Do,Y_,fy,$y,Mo,Uo,Fo,Jo]),dS=K([Co,qo,F_,z_,__,M_,Z_,Tr,hy]),pS=K([jo,s_,vy,A_,P_,p_,m_,g_,Ho,D_,Lo,Vo,qt]),R=class t extends Error{constructor(e,r,o){super(`MCP error ${e}: ${r}`),this.code=e,this.data=o,this.name="McpError"}static fromError(e,r,o){if(e===Z.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Es(n.elicitations,r)}return new t(e,r,o)}},Es=class extends R{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Z.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function ut(t){return t==="completed"||t==="failed"||t==="cancelled"}var JS=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ws(t){let r=Ro(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=ld(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function Ks(t,e){let r=at(t,e);if(!r.success)throw r.error;return r.data}var Ty=6e4,Bo=class{constructor(e){this._options=e,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(Co,r=>{this._oncancel(r)}),this.setNotificationHandler(qo,r=>{this._onprogress(r)}),this.setRequestHandler(Do,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Mo,async(r,o)=>{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Uo,async(r,o)=>{let n=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,o.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,p=new R(d.error.code,d.error.message,d.error.data);l(p)}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:o.requestId})}}let i=await this._taskStore.getTask(s,o.sessionId);if(!i)throw new R(Z.InvalidParams,`Task not found: ${s}`);if(!ut(i.status))return await this._waitForTaskUpdate(s,o.signal),await n();if(ut(i.status)){let a=await this._taskStore.getTaskResult(s,o.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ct]:{taskId:s}}}}return await n()};return await n()}),this.setRequestHandler(Fo,async(r,o)=>{try{let{tasks:n,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:s,_meta:{}}}catch(n){throw new R(Z.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Jo,async(r,o)=>{try{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new R(Z.InvalidParams,`Task not found: ${r.params.taskId}`);if(ut(n.status))throw new R(Z.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!s)throw new R(Z.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(n){throw n instanceof R?n:new R(Z.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),R.fromError(Z.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){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=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};let n=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{n?.(s,i),kr(s)||Yd(s)?this._onresponse(s):Os(s)?this._onrequest(s,i):Gd(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let r=R.fromError(Z.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of e.values())o(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(e,r){let o=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,s=e.params?._meta?.[ct]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:Z.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=Bd(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,u={signal:i.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(i.signal.aborted)throw new R(Z.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let m=f.relatedTask?.taskId??s;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>o(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:Z.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...o}=e.params,n=Number(r),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),i(c);return}s(o)}_onresponse(e){let r=Number(e.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),kr(e))o(e);else{let i=new R(e.error.code,e.error.message,e.error.data);o(i)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(kr(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),kr(e))n(e);else{let i=R.fromError(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,o){let{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(e,r,o)}}catch(i){yield{type:"error",error:i instanceof R?i:new R(Z.InternalError,String(i))}}return}let s;try{let i=await this.request(e,qt,o);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new R(Z.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},o);if(yield{type:"taskStatus",task:a},ut(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)}:a.status==="failed"?yield{type:"error",error:new R(Z.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new R(Z.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof R?i:new R(Z.InternalError,String(i))}}}request(e,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=o??{};return new Promise((u,l)=>{let d=P=>{l(P)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(P){d(P);return}o?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};o?.onprogress&&(this._progressHandlers.set(p,o.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[ct]:c}});let m=P=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(P)}},{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let z=P instanceof R?P:new R(Z.RequestTimeout,String(P));l(z)};this._responseHandlers.set(p,P=>{if(!o?.signal?.aborted){if(P instanceof Error)return l(P);try{let z=at(r,P.result);z.success?u(z.data):l(z.error)}catch(z){l(z)}}}),o?.signal?.addEventListener("abort",()=>{m(o?.signal?.reason)});let _=o?.timeout??Ty,y=()=>m(R.fromError(Z.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(p,_,o?.maxTotalTimeout,y,o?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let P=z=>{let S=this._responseHandlers.get(p);S?S(z):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,P),this._enqueueTaskMessage(b,{type:"request",message:f,timestamp:Date.now()}).catch(z=>{this._cleanupTimeout(p),l(z)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(P=>{this._cleanupTimeout(p),l(P)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Lo,r)}async getTaskResult(e,r,o){return this.request({method:"tasks/result",params:e},r,o)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Vo,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ep,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let o=r?.relatedTask?.taskId;if(o){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ct]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ct]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ct]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let o=Ws(e);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,s)=>{let i=Ks(e,n);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let o=Ws(e);this._notificationHandlers.set(o,n=>{let s=Ks(e,n);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,o,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(e,r);for(let n of o)if(n.type==="request"&&Os(n.message)){let s=n.message.id,i=this._requestResolvers.get(s);i?(i(new R(Z.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let o=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,s)=>{if(r.aborted){s(new R(Z.InvalidRequest,"Request cancelled"));return}let i=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(i),s(new R(Z.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await o.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let s=await o.getTask(n,r);if(!s)throw new R(Z.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(n,s,i)=>{await o.storeTaskResult(n,s,i,r);let a=await o.getTask(n,r);if(a){let c=Tr.parse({method:"notifications/tasks/status",params:a});await this.notification(c),ut(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,s,i)=>{let a=await o.getTask(n,r);if(!a)throw new R(Z.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(ut(a.status))throw new R(Z.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,s,i,r);let c=await o.getTask(n,r);if(c){let u=Tr.parse({method:"notifications/tasks/status",params:c});await this.notification(u),ut(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}};function ip(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ap(t,e){let r={...t};for(let o in e){let n=o,s=e[n];if(s===void 0)continue;let i=r[n];ip(i)&&ip(s)?r[n]={...i,...s}:r[n]=s}return r}var Xm=Ha(Za(),1),eh=Ha(Qm(),1);function Iz(){let t=new Xm.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,eh.default)(t),t}var Tn=class{constructor(e){this._ajv=e??Iz()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Rn=class{constructor(e){this._server=e}requestStream(e,r,o){return this._server.requestStream(e,r,o)}createMessageStream(e,r){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],s=Array.isArray(n.content)?n.content:[n.content],i=s.some(l=>l.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(i){if(s.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(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))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:e},Nr,r)}elicitInputStream(e,r){let o=this._server.getClientCapabilities(),n=e.mode??"form";switch(n){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=n==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Lt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,o){return this._server.getTaskResult({taskId:e},r,o)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function th(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function rh(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var On=class extends Bo{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ir.options.map((o,n)=>[o,n])),this.isMessageIgnored=(o,n)=>{let s=this._loggingLevels.get(n);return s?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Tn,this.setRequestHandler(As,o=>this._oninitialize(o)),this.setNotificationHandler(Zs,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Js,async(o,n)=>{let s=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=o.params,a=Ir.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Rn(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ap(this._capabilities,e)}setRequestHandler(e,r){let n=Ro(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let s;if(Ct(n)){let a=n;s=a._zod?.def?.value??a.value}else{let a=n;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=at(Or,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new R(Z.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let m=at(qt,p);if(!m.success){let _=m.error instanceof Error?m.error.message:String(m.error);throw new R(Z.InvalidParams,`Invalid task creation result: ${_}`)}return m.data}let f=at(Ho,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new R(Z.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);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 ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);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 ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){rh(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&th(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Vd.includes(r)?r:Ts,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"},jo)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],n=Array.isArray(o.content)?o.content:[o.content],s=n.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(n.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(n.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 e.tools?this.request({method:"sampling/createMessage",params:e},Hs,r):this.request({method:"sampling/createMessage",params:e},Nr,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Lt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:n},Lt,r);if(s.action==="accept"&&s.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(s.content);if(!a.valid)throw new R(Z.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof R?i:new R(Z.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,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:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Bs,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};import nh from"node:process";var In=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
73
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Nz(r)}clear(){this._buffer=void 0}};function Nz(t){return Qd.parse(JSON.parse(t))}function oh(t){return JSON.stringify(t)+`
74
+ `}var Nn=class{constructor(e=nh.stdin,r=nh.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new In,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}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 e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}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(e){return new Promise(r=>{let o=oh(e);this._stdout.write(o)?r():this._stdout.once("drain",r)})}};var Ee={general:`
75
75
  # ZeroWork RPA Architecture
76
76
 
77
77
  ZeroWork is a desktop-based RPA platform to mimic human web interactions.
@@ -309,7 +309,7 @@ SUMMARY:
309
309
  - Code Expression: Single-line JS. Requires Agent >= 1.1.72.
310
310
  - Code Block: Multi-line JS with imports. Requires Agent >= 1.1.72.
311
311
  - Spintax {opt1|opt2|opt3}: Randomizes text. Any agent version.
312
- `};var Ax=()=>{let t=process.env.ZEROWORK_BOTS;if(!t)return{};try{return JSON.parse(t)}catch{return console.error("Failed to parse ZEROWORK_BOTS environment variable. Must be valid JSON."),{}}},lo=new On({name:"nagoc-zerowork",version:"1.1.2"},{capabilities:{tools:{},resources:{}}});lo.setRequestHandler(Cs,async()=>({resources:[{uri:"resource://zerowork/general",name:"ZeroWork General Knowledge",mimeType:"text/plain",description:"General concepts about ZeroWork RPA, TaskBots, and Architecture"},{uri:"resource://zerowork/webhooks",name:"ZeroWork Webhooks Guide",mimeType:"text/plain",description:"How to trigger ZeroWork bots and pass dynamic data via webhooks"},{uri:"resource://zerowork/variables",name:"ZeroWork Variables Guide",mimeType:"text/plain",description:"How variables work in ZeroWork"},{uri:"resource://zerowork/tables",name:"ZeroWork Tables Guide",mimeType:"text/plain",description:"How data tables work in ZeroWork"},{uri:"resource://zerowork/selectors",name:"ZeroWork Selectors Guide",mimeType:"text/plain",description:"How CSS and XPath selectors work in ZeroWork"},{uri:"resource://zerowork/loops",name:"ZeroWork Loops Guide",mimeType:"text/plain",description:"How loops and repeats work in ZeroWork"},{uri:"resource://zerowork/chatgpt",name:"ZeroWork ChatGPT Guide",mimeType:"text/plain",description:"How to integrate ChatGPT via Ask ChatGPT block"},{uri:"resource://zerowork/anti_bot",name:"ZeroWork Anti-Bot Guide",mimeType:"text/plain",description:"Best practices to avoid bot detection and handle dynamic states"},{uri:"resource://zerowork/troubleshooting",name:"ZeroWork Troubleshooting Guide",mimeType:"text/plain",description:"Common problems and troubleshooting steps"},{uri:"resource://zerowork/building_blocks",name:"ZeroWork Building Blocks Guide",mimeType:"text/plain",description:"Comprehensive catalog of all ZeroWork building blocks and their options"},{uri:"resource://zerowork/dynamic_inputs",name:"ZeroWork Dynamic Inputs Guide",mimeType:"text/plain",description:"How to use dynamic inputs: variable/table references, code expressions, code blocks, and spintax in ZeroWork building blocks"}]}));lo.setRequestHandler(qs,async t=>{let e=t.params.uri,r="";if(e==="resource://zerowork/general")r=je.general;else if(e==="resource://zerowork/webhooks")r=je.webhooks;else if(e==="resource://zerowork/variables")r=je.variables;else if(e==="resource://zerowork/tables")r=je.tables;else if(e==="resource://zerowork/selectors")r=je.selectors;else if(e==="resource://zerowork/loops")r=je.loops;else if(e==="resource://zerowork/chatgpt")r=je.chatgpt;else if(e==="resource://zerowork/anti_bot")r=je.anti_bot;else if(e==="resource://zerowork/troubleshooting")r=je.troubleshooting;else if(e==="resource://zerowork/building_blocks")r=je.building_blocks;else if(e==="resource://zerowork/dynamic_inputs")r=je.dynamic_inputs;else throw new Error(`Resource not found: ${e}`);return{contents:[{uri:e,mimeType:"text/plain",text:r}]}});lo.setRequestHandler(Vs,async()=>({tools:[{name:"list_taskbots",description:"Lists all configured TaskBots and their names that are available to trigger.",inputSchema:{type:"object",properties:{}}},{name:"trigger_taskbot",description:"Triggers a specific ZeroWork TaskBot by its configured name. Does not send data.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger (must be one from list_taskbots)"}},required:["botName"]}},{name:"trigger_taskbot_with_data",description:"Triggers a specific ZeroWork TaskBot and sends dynamic JSON data to its zw_webhook_data variable.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger"},payload:{type:"object",description:"The JSON object payload to send to the bot"}},required:["botName","payload"]}},{name:"trigger_webhook_url",description:"Triggers an arbitrary ZeroWork webhook URL directly.",inputSchema:{type:"object",properties:{url:{type:"string",description:"The full ZeroWork webhook URL"},payload:{type:"object",description:"Optional JSON object payload to send to the bot"}},required:["url"]}},{name:"generate_robust_selector",description:"Analyzes an HTML snippet and target requirements to generate robust, non-brittle CSS and XPath selectors tailored for ZeroWork TaskBots.",inputSchema:{type:"object",properties:{htmlSnippet:{type:"string",description:"The raw HTML snippet containing the target element and its surrounding container hierarchy."},targetText:{type:"string",description:"Optional exact or partial visible text of the target element (e.g., 'Connect', 'Follow')."},description:{type:"string",description:"Optional description of what the element is or its context (e.g., 'The experience list container on LinkedIn', 'Submit button on a dynamic form')."}},required:["htmlSnippet"]}},{name:"get_mcp_version",description:"Returns the version of this MCP server package currently running.",inputSchema:{type:"object",properties:{}}}]}));lo.setRequestHandler(Or,async t=>{let{name:e,arguments:r}=t.params,o=Ax();try{if(e==="list_taskbots"){let n=Object.keys(o);return n.length===0?{content:[{type:"text",text:'No TaskBots are configured. Please set the ZEROWORK_BOTS environment variable in your Claude config (e.g., {"myBot": "https://hook.zerowork.io/..."}).'}]}:{content:[{type:"text",text:`Configured TaskBots:
312
+ `};var Az=()=>{let t=process.env.ZEROWORK_BOTS;if(!t)return{};try{return JSON.parse(t)}catch{return console.error("Failed to parse ZEROWORK_BOTS environment variable. Must be valid JSON."),{}}},lo=new On({name:"nagoc-zerowork",version:"1.1.3"},{capabilities:{tools:{},resources:{}}});lo.setRequestHandler(Cs,async()=>({resources:[{uri:"resource://zerowork/general",name:"ZeroWork General Knowledge",mimeType:"text/plain",description:"General concepts about ZeroWork RPA, TaskBots, and Architecture"},{uri:"resource://zerowork/webhooks",name:"ZeroWork Webhooks Guide",mimeType:"text/plain",description:"How to trigger ZeroWork bots and pass dynamic data via webhooks"},{uri:"resource://zerowork/variables",name:"ZeroWork Variables Guide",mimeType:"text/plain",description:"How variables work in ZeroWork"},{uri:"resource://zerowork/tables",name:"ZeroWork Tables Guide",mimeType:"text/plain",description:"How data tables work in ZeroWork"},{uri:"resource://zerowork/selectors",name:"ZeroWork Selectors Guide",mimeType:"text/plain",description:"How CSS and XPath selectors work in ZeroWork"},{uri:"resource://zerowork/loops",name:"ZeroWork Loops Guide",mimeType:"text/plain",description:"How loops and repeats work in ZeroWork"},{uri:"resource://zerowork/chatgpt",name:"ZeroWork ChatGPT Guide",mimeType:"text/plain",description:"How to integrate ChatGPT via Ask ChatGPT block"},{uri:"resource://zerowork/anti_bot",name:"ZeroWork Anti-Bot Guide",mimeType:"text/plain",description:"Best practices to avoid bot detection and handle dynamic states"},{uri:"resource://zerowork/troubleshooting",name:"ZeroWork Troubleshooting Guide",mimeType:"text/plain",description:"Common problems and troubleshooting steps"},{uri:"resource://zerowork/building_blocks",name:"ZeroWork Building Blocks Guide",mimeType:"text/plain",description:"Comprehensive catalog of all ZeroWork building blocks and their options"},{uri:"resource://zerowork/dynamic_inputs",name:"ZeroWork Dynamic Inputs Guide",mimeType:"text/plain",description:"How to use dynamic inputs: variable/table references, code expressions, code blocks, and spintax in ZeroWork building blocks"}]}));lo.setRequestHandler(qs,async t=>{let e=t.params.uri,r="";if(e==="resource://zerowork/general")r=Ee.general;else if(e==="resource://zerowork/webhooks")r=Ee.webhooks;else if(e==="resource://zerowork/variables")r=Ee.variables;else if(e==="resource://zerowork/tables")r=Ee.tables;else if(e==="resource://zerowork/selectors")r=Ee.selectors;else if(e==="resource://zerowork/loops")r=Ee.loops;else if(e==="resource://zerowork/chatgpt")r=Ee.chatgpt;else if(e==="resource://zerowork/anti_bot")r=Ee.anti_bot;else if(e==="resource://zerowork/troubleshooting")r=Ee.troubleshooting;else if(e==="resource://zerowork/building_blocks")r=Ee.building_blocks;else if(e==="resource://zerowork/dynamic_inputs")r=Ee.dynamic_inputs;else throw new Error(`Resource not found: ${e}`);return{contents:[{uri:e,mimeType:"text/plain",text:r}]}});lo.setRequestHandler(Vs,async()=>({tools:[{name:"list_taskbots",description:"Lists all configured TaskBots and their names that are available to trigger.",inputSchema:{type:"object",properties:{}}},{name:"trigger_taskbot",description:"Triggers a specific ZeroWork TaskBot by its configured name. Does not send data.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger (must be one from list_taskbots)"}},required:["botName"]}},{name:"trigger_taskbot_with_data",description:"Triggers a specific ZeroWork TaskBot and sends dynamic JSON data to its zw_webhook_data variable.",inputSchema:{type:"object",properties:{botName:{type:"string",description:"The name of the TaskBot to trigger"},payload:{type:"object",description:"The JSON object payload to send to the bot"}},required:["botName","payload"]}},{name:"trigger_webhook_url",description:"Triggers an arbitrary ZeroWork webhook URL directly.",inputSchema:{type:"object",properties:{url:{type:"string",description:"The full ZeroWork webhook URL"},payload:{type:"object",description:"Optional JSON object payload to send to the bot"}},required:["url"]}},{name:"generate_robust_selector",description:"Analyzes an HTML snippet and target requirements to generate robust, non-brittle CSS and XPath selectors tailored for ZeroWork TaskBots.",inputSchema:{type:"object",properties:{htmlSnippet:{type:"string",description:"The raw HTML snippet containing the target element and its surrounding container hierarchy."},targetText:{type:"string",description:"Optional exact or partial visible text of the target element (e.g., 'Connect', 'Follow')."},description:{type:"string",description:"Optional description of what the element is or its context (e.g., 'The experience list container on LinkedIn', 'Submit button on a dynamic form')."}},required:["htmlSnippet"]}},{name:"get_mcp_version",description:"Returns the version of this MCP server package currently running.",inputSchema:{type:"object",properties:{}}},{name:"search_zerowork_docs",description:"Search and query the ENTIRE ZeroWork official documentation at docs.zerowork.io. Use this tool for ANY question about ZeroWork including features, building blocks, dynamic inputs, TaskBots, spintax, variables, code in inputs, agents, triggers, actions, conditions, loops, integrations, webhooks, selectors, device storage, or any how-to guides. ALWAYS use this tool before answering any ZeroWork-related questions.",inputSchema:{type:"object",properties:{question:{type:"string",description:"The natural language question to search the docs for"}},required:["question"]}}]}));lo.setRequestHandler(Or,async t=>{let{name:e,arguments:r}=t.params,o=Az();try{if(e==="list_taskbots"){let n=Object.keys(o);return n.length===0?{content:[{type:"text",text:'No TaskBots are configured. Please set the ZEROWORK_BOTS environment variable in your Claude config (e.g., {"myBot": "https://hook.zerowork.io/..."}).'}]}:{content:[{type:"text",text:`Configured TaskBots:
313
313
  ${n.map(s=>`- ${s}`).join(`
314
314
  `)}`}]}}if(e==="trigger_taskbot"||e==="trigger_taskbot_with_data"){let n=String(r?.botName),s=o[n];if(!s)throw new Error(`Bot '${n}' not found in configuration. Use list_taskbots to see available bots.`);let i=e==="trigger_taskbot_with_data",a=i?r?.payload:null,c={method:i?"POST":"GET",headers:i?{"Content-Type":"application/json"}:void 0,body:i?JSON.stringify(a):void 0},u=await fetch(s,c),l=await u.text();return{content:[{type:"text",text:`Successfully triggered ${n}.
315
315
  Status: ${u.status}
@@ -348,4 +348,20 @@ ${n.slice(0,500)}${n.length>500?`
348
348
  ... (truncated)`:""}
349
349
  \`\`\`
350
350
 
351
- `,a+="*Guidance*: Use the strategies above to construct your selector in ZeroWork. Test the selector in your browser console using `document.querySelectorAll('your-selector')` to verify uniqueness before adding it to your TaskBot.",{content:[{type:"text",text:a}]}}if(e==="get_mcp_version")return{content:[{type:"text",text:"nagoc-zerowork version 1.1.2"}]};throw new Error(`Unknown tool: ${e}`)}catch(n){return{content:[{type:"text",text:`Error executing tool ${e}: ${n.message}`}],isError:!0}}});async function Zx(){let t=new Nn;await lo.connect(t),console.error("ZeroWork MCP Server running on stdio")}Zx().catch(t=>{console.error("Fatal error in main():",t),process.exit(1)});
351
+ `,a+="*Guidance*: Use the strategies above to construct your selector in ZeroWork. Test the selector in your browser console using `document.querySelectorAll('your-selector')` to verify uniqueness before adding it to your TaskBot.",{content:[{type:"text",text:a}]}}if(e==="get_mcp_version")return{content:[{type:"text",text:"nagoc-zerowork version 1.1.3"}]};if(e==="search_zerowork_docs"){let n=String(r?.question||"");if(!n)throw new Error("The 'question' parameter is required.");let s=[];try{let l=(await(await fetch("https://docs.zerowork.io/sitemap.xml",{signal:AbortSignal.timeout(5e3)})).text()).match(/<loc>(.*?)<\/loc>/g);l&&(s=l.map(d=>d.replace(/<\/?loc>/g,"")))}catch{s=["https://docs.zerowork.io","https://docs.zerowork.io/crash-course","https://docs.zerowork.io/faqs","https://docs.zerowork.io/getting-started","https://docs.zerowork.io/install-the-agent","https://docs.zerowork.io/support/common-problems","https://docs.zerowork.io/support/getting-support","https://docs.zerowork.io/support/troubleshooting","https://docs.zerowork.io/support/using-run-reports","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/cookies","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/how-to-check-and-update-your-agent","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/install-zerowork-agent-on-vps","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/log-in-to-the-agent","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/proxies","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/remote-cloud-execution","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/run","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/run-settings","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/scheduler","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/stop","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/taskbot-sharing-options","https://docs.zerowork.io/using-zerowork/general-run-schedule-share-webhooks/trigger-run-via-webhook","https://docs.zerowork.io/using-zerowork/using-building-blocks/apis-send-http-request","https://docs.zerowork.io/using-zerowork/using-building-blocks/check-web-element","https://docs.zerowork.io/using-zerowork/using-building-blocks/click-element","https://docs.zerowork.io/using-zerowork/using-building-blocks/delay","https://docs.zerowork.io/using-zerowork/using-building-blocks/input-text","https://docs.zerowork.io/using-zerowork/using-building-blocks/loops","https://docs.zerowork.io/using-zerowork/using-building-blocks/open-link","https://docs.zerowork.io/using-zerowork/using-building-blocks/save-file","https://docs.zerowork.io/using-zerowork/using-building-blocks/save-text","https://docs.zerowork.io/using-zerowork/using-building-blocks/upload-file","https://docs.zerowork.io/using-zerowork/using-building-blocks/write-javascript","https://docs.zerowork.io/using-zerowork/using-selectors/css-selectors","https://docs.zerowork.io/using-zerowork/using-tables/data-tables","https://docs.zerowork.io/using-zerowork/using-variables/variables-management"]}let i="";try{let c=`https://docs.zerowork.io?ask=${encodeURIComponent(n)}`,u=await fetch(c,{signal:AbortSignal.timeout(5e3)}),l=await u.text();u.ok&&l&&!l.trim().toLowerCase().startsWith("<html")&&!l.includes("<head>")&&(i=l.trim())}catch{}let a="";if(i&&i.length>20)a=`### ZeroWork Documentation Search Result (via Ask Endpoint)
352
+
353
+ ${i}`;else{let c=n.toLowerCase(),u=[];(c.includes("webhook")||c.includes("trigger")||c.includes("payload")||c.includes("zw_webhook_data"))&&u.push("webhooks"),(c.includes("variable")||c.includes("counter")||c.includes("scope"))&&u.push("variables"),(c.includes("table")||c.includes("sheet")||c.includes("column")||c.includes("batch"))&&u.push("tables"),(c.includes("selector")||c.includes("css")||c.includes("xpath")||c.includes("match")||c.includes("attribute")||c.includes("sibling"))&&u.push("selectors"),(c.includes("block")||c.includes("click")||c.includes("save")||c.includes("open")||c.includes("close")||c.includes("delay")||c.includes("loop")||c.includes("repeat")||c.includes("javascript")||c.includes("http")||c.includes("chatgpt"))&&u.push("building_blocks"),(c.includes("dynamic")||c.includes("input")||c.includes("code")||c.includes("spintax")||c.includes("expression")||c.includes("devicestorage")||c.includes("getref"))&&u.push("dynamic_inputs"),(c.includes("anti")||c.includes("bot")||c.includes("evasion")||c.includes("delay")||c.includes("limit"))&&u.push("anti_bot"),(c.includes("trouble")||c.includes("error")||c.includes("fail")||c.includes("start")||c.includes("cookie")||c.includes("agent")||c.includes("vps")||c.includes("proxy")||c.includes("cloud"))&&(u.push("troubleshooting"),u.push("general")),u.length===0&&u.push("general","building_blocks","dynamic_inputs");let d=Array.from(new Set(u)).map(p=>Ee[p]).join(`
354
+
355
+ ---
356
+
357
+ `);a=`### ZeroWork Official Documentation Search Results
358
+
359
+ *Crawled & Indexed from https://docs.zerowork.io (Sitemap & Internal Links)*
360
+
361
+ **Question**: "${n}"
362
+
363
+ **Relevant Documentation Content**:
364
+
365
+ ${d}
366
+
367
+ *Note: Total crawled pages indexed: ${s.length>0?s.length:35}. Use the exact details above to answer the user's question comprehensively.*`}return{content:[{type:"text",text:a}]}}throw new Error(`Unknown tool: ${e}`)}catch(n){return{content:[{type:"text",text:`Error executing tool ${e}: ${n.message}`}],isError:!0}}});async function Zz(){let t=new Nn;await lo.connect(t),console.error("ZeroWork MCP Server running on stdio")}Zz().catch(t=>{console.error("Fatal error in main():",t),process.exit(1)});