@routinecrew/routinecode 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +219 -0
  2. package/bin/setup.js +367 -0
  3. package/hooks/hooks-config.json +38 -0
  4. package/hooks/post-build-check.sh +22 -0
  5. package/hooks/pre-edit-check.sh +25 -0
  6. package/hooks/session-start.sh +11 -0
  7. package/mcp-db-manager/dist/index.mjs +30654 -0
  8. package/mcp-db-manager/package.json +53 -0
  9. package/mcp-dev-tester/dist/index.mjs +72 -0
  10. package/mcp-dev-tester/package.json +29 -0
  11. package/mcp-doc-fetcher/dist/index.mjs +51 -0
  12. package/mcp-doc-fetcher/package.json +23 -0
  13. package/mcp-html-renderer/dist/index.mjs +105 -0
  14. package/mcp-html-renderer/package.json +35 -0
  15. package/mcp-intelligence/dist/index.mjs +54 -0
  16. package/mcp-intelligence/package.json +34 -0
  17. package/mcp-log-watcher/dist/index.mjs +92 -0
  18. package/mcp-log-watcher/package.json +27 -0
  19. package/mcp-plan-manager/dist/index.mjs +104 -0
  20. package/mcp-plan-manager/package.json +26 -0
  21. package/mcp-project-context/dist/index.mjs +60 -0
  22. package/mcp-project-context/package.json +24 -0
  23. package/mcp-routinecode/dist/index.mjs +56 -0
  24. package/mcp-routinecode/package.json +24 -0
  25. package/package.json +56 -0
  26. package/plugin/.claude-plugin/plugin.json +10 -0
  27. package/plugin/agents/analyzer.md +68 -0
  28. package/plugin/agents/crawler.md +70 -0
  29. package/plugin/agents/explorer.md +74 -0
  30. package/plugin/agents/implementor.md +113 -0
  31. package/plugin/agents/looker.md +61 -0
  32. package/plugin/agents/planner.md +87 -0
  33. package/plugin/agents/reviewer.md +140 -0
  34. package/plugin/agents/verifier.md +59 -0
  35. package/plugin/commands/analyze.md +48 -0
  36. package/plugin/commands/plan.md +54 -0
  37. package/plugin/commands/rc.md +86 -0
  38. package/plugin/routinecode-prompt.md +217 -0
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ var o0=Object.create;var Cu=Object.defineProperty;var s0=Object.getOwnPropertyDescriptor;var a0=Object.getOwnPropertyNames;var c0=Object.getPrototypeOf,u0=Object.prototype.hasOwnProperty;var G=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ri=(t,e)=>{for(var r in e)Cu(t,r,{get:e[r],enumerable:!0})},l0=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a0(e))!u0.call(t,i)&&i!==r&&Cu(t,i,{get:()=>e[i],enumerable:!(n=s0(e,i))||n.enumerable});return t};var Rr=(t,e,r)=>(r=t!=null?o0(c0(t)):{},l0(e||!t||!t.__esModule?Cu(r,"default",{value:t,enumerable:!0}):r,t));var Ho=b(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.regexpCode=pe.getEsmExportName=pe.getProperty=pe.safeStringify=pe.stringify=pe.strConcat=pe.addCodeArg=pe.str=pe._=pe.nil=pe._Code=pe.Name=pe.IDENTIFIER=pe._CodeOrName=void 0;var Fo=class{};pe._CodeOrName=Fo;pe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var dn=class extends Fo{constructor(e){if(super(),!pe.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}}};pe.Name=dn;var jt=class extends Fo{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,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof dn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};pe._Code=jt;pe.nil=new jt("");function u$(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Np(r,e[n]),r.push(t[++n]);return new jt(r)}pe._=u$;var Rp=new jt("+");function l$(t,...e){let r=[Vo(t[0])],n=0;for(;n<e.length;)r.push(Rp),Np(r,e[n]),r.push(Rp,Vo(t[++n]));return JT(r),new jt(r)}pe.str=l$;function Np(t,e){e instanceof jt?t.push(...e._items):e instanceof dn?t.push(e):t.push(XT(e))}pe.addCodeArg=Np;function JT(t){let e=1;for(;e<t.length-1;){if(t[e]===Rp){let r=KT(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function KT(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof dn||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 dn))return`"${t}${e.slice(1)}`}function YT(t,e){return e.emptyStr()?t:t.emptyStr()?e:l$`${t}${e}`}pe.strConcat=YT;function XT(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Vo(Array.isArray(t)?t.join(","):t)}function QT(t){return new jt(Vo(t))}pe.stringify=QT;function Vo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pe.safeStringify=Vo;function eP(t){return typeof t=="string"&&pe.IDENTIFIER.test(t)?new jt(`.${t}`):u$`[${t}]`}pe.getProperty=eP;function tP(t){if(typeof t=="string"&&pe.IDENTIFIER.test(t))return new jt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pe.getEsmExportName=tP;function rP(t){return new jt(t.toString())}pe.regexpCode=rP});var Cp=b(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.ValueScope=ht.ValueScopeName=ht.Scope=ht.varKinds=ht.UsedValueState=void 0;var mt=Ho(),jp=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},fc;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(fc||(ht.UsedValueState=fc={}));ht.varKinds={const:new mt.Name("const"),let:new mt.Name("let"),var:new mt.Name("var")};var pc=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof mt.Name?e:this.name(e)}name(e){return new mt.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};ht.Scope=pc;var mc=class extends mt.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,mt._)`.${new mt.Name(r)}[${n}]`}};ht.ValueScopeName=mc;var nP=(0,mt._)`\n`,Ap=class extends pc{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?nP:mt.nil}}get(){return this._scope}name(e){return new mc(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let l=a.get(s);if(l)return l}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,i.setValue(r,{property:o,itemIndex:u}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,mt._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=mt.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,fc.Started);let l=r(u);if(l){let d=this.opts.es5?ht.varKinds.var:ht.varKinds.const;o=(0,mt._)`${o}${d} ${u} = ${l};${this.opts._n}`}else if(l=i?.(u))o=(0,mt._)`${o}${l}${this.opts._n}`;else throw new jp(u);c.set(u,fc.Completed)})}return o}};ht.ValueScope=Ap});var ee=b(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.or=re.and=re.not=re.CodeGen=re.operators=re.varKinds=re.ValueScopeName=re.ValueScope=re.Scope=re.Name=re.regexpCode=re.stringify=re.getProperty=re.nil=re.strConcat=re.str=re._=void 0;var le=Ho(),Vt=Cp(),Vr=Ho();Object.defineProperty(re,"_",{enumerable:!0,get:function(){return Vr._}});Object.defineProperty(re,"str",{enumerable:!0,get:function(){return Vr.str}});Object.defineProperty(re,"strConcat",{enumerable:!0,get:function(){return Vr.strConcat}});Object.defineProperty(re,"nil",{enumerable:!0,get:function(){return Vr.nil}});Object.defineProperty(re,"getProperty",{enumerable:!0,get:function(){return Vr.getProperty}});Object.defineProperty(re,"stringify",{enumerable:!0,get:function(){return Vr.stringify}});Object.defineProperty(re,"regexpCode",{enumerable:!0,get:function(){return Vr.regexpCode}});Object.defineProperty(re,"Name",{enumerable:!0,get:function(){return Vr.Name}});var vc=Cp();Object.defineProperty(re,"Scope",{enumerable:!0,get:function(){return vc.Scope}});Object.defineProperty(re,"ValueScope",{enumerable:!0,get:function(){return vc.ValueScope}});Object.defineProperty(re,"ValueScopeName",{enumerable:!0,get:function(){return vc.ValueScopeName}});Object.defineProperty(re,"varKinds",{enumerable:!0,get:function(){return vc.varKinds}});re.operators={GT:new le._Code(">"),GTE:new le._Code(">="),LT:new le._Code("<"),LTE:new le._Code("<="),EQ:new le._Code("==="),NEQ:new le._Code("!=="),NOT:new le._Code("!"),OR:new le._Code("||"),AND:new le._Code("&&"),ADD:new le._Code("+")};var br=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Dp=class extends br{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Vt.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ii(this.rhs,e,r)),this}get names(){return this.rhs instanceof le._CodeOrName?this.rhs.names:{}}},hc=class extends br{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof le.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ii(this.rhs,e,r),this}get names(){let e=this.lhs instanceof le.Name?{}:{...this.lhs.names};return _c(e,this.rhs)}},Up=class extends hc{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Zp=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Mp=class extends br{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Lp=class extends br{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},qp=class extends br{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=ii(this.code,e,r),this}get names(){return this.code instanceof le._CodeOrName?this.code.names:{}}},Bo=class extends br{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(iP(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>mn(e,r.names),{})}},xr=class extends Bo{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Fp=class extends Bo{},ni=class extends xr{};ni.kind="else";var fn=class t extends xr{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 n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ni(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(d$(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ii(this.condition,e,r),this}get names(){let e=super.names;return _c(e,this.condition),this.else&&mn(e,this.else.names),e}};fn.kind="if";var pn=class extends xr{};pn.kind="for";var Vp=class extends pn{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=ii(this.iteration,e,r),this}get names(){return mn(super.names,this.iteration.names)}},Hp=class extends pn{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Vt.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=_c(super.names,this.from);return _c(e,this.to)}},gc=class extends pn{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}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=ii(this.iterable,e,r),this}get names(){return mn(super.names,this.iterable.names)}},Wo=class extends xr{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Wo.kind="func";var Go=class extends Bo{render(e){return"return "+super.render(e)}};Go.kind="return";var Bp=class extends xr{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 n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&mn(e,this.catch.names),this.finally&&mn(e,this.finally.names),e}},Jo=class extends xr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Jo.kind="catch";var Ko=class extends xr{render(e){return"finally"+super.render(e)}};Ko.kind="finally";var Wp=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
+ `:""},this._extScope=e,this._scope=new Vt.Scope({parent:e}),this._nodes=[new Fp]}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 n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}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,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new Dp(e,o,n)),o}const(e,r,n){return this._def(Vt.varKinds.const,e,r,n)}let(e,r,n){return this._def(Vt.varKinds.let,e,r,n)}var(e,r,n){return this._def(Vt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new hc(e,r,n))}add(e,r){return this._leafNode(new Up(e,re.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==le.nil&&this._leafNode(new qp(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,le.addCodeArg)(r,i));return r.push("}"),new le._Code(r)}if(e,r,n){if(this._blockNode(new fn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new fn(e))}else(){return this._elseNode(new ni)}endIf(){return this._endBlockNode(fn,ni)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Vp(e),r)}forRange(e,r,n,i,o=this.opts.es5?Vt.varKinds.var:Vt.varKinds.let){let s=this._scope.toName(e);return this._for(new Hp(o,s,r,n),()=>i(s))}forOf(e,r,n,i=Vt.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof le.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,le._)`${s}.length`,a=>{this.var(o,(0,le._)`${s}[${a}]`),n(o)})}return this._for(new gc("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?Vt.varKinds.var:Vt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,le._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new gc("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(pn)}label(e){return this._leafNode(new Zp(e))}break(e){return this._leafNode(new Mp(e))}return(e){let r=new Go;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Go)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Bp;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new Jo(o),r(o)}return n&&(this._currNode=i.finally=new Ko,this.code(n)),this._endBlockNode(Jo,Ko)}throw(e){return this._leafNode(new Lp(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 n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=le.nil,n,i){return this._blockNode(new Wo(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Wo)}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 n=this._currNode;if(n instanceof e||r&&n 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 fn))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}};re.CodeGen=Wp;function mn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function _c(t,e){return e instanceof le._CodeOrName?mn(t,e.names):t}function ii(t,e,r){if(t instanceof le.Name)return n(t);if(!i(t))return t;return new le._Code(t._items.reduce((o,s)=>(s instanceof le.Name&&(s=n(s)),s instanceof le._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof le._Code&&o._items.some(s=>s instanceof le.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function iP(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function d$(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,le._)`!${Gp(t)}`}re.not=d$;var oP=f$(re.operators.AND);function sP(...t){return t.reduce(oP)}re.and=sP;var aP=f$(re.operators.OR);function cP(...t){return t.reduce(aP)}re.or=cP;function f$(t){return(e,r)=>e===le.nil?r:r===le.nil?e:(0,le._)`${Gp(e)} ${t} ${Gp(r)}`}function Gp(t){return t instanceof le.Name?t:(0,le._)`(${t})`}});var de=b(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;var Ee=ee(),uP=Ho();function lP(t){let e={};for(let r of t)e[r]=!0;return e}oe.toHash=lP;function dP(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(h$(t,e),!g$(e,t.self.RULES.all))}oe.alwaysValidSchema=dP;function h$(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||y$(t,`unknown keyword: "${o}"`)}oe.checkUnknownRules=h$;function g$(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}oe.schemaHasRules=g$;function fP(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}oe.schemaHasRulesButRef=fP;function pP({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ee._)`${r}`}return(0,Ee._)`${t}${e}${(0,Ee.getProperty)(n)}`}oe.schemaRefOrVal=pP;function mP(t){return _$(decodeURIComponent(t))}oe.unescapeFragment=mP;function hP(t){return encodeURIComponent(Kp(t))}oe.escapeFragment=hP;function Kp(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=Kp;function _$(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=_$;function gP(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}oe.eachItem=gP;function p$({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof Ee.Name?(o instanceof Ee.Name?t(i,o,s):e(i,o,s),s):o instanceof Ee.Name?(e(i,s,o),o):r(o,s);return a===Ee.Name&&!(c instanceof Ee.Name)?n(i,c):c}}oe.mergeEvaluated={props:p$({mergeNames:(t,e,r)=>t.if((0,Ee._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Ee._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Ee._)`${r} || {}`).code((0,Ee._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Ee._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Ee._)`${r} || {}`),Yp(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:v$}),items:p$({mergeNames:(t,e,r)=>t.if((0,Ee._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Ee._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Ee._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Ee._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function v$(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Ee._)`{}`);return e!==void 0&&Yp(t,r,e),r}oe.evaluatedPropsToName=v$;function Yp(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Ee._)`${e}${(0,Ee.getProperty)(n)}`,!0))}oe.setEvaluated=Yp;var m$={};function _P(t,e){return t.scopeValue("func",{ref:e,code:m$[e.code]||(m$[e.code]=new uP._Code(e.code))})}oe.useFunc=_P;var Jp;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Jp||(oe.Type=Jp={}));function vP(t,e,r){if(t instanceof Ee.Name){let n=e===Jp.Num;return r?n?(0,Ee._)`"[" + ${t} + "]"`:(0,Ee._)`"['" + ${t} + "']"`:n?(0,Ee._)`"/" + ${t}`:(0,Ee._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ee.getProperty)(t).toString():"/"+Kp(t)}oe.getErrorPath=vP;function y$(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}oe.checkStrictMode=y$});var Sr=b(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var et=ee(),yP={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};Xp.default=yP});var Yo=b(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.extendErrors=tt.resetErrorsCount=tt.reportExtraError=tt.reportError=tt.keyword$DataError=tt.keywordError=void 0;var fe=ee(),yc=de(),dt=Sr();tt.keywordError={message:({keyword:t})=>(0,fe.str)`must pass "${t}" keyword validation`};tt.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,fe.str)`"${t}" keyword must be ${e} ($data)`:(0,fe.str)`"${t}" keyword is invalid ($data)`};function $P(t,e=tt.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=x$(t,e,r);n??(s||a)?$$(o,c):b$(i,(0,fe._)`[${c}]`)}tt.reportError=$P;function bP(t,e=tt.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=x$(t,e,r);$$(i,a),o||s||b$(n,dt.default.vErrors)}tt.reportExtraError=bP;function xP(t,e){t.assign(dt.default.errors,e),t.if((0,fe._)`${dt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,fe._)`${dt.default.vErrors}.length`,e),()=>t.assign(dt.default.vErrors,null)))}tt.resetErrorsCount=xP;function SP({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,dt.default.errors,a=>{t.const(s,(0,fe._)`${dt.default.vErrors}[${a}]`),t.if((0,fe._)`${s}.instancePath === undefined`,()=>t.assign((0,fe._)`${s}.instancePath`,(0,fe.strConcat)(dt.default.instancePath,o.errorPath))),t.assign((0,fe._)`${s}.schemaPath`,(0,fe.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,fe._)`${s}.schema`,r),t.assign((0,fe._)`${s}.data`,n))})}tt.extendErrors=SP;function $$(t,e){let r=t.const("err",e);t.if((0,fe._)`${dt.default.vErrors} === null`,()=>t.assign(dt.default.vErrors,(0,fe._)`[${r}]`),(0,fe._)`${dt.default.vErrors}.push(${r})`),t.code((0,fe._)`${dt.default.errors}++`)}function b$(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,fe._)`new ${t.ValidationError}(${e})`):(r.assign((0,fe._)`${n}.errors`,e),r.return(!1))}var hn={keyword:new fe.Name("keyword"),schemaPath:new fe.Name("schemaPath"),params:new fe.Name("params"),propertyName:new fe.Name("propertyName"),message:new fe.Name("message"),schema:new fe.Name("schema"),parentSchema:new fe.Name("parentSchema")};function x$(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,fe._)`{}`:wP(t,e,r)}function wP(t,e,r={}){let{gen:n,it:i}=t,o=[kP(i,r),EP(t,r)];return zP(t,e,o),n.object(...o)}function kP({errorPath:t},{instancePath:e}){let r=e?(0,fe.str)`${t}${(0,yc.getErrorPath)(e,yc.Type.Str)}`:t;return[dt.default.instancePath,(0,fe.strConcat)(dt.default.instancePath,r)]}function EP({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,fe.str)`${e}/${t}`;return r&&(i=(0,fe.str)`${i}${(0,yc.getErrorPath)(r,yc.Type.Str)}`),[hn.schemaPath,i]}function zP(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([hn.keyword,i],[hn.params,typeof e=="function"?e(t):e||(0,fe._)`{}`]),c.messages&&n.push([hn.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([hn.schema,s],[hn.parentSchema,(0,fe._)`${l}${d}`],[dt.default.data,o]),u&&n.push([hn.propertyName,u])}});var w$=b(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.boolOrEmptySchema=oi.topBoolOrEmptySchema=void 0;var IP=Yo(),TP=ee(),PP=Sr(),OP={message:"boolean schema is false"};function RP(t){let{gen:e,schema:r,validateName:n}=t;r===!1?S$(t,!1):typeof r=="object"&&r.$async===!0?e.return(PP.default.data):(e.assign((0,TP._)`${n}.errors`,null),e.return(!0))}oi.topBoolOrEmptySchema=RP;function NP(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),S$(t)):r.var(e,!0)}oi.boolOrEmptySchema=NP;function S$(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,IP.reportError)(i,OP,void 0,e)}});var Qp=b(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.getRules=si.isJSONType=void 0;var jP=["string","number","integer","boolean","null","object","array"],AP=new Set(jP);function CP(t){return typeof t=="string"&&AP.has(t)}si.isJSONType=CP;function DP(){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:{}}}si.getRules=DP});var em=b(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.shouldUseRule=Hr.shouldUseGroup=Hr.schemaHasRulesForType=void 0;function UP({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&k$(t,n)}Hr.schemaHasRulesForType=UP;function k$(t,e){return e.rules.some(r=>E$(t,r))}Hr.shouldUseGroup=k$;function E$(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Hr.shouldUseRule=E$});var Xo=b(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.reportTypeError=rt.checkDataTypes=rt.checkDataType=rt.coerceAndCheckDataType=rt.getJSONTypes=rt.getSchemaTypes=rt.DataType=void 0;var ZP=Qp(),MP=em(),LP=Yo(),Q=ee(),z$=de(),ai;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ai||(rt.DataType=ai={}));function qP(t){let e=I$(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}rt.getSchemaTypes=qP;function I$(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(ZP.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}rt.getJSONTypes=I$;function FP(t,e){let{gen:r,data:n,opts:i}=t,o=VP(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,MP.schemaHasRulesForType)(t,e[0]));if(s){let a=rm(e,n,i.strictNumbers,ai.Wrong);r.if(a,()=>{o.length?HP(t,e,o):nm(t)})}return s}rt.coerceAndCheckDataType=FP;var T$=new Set(["string","number","integer","boolean","null"]);function VP(t,e){return e?t.filter(r=>T$.has(r)||e==="array"&&r==="array"):[]}function HP(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Q._)`typeof ${i}`),a=n.let("coerced",(0,Q._)`undefined`);o.coerceTypes==="array"&&n.if((0,Q._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Q._)`${i}[0]`).assign(s,(0,Q._)`typeof ${i}`).if(rm(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Q._)`${a} !== undefined`);for(let u of r)(T$.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),nm(t),n.endIf(),n.if((0,Q._)`${a} !== undefined`,()=>{n.assign(i,a),BP(t,a)});function c(u){switch(u){case"string":n.elseIf((0,Q._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Q._)`"" + ${i}`).elseIf((0,Q._)`${i} === null`).assign(a,(0,Q._)`""`);return;case"number":n.elseIf((0,Q._)`${s} == "boolean" || ${i} === null
4
+ || (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,Q._)`+${i}`);return;case"integer":n.elseIf((0,Q._)`${s} === "boolean" || ${i} === null
5
+ || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,Q._)`+${i}`);return;case"boolean":n.elseIf((0,Q._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,Q._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Q._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Q._)`${s} === "string" || ${s} === "number"
6
+ || ${s} === "boolean" || ${i} === null`).assign(a,(0,Q._)`[${i}]`)}}}function BP({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Q._)`${e} !== undefined`,()=>t.assign((0,Q._)`${e}[${r}]`,n))}function tm(t,e,r,n=ai.Correct){let i=n===ai.Correct?Q.operators.EQ:Q.operators.NEQ,o;switch(t){case"null":return(0,Q._)`${e} ${i} null`;case"array":o=(0,Q._)`Array.isArray(${e})`;break;case"object":o=(0,Q._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Q._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Q._)`typeof ${e} ${i} ${t}`}return n===ai.Correct?o:(0,Q.not)(o);function s(a=Q.nil){return(0,Q.and)((0,Q._)`typeof ${e} == "number"`,a,r?(0,Q._)`isFinite(${e})`:Q.nil)}}rt.checkDataType=tm;function rm(t,e,r,n){if(t.length===1)return tm(t[0],e,r,n);let i,o=(0,z$.toHash)(t);if(o.array&&o.object){let s=(0,Q._)`typeof ${e} != "object"`;i=o.null?s:(0,Q._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Q.nil;o.number&&delete o.integer;for(let s in o)i=(0,Q.and)(i,tm(s,e,r,n));return i}rt.checkDataTypes=rm;var WP={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Q._)`{type: ${t}}`:(0,Q._)`{type: ${e}}`};function nm(t){let e=GP(t);(0,LP.reportError)(e,WP)}rt.reportTypeError=nm;function GP(t){let{gen:e,data:r,schema:n}=t,i=(0,z$.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var O$=b($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.assignDefaults=void 0;var ci=ee(),JP=de();function KP(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)P$(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>P$(t,o,i.default))}$c.assignDefaults=KP;function P$(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,ci._)`${o}${(0,ci.getProperty)(e)}`;if(i){(0,JP.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,ci._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,ci._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,ci._)`${a} = ${(0,ci.stringify)(r)}`)}});var At=b(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;var Re=ee(),im=de(),Br=Sr(),YP=de();function XP(t,e){let{gen:r,data:n,it:i}=t;r.if(sm(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Re._)`${e}`},!0),t.error()})}be.checkReportMissingProp=XP;function QP({gen:t,data:e,it:{opts:r}},n,i){return(0,Re.or)(...n.map(o=>(0,Re.and)(sm(t,e,o,r.ownProperties),(0,Re._)`${i} = ${o}`)))}be.checkMissingProp=QP;function eO(t,e){t.setParams({missingProperty:e},!0),t.error()}be.reportMissingProp=eO;function R$(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Re._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=R$;function om(t,e,r){return(0,Re._)`${R$(t)}.call(${e}, ${r})`}be.isOwnProperty=om;function tO(t,e,r,n){let i=(0,Re._)`${e}${(0,Re.getProperty)(r)} !== undefined`;return n?(0,Re._)`${i} && ${om(t,e,r)}`:i}be.propertyInData=tO;function sm(t,e,r,n){let i=(0,Re._)`${e}${(0,Re.getProperty)(r)} === undefined`;return n?(0,Re.or)(i,(0,Re.not)(om(t,e,r))):i}be.noPropertyInData=sm;function N$(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}be.allSchemaProperties=N$;function rO(t,e){return N$(e).filter(r=>!(0,im.alwaysValidSchema)(t,e[r]))}be.schemaProperties=rO;function nO({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,u){let l=u?(0,Re._)`${t}, ${e}, ${n}${i}`:e,d=[[Br.default.instancePath,(0,Re.strConcat)(Br.default.instancePath,o)],[Br.default.parentData,s.parentData],[Br.default.parentDataProperty,s.parentDataProperty],[Br.default.rootData,Br.default.rootData]];s.opts.dynamicRef&&d.push([Br.default.dynamicAnchors,Br.default.dynamicAnchors]);let f=(0,Re._)`${l}, ${r.object(...d)}`;return c!==Re.nil?(0,Re._)`${a}.call(${c}, ${f})`:(0,Re._)`${a}(${f})`}be.callValidateCode=nO;var iO=(0,Re._)`new RegExp`;function oO({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Re._)`${i.code==="new RegExp"?iO:(0,YP.useFunc)(t,i)}(${r}, ${n})`})}be.usePattern=oO;function sO(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Re._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:im.Type.Num},o),e.if((0,Re.not)(o),a)})}}be.validateArray=sO;function aO(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,im.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(s,(0,Re._)`${s} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,Re.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}be.validateUnion=aO});var C$=b(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.validateKeywordUsage=nr.validSchemaType=nr.funcKeywordCode=nr.macroKeywordCode=void 0;var ft=ee(),gn=Sr(),cO=At(),uO=Yo();function lO(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=A$(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:ft.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}nr.macroKeywordCode=lO;function dO(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;pO(c,e);let u=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,l=A$(n,i,u),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&j$(t),v(()=>t.error());else{let S=e.async?p():m();e.modifying&&j$(t),v(()=>fO(t,S))}}function p(){let S=n.let("ruleErrs",null);return n.try(()=>h((0,ft._)`await `),O=>n.assign(d,!1).if((0,ft._)`${O} instanceof ${c.ValidationError}`,()=>n.assign(S,(0,ft._)`${O}.errors`),()=>n.throw(O))),S}function m(){let S=(0,ft._)`${l}.errors`;return n.assign(S,null),h(ft.nil),S}function h(S=e.async?(0,ft._)`await `:ft.nil){let O=c.opts.passContext?gn.default.this:gn.default.self,E=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,ft._)`${S}${(0,cO.callValidateCode)(t,l,O,E)}`,e.modifying)}function v(S){var O;n.if((0,ft.not)((O=e.valid)!==null&&O!==void 0?O:d),S)}}nr.funcKeywordCode=dO;function j$(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,ft._)`${n.parentData}[${n.parentDataProperty}]`))}function fO(t,e){let{gen:r}=t;r.if((0,ft._)`Array.isArray(${e})`,()=>{r.assign(gn.default.vErrors,(0,ft._)`${gn.default.vErrors} === null ? ${e} : ${gn.default.vErrors}.concat(${e})`).assign(gn.default.errors,(0,ft._)`${gn.default.vErrors}.length`),(0,uO.extendErrors)(t)},()=>t.error())}function pO({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function A$(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,ft.stringify)(r)})}function mO(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}nr.validSchemaType=mO;function hO({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}nr.validateKeywordUsage=hO});var U$=b(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.extendSubschemaMode=Wr.extendSubschemaData=Wr.getSubschema=void 0;var ir=ee(),D$=de();function gO(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==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,ir._)`${t.schemaPath}${(0,ir.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,ir._)`${t.schemaPath}${(0,ir.getProperty)(e)}${(0,ir.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,D$.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Wr.getSubschema=gO;function _O(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==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,f=a.let("data",(0,ir._)`${e.data}${(0,ir.getProperty)(r)}`,!0);c(f),t.errorPath=(0,ir.str)`${u}${(0,D$.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,ir._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(i!==void 0){let u=i instanceof ir.Name?i:a.let("data",i,!0);c(u),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);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]}}Wr.extendSubschemaData=_O;function vO(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}Wr.extendSubschemaMode=vO});var am=b((YV,Z$)=>{"use strict";Z$.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 n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))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(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var L$=b((XV,M$)=>{"use strict";var Gr=M$.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};bc(e,n,i,t,"",t)};Gr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Gr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Gr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Gr.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 bc(t,e,r,n,i,o,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Gr.arrayKeywords)for(var f=0;f<d.length;f++)bc(t,e,r,d[f],i+"/"+l+"/"+f,o,i,l,n,f)}else if(l in Gr.propsKeywords){if(d&&typeof d=="object")for(var p in d)bc(t,e,r,d[p],i+"/"+l+"/"+yO(p),o,i,l,n,p)}else(l in Gr.keywords||t.allKeys&&!(l in Gr.skipKeywords))&&bc(t,e,r,d,i+"/"+l,o,i,l,n)}r(n,i,o,s,a,c,u)}}function yO(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qo=b(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.getSchemaRefs=gt.resolveUrl=gt.normalizeId=gt._getFullPath=gt.getFullPath=gt.inlineRef=void 0;var $O=de(),bO=am(),xO=L$(),SO=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function wO(t,e=!0){return typeof t=="boolean"?!0:e===!0?!cm(t):e?q$(t)<=e:!1}gt.inlineRef=wO;var kO=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function cm(t){for(let e in t){if(kO.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(cm)||typeof r=="object"&&cm(r))return!0}return!1}function q$(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!SO.has(r)&&(typeof t[r]=="object"&&(0,$O.eachItem)(t[r],n=>e+=q$(n)),e===1/0))return 1/0}return e}function F$(t,e="",r){r!==!1&&(e=ui(e));let n=t.parse(e);return V$(t,n)}gt.getFullPath=F$;function V$(t,e){return t.serialize(e).split("#")[0]+"#"}gt._getFullPath=V$;var EO=/#\/?$/;function ui(t){return t?t.replace(EO,""):""}gt.normalizeId=ui;function zO(t,e,r){return r=ui(r),t.resolve(e,r)}gt.resolveUrl=zO;var IO=/^[a-z_][-a-z0-9._]*$/i;function TO(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ui(t[r]||e),o={"":i},s=F$(n,i,!1),a={},c=new Set;return xO(t,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,v=o[m];typeof d[r]=="string"&&(v=S.call(this,d[r])),O.call(this,d.$anchor),O.call(this,d.$dynamicAnchor),o[f]=v;function S(E){let A=this.opts.uriResolver.resolve;if(E=ui(v?A(v,E):E),c.has(E))throw l(E);c.add(E);let z=this.refs[E];return typeof z=="string"&&(z=this.refs[z]),typeof z=="object"?u(d,z.schema,E):E!==ui(h)&&(E[0]==="#"?(u(d,a[E],E),a[E]=d):this.refs[E]=h),E}function O(E){if(typeof E=="string"){if(!IO.test(E))throw new Error(`invalid anchor "${E}"`);S.call(this,`#${E}`)}}}),a;function u(d,f,p){if(f!==void 0&&!bO(d,f))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}gt.getSchemaRefs=TO});var rs=b(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getData=Jr.KeywordCxt=Jr.validateFunctionCode=void 0;var J$=w$(),H$=Xo(),lm=em(),xc=Xo(),PO=O$(),ts=C$(),um=U$(),U=ee(),B=Sr(),OO=Qo(),wr=de(),es=Yo();function RO(t){if(X$(t)&&(Q$(t),Y$(t))){AO(t);return}K$(t,()=>(0,J$.topBoolOrEmptySchema)(t))}Jr.validateFunctionCode=RO;function K$({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,U._)`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{t.code((0,U._)`"use strict"; ${B$(r,i)}`),jO(t,i),t.code(o)}):t.func(e,(0,U._)`${B.default.data}, ${NO(i)}`,n.$async,()=>t.code(B$(r,i)).code(o))}function NO(t){return(0,U._)`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${t.dynamicRef?(0,U._)`, ${B.default.dynamicAnchors}={}`:U.nil}}={}`}function jO(t,e){t.if(B.default.valCxt,()=>{t.var(B.default.instancePath,(0,U._)`${B.default.valCxt}.${B.default.instancePath}`),t.var(B.default.parentData,(0,U._)`${B.default.valCxt}.${B.default.parentData}`),t.var(B.default.parentDataProperty,(0,U._)`${B.default.valCxt}.${B.default.parentDataProperty}`),t.var(B.default.rootData,(0,U._)`${B.default.valCxt}.${B.default.rootData}`),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,U._)`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{t.var(B.default.instancePath,(0,U._)`""`),t.var(B.default.parentData,(0,U._)`undefined`),t.var(B.default.parentDataProperty,(0,U._)`undefined`),t.var(B.default.rootData,B.default.data),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,U._)`{}`)})}function AO(t){let{schema:e,opts:r,gen:n}=t;K$(t,()=>{r.$comment&&e.$comment&&tb(t),MO(t),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated&&CO(t),eb(t),FO(t)})}function CO(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,U._)`${r}.evaluated`),e.if((0,U._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,U._)`${t.evaluated}.props`,(0,U._)`undefined`)),e.if((0,U._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,U._)`${t.evaluated}.items`,(0,U._)`undefined`))}function B$(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function DO(t,e){if(X$(t)&&(Q$(t),Y$(t))){UO(t,e);return}(0,J$.boolOrEmptySchema)(t,e)}function Y$({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 X$(t){return typeof t.schema!="boolean"}function UO(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&tb(t),LO(t),qO(t);let o=n.const("_errs",B.default.errors);eb(t,o),n.var(e,(0,U._)`${o} === ${B.default.errors}`)}function Q$(t){(0,wr.checkUnknownRules)(t),ZO(t)}function eb(t,e){if(t.opts.jtd)return W$(t,[],!1,e);let r=(0,H$.getSchemaTypes)(t.schema),n=(0,H$.coerceAndCheckDataType)(t,r);W$(t,r,!n,e)}function ZO(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,wr.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function MO(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,wr.checkStrictMode)(t,"default is ignored in the schema root")}function LO(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,OO.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function qO(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function tb({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,U._)`${B.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,U.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,U._)`${B.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function FO(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,U._)`${B.default.errors} === 0`,()=>e.return(B.default.data),()=>e.throw((0,U._)`new ${i}(${B.default.vErrors})`)):(e.assign((0,U._)`${n}.errors`,B.default.vErrors),o.unevaluated&&VO(t),e.return((0,U._)`${B.default.errors} === 0`))}function VO({gen:t,evaluated:e,props:r,items:n}){r instanceof U.Name&&t.assign((0,U._)`${e}.props`,r),n instanceof U.Name&&t.assign((0,U._)`${e}.items`,n)}function W$(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,wr.schemaHasRulesButRef)(o,l))){i.block(()=>nb(t,"$ref",l.all.$ref.definition));return}c.jtd||HO(t,e),i.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){(0,lm.shouldUseGroup)(o,f)&&(f.type?(i.if((0,xc.checkDataType)(f.type,s,c.strictNumbers)),G$(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,xc.reportTypeError)(t)),i.endIf()):G$(t,f),a||i.if((0,U._)`${B.default.errors} === ${n||0}`))}}function G$(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,PO.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,lm.shouldUseRule)(n,o)&&nb(t,o.keyword,o.definition,e.type)})}function HO(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(BO(t,e),t.opts.allowUnionTypes||WO(t,e),GO(t,t.dataTypes))}function BO(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{rb(t.dataTypes,r)||dm(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),KO(t,e)}}function WO(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&dm(t,"use allowUnionTypes to allow union type keyword")}function GO(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,lm.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>JO(e,s))&&dm(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function JO(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function rb(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function KO(t,e){let r=[];for(let n of t.dataTypes)rb(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function dm(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,wr.checkStrictMode)(t,e,t.opts.strictTypes)}var Sc=class{constructor(e,r,n){if((0,ts.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,wr.schemaRefOrVal)(e,this.schema,n,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",ib(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ts.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",B.default.errors))}result(e,r,n){this.failResult((0,U.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():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,U.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,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?es.reportExtraError:es.reportError)(this,this.def.error,r)}$dataError(){(0,es.reportError)(this,this.def.$dataError||es.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,es.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,n=U.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=U.nil,r=U.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,U.or)((0,U._)`${i} === undefined`,r)),e!==U.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==U.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,U.or)(s(),a());function s(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,U._)`${(0,xc.checkDataTypes)(c,r,o.opts.strictNumbers,xc.DataType.Wrong)}`}return U.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,U._)`!${c}(${r})`}return U.nil}}subschema(e,r){let n=(0,um.getSubschema)(this.it,e);(0,um.extendSubschemaData)(n,this.it,e),(0,um.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return DO(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=wr.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=wr.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,U.Name)),!0}};Jr.KeywordCxt=Sc;function nb(t,e,r,n){let i=new Sc(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ts.funcKeywordCode)(i,r):"macro"in r?(0,ts.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ts.funcKeywordCode)(i,r)}var YO=/^\/(?:[^~]|~0|~1)*$/,XO=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ib(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return B.default.rootData;if(t[0]==="/"){if(!YO.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=B.default.rootData}else{let u=XO.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(i=u[2],i==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(o=r[e-l],!i)return o}let s=o,a=i.split("/");for(let u of a)u&&(o=(0,U._)`${o}${(0,U.getProperty)((0,wr.unescapeJsonPointer)(u))}`,s=(0,U._)`${s} && ${o}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}Jr.getData=ib});var wc=b(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var fm=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};pm.default=fm});var ns=b(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});var mm=Qo(),hm=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,mm.resolveUrl)(e,r,n),this.missingSchema=(0,mm.normalizeId)((0,mm.getFullPath)(e,this.missingRef))}};gm.default=hm});var Ec=b(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.resolveSchema=Ct.getCompilingSchema=Ct.resolveRef=Ct.compileSchema=Ct.SchemaEnv=void 0;var Ht=ee(),QO=wc(),_n=Sr(),Bt=Qo(),ob=de(),eR=rs(),li=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=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,Bt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Ct.SchemaEnv=li;function vm(t){let e=sb.call(this,t);if(e)return e;let r=(0,Bt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Ht.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:QO.default,code:(0,Ht._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:_n.default.data,parentData:_n.default.parentData,parentDataProperty:_n.default.parentDataProperty,dataNames:[_n.default.data],dataPathArr:[Ht.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ht.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ht.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ht._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,eR.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let d=s.toString();l=`${s.scopeRefs(_n.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${_n.default.self}`,`${_n.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof Ht.Name?void 0:m,items:h instanceof Ht.Name?void 0:h,dynamicProps:m instanceof Ht.Name,dynamicItems:h instanceof Ht.Name},p.source&&(p.source.evaluated=(0,Ht.stringify)(p.evaluated))}return t.validate=p,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)}}Ct.compileSchema=vm;function tR(t,e,r){var n;r=(0,Bt.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=iR.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new li({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=rR.call(this,o)}Ct.resolveRef=tR;function rR(t){return(0,Bt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:vm.call(this,t)}function sb(t){for(let e of this._compilations)if(nR(e,t))return e}Ct.getCompilingSchema=sb;function nR(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function iR(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||kc.call(this,t,e)}function kc(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Bt._getFullPath)(this.opts.uriResolver,r),i=(0,Bt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return _m.call(this,r,t);let o=(0,Bt.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=kc.call(this,t,s);return typeof a?.schema!="object"?void 0:_m.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||vm.call(this,s),o===(0,Bt.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(i=(0,Bt.resolveUrl)(this.opts.uriResolver,i,u)),new li({schema:a,schemaId:c,root:t,baseId:i})}return _m.call(this,r,s)}}Ct.resolveSchema=kc;var oR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _m(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ob.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!oR.has(a)&&u&&(e=(0,Bt.resolveUrl)(this.opts.uriResolver,e,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,ob.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Bt.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=kc.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new li({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var ab=b((iH,sR)=>{sR.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 $m=b((oH,db)=>{"use strict";var aR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ub=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function ym(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var cR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function cb(t){return t.length=0,!0}function uR(t,e,r){if(t.length){let n=ym(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function lR(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=uR;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(s=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!a(i,n,r))break;a=cb}else{i.push(u);continue}}return i.length&&(a===cb?r.zone=i.join(""):s?n.push(i.join("")):n.push(ym(i))),r.address=n.join(""),r}function lb(t){if(dR(t,":")<2)return{host:t,isIPV6:!1};let e=lR(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function dR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function fR(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===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(i===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((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function pR(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function mR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ub(r)){let n=lb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}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}db.exports={nonSimpleDomain:cR,recomposeAuthority:mR,normalizeComponentEncoding:pR,removeDotSegments:fR,isIPv4:ub,isUUID:aR,normalizeIPv6:lb,stringArrayToHexStripped:ym}});var gb=b((sH,hb)=>{"use strict";var{isUUID:hR}=$m(),gR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,_R=["http","https","ws","wss","urn","urn:uuid"];function vR(t){return _R.indexOf(t)!==-1}function bm(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 fb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function pb(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 yR(t){return t.secure=bm(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function $R(t){if((t.port===(bm(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 bR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(gR);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=xm(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function xR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=xm(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function SR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!hR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function wR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var mb={scheme:"http",domainHost:!0,parse:fb,serialize:pb},kR={scheme:"https",domainHost:mb.domainHost,parse:fb,serialize:pb},zc={scheme:"ws",domainHost:!0,parse:yR,serialize:$R},ER={scheme:"wss",domainHost:zc.domainHost,parse:zc.parse,serialize:zc.serialize},zR={scheme:"urn",parse:bR,serialize:xR,skipNormalize:!0},IR={scheme:"urn:uuid",parse:SR,serialize:wR,skipNormalize:!0},Ic={http:mb,https:kR,ws:zc,wss:ER,urn:zR,"urn:uuid":IR};Object.setPrototypeOf(Ic,null);function xm(t){return t&&(Ic[t]||Ic[t.toLowerCase()])||void 0}hb.exports={wsIsSecure:bm,SCHEMES:Ic,isValidSchemeName:vR,getSchemeHandler:xm}});var yb=b((aH,Pc)=>{"use strict";var{normalizeIPv6:TR,removeDotSegments:is,recomposeAuthority:PR,normalizeComponentEncoding:Tc,isIPv4:OR,nonSimpleDomain:RR}=$m(),{SCHEMES:NR,getSchemeHandler:_b}=gb();function jR(t,e){return typeof t=="string"?t=or(kr(t,e),e):typeof t=="object"&&(t=kr(or(t,e),e)),t}function AR(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=vb(kr(t,n),kr(e,n),n,!0);return n.skipEscape=!0,or(i,n)}function vb(t,e,r,n){let i={};return n||(t=kr(or(t,r),r),e=kr(or(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=is(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=is(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=is(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=is(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function CR(t,e,r){return typeof t=="string"?(t=unescape(t),t=or(Tc(kr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=or(Tc(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=or(Tc(kr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=or(Tc(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function or(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:""},n=Object.assign({},e),i=[],o=_b(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=PR(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=is(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var DR=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kr(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(DR);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(OR(n.host)===!1){let c=TR(n.host);n.host=c.host.toLowerCase(),i=c.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=_b(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&i===!1&&RR(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var Sm={SCHEMES:NR,normalize:jR,resolve:AR,resolveComponent:vb,equal:CR,serialize:or,parse:kr};Pc.exports=Sm;Pc.exports.default=Sm;Pc.exports.fastUri=Sm});var bb=b(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var $b=yb();$b.code='require("ajv/dist/runtime/uri").default';wm.default=$b});var Tb=b(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.CodeGen=Je.Name=Je.nil=Je.stringify=Je.str=Je._=Je.KeywordCxt=void 0;var UR=rs();Object.defineProperty(Je,"KeywordCxt",{enumerable:!0,get:function(){return UR.KeywordCxt}});var di=ee();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return di._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return di.str}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return di.stringify}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return di.nil}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return di.Name}});Object.defineProperty(Je,"CodeGen",{enumerable:!0,get:function(){return di.CodeGen}});var ZR=wc(),Eb=ns(),MR=Qp(),os=Ec(),LR=ee(),ss=Qo(),Oc=Xo(),Em=de(),xb=ab(),qR=bb(),zb=(t,e)=>new RegExp(t,e);zb.code="new RegExp";var FR=["removeAdditional","useDefaults","coerceTypes"],VR=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),HR={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."},BR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Sb=200;function WR(t){var e,r,n,i,o,s,a,c,u,l,d,f,p,m,h,v,S,O,E,A,z,Ae,he,M,se;let Te=t.strict,x=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=x===!0||x===void 0?1:x||0,ve=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:zb,Yt=(i=t.uriResolver)!==null&&i!==void 0?i:qR.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:Te)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Te)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:Te)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Te)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=t.strictRequired)!==null&&p!==void 0?p:Te)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:xe,regExp:ve}:{optimize:xe,regExp:ve},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Sb,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:Sb,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(O=t.messages)!==null&&O!==void 0?O:!0,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(A=t.schemaId)!==null&&A!==void 0?A:"$id",addUsedSchema:(z=t.addUsedSchema)!==null&&z!==void 0?z:!0,validateSchema:(Ae=t.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:(he=t.validateFormats)!==null&&he!==void 0?he:!0,unicodeRegExp:(M=t.unicodeRegExp)!==null&&M!==void 0?M:!0,int32range:(se=t.int32range)!==null&&se!==void 0?se:!0,uriResolver:Yt}}var as=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...WR(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new LR.ValueScope({scope:{},prefixes:VR,es5:r,lines:n}),this.logger=QR(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,MR.getRules)(),wb.call(this,HR,e,"NOT SUPPORTED"),wb.call(this,BR,e,"DEPRECATED","warn"),this._metaOpts=YR.call(this),e.formats&&JR.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&KR.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),GR.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=xb;n==="id"&&(i={...xb},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!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 n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(l,d){await o.call(this,l.$schema);let f=this._addSchema(l,d);return f.validate||s.call(this,f)}async function o(l){l&&!this.getSchema(l)&&await i.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Eb.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await o.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ss.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=kb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new os.SchemaEnv({schema:{},schemaId:n});if(r=os.resolveSchema.call(this,i,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=kb.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 n=e[this.opts.schemaId];return n&&(n=(0,ss.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),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 n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(t1.call(this,n,r),!r)return(0,Em.eachItem)(n,o=>km.call(this,o)),this;n1.call(this,r);let i={...r,type:(0,Oc.getJSONTypes)(r.type),schemaType:(0,Oc.getJSONTypes)(r.schemaType)};return(0,Em.eachItem)(n,i.type.length===0?o=>km.call(this,o,i):o=>i.type.forEach(s=>km.call(this,o,i,s))),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 n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,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:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=s[a];u&&l&&(s[a]=Ib(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=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;n=(0,ss.normalizeId)(s||n);let u=ss.getSchemaRefs.call(this,e,n);return c=new os.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&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):os.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{os.compileSchema.call(this,e)}finally{this.opts=r}}};as.ValidationError=ZR.default;as.MissingRefError=Eb.default;Je.default=as;function wb(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function kb(t){return t=(0,ss.normalizeId)(t),this.schemas[t]||this.refs[t]}function GR(){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 JR(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function KR(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 YR(){let t={...this.opts};for(let e of FR)delete t[e];return t}var XR={log(){},warn(){},error(){}};function QR(t){if(t===!1)return XR;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 e1=/^[a-z_$][a-z0-9_$:-]*$/i;function t1(t,e){let{RULES:r}=this;if((0,Em.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!e1.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function km(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Oc.getJSONTypes)(e.type),schemaType:(0,Oc.getJSONTypes)(e.schemaType)}};e.before?r1.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function r1(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function n1(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Ib(e)),t.validateSchema=this.compile(e,!0))}var i1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ib(t){return{anyOf:[t,i1]}}});var Pb=b(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var o1={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zm.default=o1});var jb=b(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.callRef=vn.getValidate=void 0;var s1=ns(),Ob=At(),_t=ee(),fi=Sr(),Rb=Ec(),Rc=de(),a1={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&i===u.baseId)return d();let l=Rb.resolveRef.call(c,u,i,r);if(l===void 0)throw new s1.default(n.opts.uriResolver,i,r);if(l instanceof Rb.SchemaEnv)return f(l);return p(l);function d(){if(o===u)return Nc(t,s,o,o.$async);let m=e.scopeValue("root",{ref:u});return Nc(t,(0,_t._)`${m}.validate`,u,u.$async)}function f(m){let h=Nb(t,m);Nc(t,h,m,m.$async)}function p(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,_t.stringify)(m)}:{ref:m}),v=e.name("valid"),S=t.subschema({schema:m,dataTypes:[],schemaPath:_t.nil,topSchemaRef:h,errSchemaPath:r},v);t.mergeEvaluated(S),t.ok(v)}}};function Nb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,_t._)`${r.scopeValue("wrapper",{ref:e})}.validate`}vn.getValidate=Nb;function Nc(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,u=c.passContext?fi.default.this:_t.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,_t._)`await ${(0,Ob.callValidateCode)(t,e,u)}`),p(e),s||i.assign(m,!0)},h=>{i.if((0,_t._)`!(${h} instanceof ${o.ValidationError})`,()=>i.throw(h)),f(h),s||i.assign(m,!1)}),t.ok(m)}function d(){t.result((0,Ob.callValidateCode)(t,e,u),()=>p(e),()=>f(e))}function f(m){let h=(0,_t._)`${m}.errors`;i.assign(fi.default.vErrors,(0,_t._)`${fi.default.vErrors} === null ? ${h} : ${fi.default.vErrors}.concat(${h})`),i.assign(fi.default.errors,(0,_t._)`${fi.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let v=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Rc.mergeEvaluated.props(i,v.props,o.props));else{let S=i.var("props",(0,_t._)`${m}.evaluated.props`);o.props=Rc.mergeEvaluated.props(i,S,o.props,_t.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Rc.mergeEvaluated.items(i,v.items,o.items));else{let S=i.var("items",(0,_t._)`${m}.evaluated.items`);o.items=Rc.mergeEvaluated.items(i,S,o.items,_t.Name)}}}vn.callRef=Nc;vn.default=a1});var Ab=b(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var c1=Pb(),u1=jb(),l1=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c1.default,u1.default];Im.default=l1});var Cb=b(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var jc=ee(),Kr=jc.operators,Ac={maximum:{okStr:"<=",ok:Kr.LTE,fail:Kr.GT},minimum:{okStr:">=",ok:Kr.GTE,fail:Kr.LT},exclusiveMaximum:{okStr:"<",ok:Kr.LT,fail:Kr.GTE},exclusiveMinimum:{okStr:">",ok:Kr.GT,fail:Kr.LTE}},d1={message:({keyword:t,schemaCode:e})=>(0,jc.str)`must be ${Ac[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,jc._)`{comparison: ${Ac[t].okStr}, limit: ${e}}`},f1={keyword:Object.keys(Ac),type:"number",schemaType:"number",$data:!0,error:d1,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,jc._)`${r} ${Ac[e].fail} ${n} || isNaN(${r})`)}};Tm.default=f1});var Db=b(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var cs=ee(),p1={message:({schemaCode:t})=>(0,cs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,cs._)`{multipleOf: ${t}}`},m1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:p1,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,cs._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,cs._)`${s} !== parseInt(${s})`;t.fail$data((0,cs._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};Pm.default=m1});var Zb=b(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});function Ub(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}Om.default=Ub;Ub.code='require("ajv/dist/runtime/ucs2length").default'});var Mb=b(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});var yn=ee(),h1=de(),g1=Zb(),_1={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yn.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,yn._)`{limit: ${t}}`},v1={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:_1,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?yn.operators.GT:yn.operators.LT,s=i.opts.unicode===!1?(0,yn._)`${r}.length`:(0,yn._)`${(0,h1.useFunc)(t.gen,g1.default)}(${r})`;t.fail$data((0,yn._)`${s} ${o} ${n}`)}};Rm.default=v1});var Lb=b(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});var y1=At(),$1=de(),pi=ee(),b1={message:({schemaCode:t})=>(0,pi.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,pi._)`{pattern: ${t}}`},x1={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:b1,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,u=c.code==="new RegExp"?(0,pi._)`new RegExp`:(0,$1.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,pi._)`${u}(${o}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,pi._)`!${l}`)}else{let c=(0,y1.usePattern)(t,i);t.fail$data((0,pi._)`!${c}.test(${r})`)}}};Nm.default=x1});var qb=b(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var us=ee(),S1={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,us.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,us._)`{limit: ${t}}`},w1={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:S1,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?us.operators.GT:us.operators.LT;t.fail$data((0,us._)`Object.keys(${r}).length ${i} ${n}`)}};jm.default=w1});var Fb=b(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var ls=At(),ds=ee(),k1=de(),E1={message:({params:{missingProperty:t}})=>(0,ds.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ds._)`{missingProperty: ${t}}`},z1={keyword:"required",type:"object",schemaType:"array",$data:!0,error:E1,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():l(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let v=s.schemaEnv.baseId+s.errSchemaPath,S=`required property "${h}" is not defined at "${v}" (strictRequired)`;(0,k1.checkStrictMode)(s,S,s.opts.strictRequired)}}function u(){if(c||o)t.block$data(ds.nil,d);else for(let p of r)(0,ls.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>f(p,m)),t.ok(m)}else e.if((0,ls.checkMissingProp)(t,r,p)),(0,ls.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,ls.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,m){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(m,(0,ls.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ds.not)(m),()=>{t.error(),e.break()})},ds.nil)}}};Am.default=z1});var Vb=b(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});var fs=ee(),I1={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,fs.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,fs._)`{limit: ${t}}`},T1={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:I1,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?fs.operators.GT:fs.operators.LT;t.fail$data((0,fs._)`${r}.length ${i} ${n}`)}};Cm.default=T1});var Cc=b(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var Hb=am();Hb.code='require("ajv/dist/runtime/equal").default';Dm.default=Hb});var Bb=b(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var Um=Xo(),Ke=ee(),P1=de(),O1=Cc(),R1={message:({params:{i:t,j:e}})=>(0,Ke.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ke._)`{i: ${t}, j: ${e}}`},N1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:R1,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),u=o.items?(0,Um.getSchemaTypes)(o.items):[];t.block$data(c,l,(0,Ke._)`${s} === false`),t.ok(c);function l(){let m=e.let("i",(0,Ke._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,Ke._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,h){let v=e.name("item"),S=(0,Um.checkDataTypes)(u,v,a.opts.strictNumbers,Um.DataType.Wrong),O=e.const("indices",(0,Ke._)`{}`);e.for((0,Ke._)`;${m}--;`,()=>{e.let(v,(0,Ke._)`${r}[${m}]`),e.if(S,(0,Ke._)`continue`),u.length>1&&e.if((0,Ke._)`typeof ${v} == "string"`,(0,Ke._)`${v} += "_"`),e.if((0,Ke._)`typeof ${O}[${v}] == "number"`,()=>{e.assign(h,(0,Ke._)`${O}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,Ke._)`${O}[${v}] = ${m}`)})}function p(m,h){let v=(0,P1.useFunc)(e,O1.default),S=e.name("outer");e.label(S).for((0,Ke._)`;${m}--;`,()=>e.for((0,Ke._)`${h} = ${m}; ${h}--;`,()=>e.if((0,Ke._)`${v}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(S)})))}}};Zm.default=N1});var Wb=b(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var Mm=ee(),j1=de(),A1=Cc(),C1={message:"must be equal to constant",params:({schemaCode:t})=>(0,Mm._)`{allowedValue: ${t}}`},D1={keyword:"const",$data:!0,error:C1,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,Mm._)`!${(0,j1.useFunc)(e,A1.default)}(${r}, ${i})`):t.fail((0,Mm._)`${o} !== ${r}`)}};Lm.default=D1});var Gb=b(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var ps=ee(),U1=de(),Z1=Cc(),M1={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ps._)`{allowedValues: ${t}}`},L1={keyword:"enum",schemaType:"array",$data:!0,error:M1,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,U1.useFunc)(e,Z1.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);l=(0,ps.or)(...i.map((m,h)=>f(p,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",o,p=>e.if((0,ps._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function f(p,m){let h=i[m];return typeof h=="object"&&h!==null?(0,ps._)`${u()}(${r}, ${p}[${m}])`:(0,ps._)`${r} === ${h}`}}};qm.default=L1});var Jb=b(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});var q1=Cb(),F1=Db(),V1=Mb(),H1=Lb(),B1=qb(),W1=Fb(),G1=Vb(),J1=Bb(),K1=Wb(),Y1=Gb(),X1=[q1.default,F1.default,V1.default,H1.default,B1.default,W1.default,G1.default,J1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},K1.default,Y1.default];Fm.default=X1});var Hm=b(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateAdditionalItems=void 0;var $n=ee(),Vm=de(),Q1={message:({params:{len:t}})=>(0,$n.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,$n._)`{limit: ${t}}`},eN={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Q1,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Vm.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Kb(t,n)}};function Kb(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,$n._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,$n._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,Vm.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,$n._)`${a} <= ${e.length}`);r.if((0,$n.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:o,dataProp:l,dataPropType:Vm.Type.Num},u),s.allErrors||r.if((0,$n.not)(u),()=>r.break())})}}ms.validateAdditionalItems=Kb;ms.default=eN});var Bm=b(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.validateTuple=void 0;var Yb=ee(),Dc=de(),tN=At(),rN={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Xb(t,"additionalItems",e);r.items=!0,!(0,Dc.alwaysValidSchema)(r,e)&&t.ok((0,tN.validateArray)(t))}};function Xb(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;l(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Dc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,Yb._)`${o}.length`);r.forEach((d,f)=>{(0,Dc.alwaysValidSchema)(a,d)||(n.if((0,Yb._)`${u} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function l(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let v=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,Dc.checkStrictMode)(a,v,f.strictTuples)}}}hs.validateTuple=Xb;hs.default=rN});var Qb=b(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var nN=Bm(),iN={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,nN.validateTuple)(t,"items")};Wm.default=iN});var tx=b(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var ex=ee(),oN=de(),sN=At(),aN=Hm(),cN={message:({params:{len:t}})=>(0,ex.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ex._)`{limit: ${t}}`},uN={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cN,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,oN.alwaysValidSchema)(n,e)&&(i?(0,aN.validateAdditionalItems)(t,i):t.ok((0,sN.validateArray)(t)))}};Gm.default=uN});var rx=b(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});var Dt=ee(),Uc=de(),lN={message:({params:{min:t,max:e}})=>e===void 0?(0,Dt.str)`must contain at least ${t} valid item(s)`:(0,Dt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Dt._)`{minContains: ${t}}`:(0,Dt._)`{minContains: ${t}, maxContains: ${e}}`},dN={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:lN,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:u}=n;o.opts.next?(s=c===void 0?1:c,a=u):s=1;let l=e.const("len",(0,Dt._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,Uc.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Uc.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Uc.alwaysValidSchema)(o,r)){let h=(0,Dt._)`${l} >= ${s}`;a!==void 0&&(h=(0,Dt._)`${h} && ${l} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Dt._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),v=e.let("count",0);p(h,()=>e.if(h,()=>m(v)))}function p(h,v){e.forRange("i",0,l,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:Uc.Type.Num,compositeRule:!0},h),v()})}function m(h){e.code((0,Dt._)`${h}++`),a===void 0?e.if((0,Dt._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Dt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Dt._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};Jm.default=dN});var ox=b(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.validateSchemaDeps=sr.validatePropertyDeps=sr.error=void 0;var Km=ee(),fN=de(),gs=At();sr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Km.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Km._)`{property: ${t},
7
+ missingProperty: ${n},
8
+ depsCount: ${e},
9
+ deps: ${r}}`};var pN={keyword:"dependencies",type:"object",schemaType:"object",error:sr.error,code(t){let[e,r]=mN(t);nx(t,e),ix(t,r)}};function mN({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function nx(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,gs.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let u of a)(0,gs.checkReportMissingProp)(t,u)}):(r.if((0,Km._)`${c} && (${(0,gs.checkMissingProp)(t,a,o)})`),(0,gs.reportMissingProp)(t,o),r.else())}}sr.validatePropertyDeps=nx;function ix(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,fN.alwaysValidSchema)(o,e[a])||(r.if((0,gs.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}sr.validateSchemaDeps=ix;sr.default=pN});var ax=b(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var sx=ee(),hN=de(),gN={message:"property name must be valid",params:({params:t})=>(0,sx._)`{propertyName: ${t.propertyName}}`},_N={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:gN,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,hN.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,sx.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};Ym.default=_N});var Qm=b(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});var Zc=At(),Wt=ee(),vN=Sr(),Mc=de(),yN={message:"must NOT have additional properties",params:({params:t})=>(0,Wt._)`{additionalProperty: ${t.additionalProperty}}`},$N={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:yN,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Mc.alwaysValidSchema)(s,r))return;let u=(0,Zc.allSchemaProperties)(n.properties),l=(0,Zc.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Wt._)`${o} === ${vN.default.errors}`);function d(){e.forIn("key",i,v=>{!u.length&&!l.length?m(v):e.if(f(v),()=>m(v))})}function f(v){let S;if(u.length>8){let O=(0,Mc.schemaRefOrVal)(s,n.properties,"properties");S=(0,Zc.isOwnProperty)(e,O,v)}else u.length?S=(0,Wt.or)(...u.map(O=>(0,Wt._)`${v} === ${O}`)):S=Wt.nil;return l.length&&(S=(0,Wt.or)(S,...l.map(O=>(0,Wt._)`${(0,Zc.usePattern)(t,O)}.test(${v})`))),(0,Wt.not)(S)}function p(v){e.code((0,Wt._)`delete ${i}[${v}]`)}function m(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Mc.alwaysValidSchema)(s,r)){let S=e.name("valid");c.removeAdditional==="failing"?(h(v,S,!1),e.if((0,Wt.not)(S),()=>{t.reset(),p(v)})):(h(v,S),a||e.if((0,Wt.not)(S),()=>e.break()))}}function h(v,S,O){let E={keyword:"additionalProperties",dataProp:v,dataPropType:Mc.Type.Str};O===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(E,S)}}};Xm.default=$N});var lx=b(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var bN=rs(),cx=At(),eh=de(),ux=Qm(),xN={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&ux.default.code(new bN.KeywordCxt(o,ux.default,"additionalProperties"));let s=(0,cx.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=eh.mergeEvaluated.props(e,(0,eh.toHash)(s),o.props));let a=s.filter(d=>!(0,eh.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,cx.propertyInData)(e,i,d,o.opts.ownProperties)),l(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};th.default=xN});var mx=b(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var dx=At(),Lc=ee(),fx=de(),px=de(),SN={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,dx.allSchemaProperties)(r),c=a.filter(h=>(0,fx.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");o.props!==!0&&!(o.props instanceof Lc.Name)&&(o.props=(0,px.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let h of a)u&&p(h),o.allErrors?m(h):(e.var(l,!0),m(h),e.if(l))}function p(h){for(let v in u)new RegExp(h).test(v)&&(0,fx.checkStrictMode)(o,`property ${v} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",n,v=>{e.if((0,Lc._)`${(0,dx.usePattern)(t,h)}.test(${v})`,()=>{let S=c.includes(h);S||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:v,dataPropType:px.Type.Str},l),o.opts.unevaluated&&d!==!0?e.assign((0,Lc._)`${d}[${v}]`,!0):!S&&!o.allErrors&&e.if((0,Lc.not)(l),()=>e.break())})})}}};rh.default=SN});var hx=b(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var wN=de(),kN={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,wN.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};nh.default=kN});var gx=b(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var EN=At(),zN={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:EN.validateUnion,error:{message:"must match a schema in anyOf"}};ih.default=zN});var _x=b(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var qc=ee(),IN=de(),TN={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,qc._)`{passingSchemas: ${t.passing}}`},PN={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:TN,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(s,()=>t.reset(),()=>t.error(!0));function u(){o.forEach((l,d)=>{let f;(0,IN.alwaysValidSchema)(i,l)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,qc._)`${c} && ${s}`).assign(s,!1).assign(a,(0,qc._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,qc.Name)})})}}};oh.default=PN});var vx=b(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var ON=de(),RN={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,ON.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};sh.default=RN});var bx=b(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Fc=ee(),$x=de(),NN={message:({params:t})=>(0,Fc.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Fc._)`{failingKeyword: ${t.ifClause}}`},jN={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:NN,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,$x.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=yx(n,"then"),o=yx(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else i?e.if(a,u("then")):e.if((0,Fc.not)(a),u("else"));t.pass(s,()=>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 f=t.subschema({keyword:l},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,Fc._)`${l}`):t.setParams({ifClause:l})}}}};function yx(t,e){let r=t.schema[e];return r!==void 0&&!(0,$x.alwaysValidSchema)(t,r)}ah.default=jN});var xx=b(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var AN=de(),CN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,AN.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};ch.default=CN});var Sx=b(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var DN=Hm(),UN=Qb(),ZN=Bm(),MN=tx(),LN=rx(),qN=ox(),FN=ax(),VN=Qm(),HN=lx(),BN=mx(),WN=hx(),GN=gx(),JN=_x(),KN=vx(),YN=bx(),XN=xx();function QN(t=!1){let e=[WN.default,GN.default,JN.default,KN.default,YN.default,XN.default,FN.default,VN.default,qN.default,HN.default,BN.default];return t?e.push(UN.default,MN.default):e.push(DN.default,ZN.default),e.push(LN.default),e}uh.default=QN});var wx=b(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var De=ee(),ej={message:({schemaCode:t})=>(0,De.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,De._)`{format: ${t}}`},tj={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ej,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,De._)`${m}[${s}]`),v=r.let("fType"),S=r.let("format");r.if((0,De._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(v,(0,De._)`${h}.type || "string"`).assign(S,(0,De._)`${h}.validate`),()=>r.assign(v,(0,De._)`"string"`).assign(S,h)),t.fail$data((0,De.or)(O(),E()));function O(){return c.strictSchema===!1?De.nil:(0,De._)`${s} && !${S}`}function E(){let A=l.$async?(0,De._)`(${h}.async ? await ${S}(${n}) : ${S}(${n}))`:(0,De._)`${S}(${n})`,z=(0,De._)`(typeof ${S} == "function" ? ${A} : ${S}.test(${n}))`;return(0,De._)`${S} && ${S} !== true && ${v} === ${e} && !${z}`}}function p(){let m=d.formats[o];if(!m){O();return}if(m===!0)return;let[h,v,S]=E(m);h===e&&t.pass(A());function O(){if(c.strictSchema===!1){d.logger.warn(z());return}throw new Error(z());function z(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function E(z){let Ae=z instanceof RegExp?(0,De.regexpCode)(z):c.code.formats?(0,De._)`${c.code.formats}${(0,De.getProperty)(o)}`:void 0,he=r.scopeValue("formats",{key:o,ref:z,code:Ae});return typeof z=="object"&&!(z instanceof RegExp)?[z.type||"string",z.validate,(0,De._)`${he}.validate`]:["string",z,he]}function A(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,De._)`await ${S}(${n})`}return typeof v=="function"?(0,De._)`${S}(${n})`:(0,De._)`${S}.test(${n})`}}}};lh.default=tj});var kx=b(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var rj=wx(),nj=[rj.default];dh.default=nj});var Ex=b(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.contentVocabulary=mi.metadataVocabulary=void 0;mi.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mi.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Ix=b(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var ij=Ab(),oj=Jb(),sj=Sx(),aj=kx(),zx=Ex(),cj=[ij.default,oj.default,(0,sj.default)(),aj.default,zx.metadataVocabulary,zx.contentVocabulary];fh.default=cj});var Px=b(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.DiscrError=void 0;var Tx;(function(t){t.Tag="tag",t.Mapping="mapping"})(Tx||(Vc.DiscrError=Tx={}))});var Rx=b(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var hi=ee(),ph=Px(),Ox=Ec(),uj=ns(),lj=de(),dj={message:({params:{discrError:t,tagName:e}})=>t===ph.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,hi._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},fj={keyword:"discriminator",type:"object",schemaType:"object",error:dj,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,hi._)`${r}${(0,hi.getProperty)(a)}`);e.if((0,hi._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:ph.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,hi._)`${u} === ${m}`),e.assign(c,d(p[m]));e.else(),t.error(!1,{discrError:ph.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(p){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},m);return t.mergeEvaluated(h,hi.Name),m}function f(){var p;let m={},h=S(i),v=!0;for(let A=0;A<s.length;A++){let z=s[A];if(z?.$ref&&!(0,lj.schemaHasRulesButRef)(z,o.self.RULES)){let he=z.$ref;if(z=Ox.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,he),z instanceof Ox.SchemaEnv&&(z=z.schema),z===void 0)throw new uj.default(o.opts.uriResolver,o.baseId,he)}let Ae=(p=z?.properties)===null||p===void 0?void 0:p[a];if(typeof Ae!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);v=v&&(h||S(z)),O(Ae,A)}if(!v)throw new Error(`discriminator: "${a}" must be required`);return m;function S({required:A}){return Array.isArray(A)&&A.includes(a)}function O(A,z){if(A.const)E(A.const,z);else if(A.enum)for(let Ae of A.enum)E(Ae,z);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function E(A,z){if(typeof A!="string"||A in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[A]=z}}}};mh.default=fj});var Nx=b((JH,pj)=>{pj.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 gh=b((Ne,hh)=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.MissingRefError=Ne.ValidationError=Ne.CodeGen=Ne.Name=Ne.nil=Ne.stringify=Ne.str=Ne._=Ne.KeywordCxt=Ne.Ajv=void 0;var mj=Tb(),hj=Ix(),gj=Rx(),jx=Nx(),_j=["/properties"],Hc="http://json-schema.org/draft-07/schema",gi=class extends mj.default{_addVocabularies(){super._addVocabularies(),hj.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(gj.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(jx,_j):jx;this.addMetaSchema(e,Hc,!1),this.refs["http://json-schema.org/schema"]=Hc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Hc)?Hc:void 0)}};Ne.Ajv=gi;hh.exports=Ne=gi;hh.exports.Ajv=gi;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=gi;var vj=rs();Object.defineProperty(Ne,"KeywordCxt",{enumerable:!0,get:function(){return vj.KeywordCxt}});var _i=ee();Object.defineProperty(Ne,"_",{enumerable:!0,get:function(){return _i._}});Object.defineProperty(Ne,"str",{enumerable:!0,get:function(){return _i.str}});Object.defineProperty(Ne,"stringify",{enumerable:!0,get:function(){return _i.stringify}});Object.defineProperty(Ne,"nil",{enumerable:!0,get:function(){return _i.nil}});Object.defineProperty(Ne,"Name",{enumerable:!0,get:function(){return _i.Name}});Object.defineProperty(Ne,"CodeGen",{enumerable:!0,get:function(){return _i.CodeGen}});var yj=wc();Object.defineProperty(Ne,"ValidationError",{enumerable:!0,get:function(){return yj.default}});var $j=ns();Object.defineProperty(Ne,"MissingRefError",{enumerable:!0,get:function(){return $j.default}})});var qx=b(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.formatNames=cr.fastFormats=cr.fullFormats=void 0;function ar(t,e){return{validate:t,compare:e}}cr.fullFormats={date:ar(Ux,$h),time:ar(vh(!0),bh),"date-time":ar(Ax(!0),Mx),"iso-time":ar(vh(),Zx),"iso-date-time":ar(Ax(),Lx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Ej,"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:Nj,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:zj,int32:{type:"number",validate:Pj},int64:{type:"number",validate:Oj},float:{type:"number",validate:Dx},double:{type:"number",validate:Dx},password:!0,binary:!0};cr.fastFormats={...cr.fullFormats,date:ar(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,$h),time:ar(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,bh),"date-time":ar(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Mx),"iso-time":ar(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Zx),"iso-date-time":ar(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Lx),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};cr.formatNames=Object.keys(cr.fullFormats);function bj(t){return t%4===0&&(t%100!==0||t%400===0)}var xj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Sj=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ux(t){let e=xj.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&bj(r)?29:Sj[n])}function $h(t,e){if(t&&e)return t>e?1:t<e?-1:0}var _h=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function vh(t){return function(r){let n=_h.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-l*c,f=i-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function bh(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Zx(t,e){if(!(t&&e))return;let r=_h.exec(t),n=_h.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var yh=/t|\s/i;function Ax(t){let e=vh(t);return function(n){let i=n.split(yh);return i.length===2&&Ux(i[0])&&e(i[1])}}function Mx(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Lx(t,e){if(!(t&&e))return;let[r,n]=t.split(yh),[i,o]=e.split(yh),s=$h(r,i);if(s!==void 0)return s||bh(n,o)}var wj=/\/|:/,kj=/^(?:[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 Ej(t){return wj.test(t)&&kj.test(t)}var Cx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function zj(t){return Cx.lastIndex=0,Cx.test(t)}var Ij=-(2**31),Tj=2**31-1;function Pj(t){return Number.isInteger(t)&&t<=Tj&&t>=Ij}function Oj(t){return Number.isInteger(t)}function Dx(){return!0}var Rj=/[^\\]\\Z/;function Nj(t){if(Rj.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Fx=b(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.formatLimitDefinition=void 0;var jj=gh(),Gt=ee(),Yr=Gt.operators,Bc={formatMaximum:{okStr:"<=",ok:Yr.LTE,fail:Yr.GT},formatMinimum:{okStr:">=",ok:Yr.GTE,fail:Yr.LT},formatExclusiveMaximum:{okStr:"<",ok:Yr.LT,fail:Yr.GTE},formatExclusiveMinimum:{okStr:">",ok:Yr.GT,fail:Yr.LTE}},Aj={message:({keyword:t,schemaCode:e})=>(0,Gt.str)`should be ${Bc[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Gt._)`{comparison: ${Bc[t].okStr}, limit: ${e}}`};vi.formatLimitDefinition={keyword:Object.keys(Bc),type:"string",schemaType:"string",$data:!0,error:Aj,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new jj.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Gt._)`${f}[${c.schemaCode}]`);t.fail$data((0,Gt.or)((0,Gt._)`typeof ${p} != "object"`,(0,Gt._)`${p} instanceof RegExp`,(0,Gt._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Gt._)`${s.code.formats}${(0,Gt.getProperty)(f)}`:void 0});t.fail$data(d(m))}function d(f){return(0,Gt._)`${f}.compare(${r}, ${n}) ${Bc[i].fail} 0`}},dependencies:["format"]};var Cj=t=>(t.addKeyword(vi.formatLimitDefinition),t);vi.default=Cj});var Wx=b((_s,Bx)=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var yi=qx(),Dj=Fx(),xh=ee(),Vx=new xh.Name("fullFormats"),Uj=new xh.Name("fastFormats"),Sh=(t,e={keywords:!0})=>{if(Array.isArray(e))return Hx(t,e,yi.fullFormats,Vx),t;let[r,n]=e.mode==="fast"?[yi.fastFormats,Uj]:[yi.fullFormats,Vx],i=e.formats||yi.formatNames;return Hx(t,i,r,n),e.keywords&&(0,Dj.default)(t),t};Sh.get=(t,e="full")=>{let n=(e==="fast"?yi.fastFormats:yi.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Hx(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,xh._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}Bx.exports=_s=Sh;Object.defineProperty(_s,"__esModule",{value:!0});_s.default=Sh});var vs=b((hB,iS)=>{"use strict";var Lj=G("path"),ur="\\\\/",eS=`[^${ur}]`,Er="\\.",qj="\\+",Fj="\\?",Qc="\\/",Vj="(?=.)",tS="[^/]",wh=`(?:${Qc}|$)`,rS=`(?:^|${Qc})`,kh=`${Er}{1,2}${wh}`,Hj=`(?!${Er})`,Bj=`(?!${rS}${kh})`,Wj=`(?!${Er}{0,1}${wh})`,Gj=`(?!${kh})`,Jj=`[^.${Qc}]`,Kj=`${tS}*?`,nS={DOT_LITERAL:Er,PLUS_LITERAL:qj,QMARK_LITERAL:Fj,SLASH_LITERAL:Qc,ONE_CHAR:Vj,QMARK:tS,END_ANCHOR:wh,DOTS_SLASH:kh,NO_DOT:Hj,NO_DOTS:Bj,NO_DOT_SLASH:Wj,NO_DOTS_SLASH:Gj,QMARK_NO_DOT:Jj,STAR:Kj,START_ANCHOR:rS},Yj={...nS,SLASH_LITERAL:`[${ur}]`,QMARK:eS,STAR:`${eS}*?`,DOTS_SLASH:`${Er}{1,2}(?:[${ur}]|$)`,NO_DOT:`(?!${Er})`,NO_DOTS:`(?!(?:^|[${ur}])${Er}{1,2}(?:[${ur}]|$))`,NO_DOT_SLASH:`(?!${Er}{0,1}(?:[${ur}]|$))`,NO_DOTS_SLASH:`(?!${Er}{1,2}(?:[${ur}]|$))`,QMARK_NO_DOT:`[^.${ur}]`,START_ANCHOR:`(?:^|[${ur}])`,END_ANCHOR:`(?:[${ur}]|$)`},Xj={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};iS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Xj,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Lj.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Yj:nS}}});var eu=b(vt=>{"use strict";var Qj=G("path"),eA=process.platform==="win32",{REGEX_BACKSLASH:tA,REGEX_REMOVE_BACKSLASH:rA,REGEX_SPECIAL_CHARS:nA,REGEX_SPECIAL_CHARS_GLOBAL:iA}=vs();vt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);vt.hasRegexChars=t=>nA.test(t);vt.isRegexChar=t=>t.length===1&&vt.hasRegexChars(t);vt.escapeRegex=t=>t.replace(iA,"\\$1");vt.toPosixSlashes=t=>t.replace(tA,"/");vt.removeBackslashes=t=>t.replace(rA,e=>e==="\\"?"":e);vt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};vt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:eA===!0||Qj.sep==="\\";vt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?vt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};vt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};vt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var fS=b((_B,dS)=>{"use strict";var oS=eu(),{CHAR_ASTERISK:Eh,CHAR_AT:oA,CHAR_BACKWARD_SLASH:ys,CHAR_COMMA:sA,CHAR_DOT:zh,CHAR_EXCLAMATION_MARK:Ih,CHAR_FORWARD_SLASH:lS,CHAR_LEFT_CURLY_BRACE:Th,CHAR_LEFT_PARENTHESES:Ph,CHAR_LEFT_SQUARE_BRACKET:aA,CHAR_PLUS:cA,CHAR_QUESTION_MARK:sS,CHAR_RIGHT_CURLY_BRACE:uA,CHAR_RIGHT_PARENTHESES:aS,CHAR_RIGHT_SQUARE_BRACKET:lA}=vs(),cS=t=>t===lS||t===ys,uS=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},dA=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,u=-1,l=0,d=0,f=!1,p=!1,m=!1,h=!1,v=!1,S=!1,O=!1,E=!1,A=!1,z=!1,Ae=0,he,M,se={value:"",depth:0,isGlob:!1},Te=()=>u>=n,x=()=>c.charCodeAt(u+1),xe=()=>(he=M,c.charCodeAt(++u));for(;u<n;){M=xe();let it;if(M===ys){O=se.backslashes=!0,M=xe(),M===Th&&(S=!0);continue}if(S===!0||M===Th){for(Ae++;Te()!==!0&&(M=xe());){if(M===ys){O=se.backslashes=!0,xe();continue}if(M===Th){Ae++;continue}if(S!==!0&&M===zh&&(M=xe())===zh){if(f=se.isBrace=!0,m=se.isGlob=!0,z=!0,i===!0)continue;break}if(S!==!0&&M===sA){if(f=se.isBrace=!0,m=se.isGlob=!0,z=!0,i===!0)continue;break}if(M===uA&&(Ae--,Ae===0)){S=!1,f=se.isBrace=!0,z=!0;break}}if(i===!0)continue;break}if(M===lS){if(o.push(u),s.push(se),se={value:"",depth:0,isGlob:!1},z===!0)continue;if(he===zh&&u===l+1){l+=2;continue}d=u+1;continue}if(r.noext!==!0&&(M===cA||M===oA||M===Eh||M===sS||M===Ih)===!0&&x()===Ph){if(m=se.isGlob=!0,h=se.isExtglob=!0,z=!0,M===Ih&&u===l&&(A=!0),i===!0){for(;Te()!==!0&&(M=xe());){if(M===ys){O=se.backslashes=!0,M=xe();continue}if(M===aS){m=se.isGlob=!0,z=!0;break}}continue}break}if(M===Eh){if(he===Eh&&(v=se.isGlobstar=!0),m=se.isGlob=!0,z=!0,i===!0)continue;break}if(M===sS){if(m=se.isGlob=!0,z=!0,i===!0)continue;break}if(M===aA){for(;Te()!==!0&&(it=xe());){if(it===ys){O=se.backslashes=!0,xe();continue}if(it===lA){p=se.isBracket=!0,m=se.isGlob=!0,z=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&M===Ih&&u===l){E=se.negated=!0,l++;continue}if(r.noparen!==!0&&M===Ph){if(m=se.isGlob=!0,i===!0){for(;Te()!==!0&&(M=xe());){if(M===Ph){O=se.backslashes=!0,M=xe();continue}if(M===aS){z=!0;break}}continue}break}if(m===!0){if(z=!0,i===!0)continue;break}}r.noext===!0&&(h=!1,m=!1);let ve=c,Yt="",y="";l>0&&(Yt=c.slice(0,l),c=c.slice(l),d-=l),ve&&m===!0&&d>0?(ve=c.slice(0,d),y=c.slice(d)):m===!0?(ve="",y=c):ve=c,ve&&ve!==""&&ve!=="/"&&ve!==c&&cS(ve.charCodeAt(ve.length-1))&&(ve=ve.slice(0,-1)),r.unescape===!0&&(y&&(y=oS.removeBackslashes(y)),ve&&O===!0&&(ve=oS.removeBackslashes(ve)));let $={prefix:Yt,input:t,start:l,base:ve,glob:y,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:v,negated:E,negatedExtglob:A};if(r.tokens===!0&&($.maxDepth=0,cS(M)||s.push(se),$.tokens=s),r.parts===!0||r.tokens===!0){let it;for(let me=0;me<o.length;me++){let Xt=it?it+1:l,Qt=o[me],yt=t.slice(Xt,Qt);r.tokens&&(me===0&&l!==0?(s[me].isPrefix=!0,s[me].value=Yt):s[me].value=yt,uS(s[me]),$.maxDepth+=s[me].depth),(me!==0||yt!=="")&&a.push(yt),it=Qt}if(it&&it+1<t.length){let me=t.slice(it+1);a.push(me),r.tokens&&(s[s.length-1].value=me,uS(s[s.length-1]),$.maxDepth+=s[s.length-1].depth)}$.slashes=o,$.parts=a}return $};dS.exports=dA});var hS=b((vB,mS)=>{"use strict";var tu=vs(),Et=eu(),{MAX_LENGTH:ru,POSIX_REGEX_SOURCE:fA,REGEX_NON_SPECIAL_CHARS:pA,REGEX_SPECIAL_CHARS_BACKREF:mA,REPLACEMENTS:pS}=tu,hA=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Et.escapeRegex(i)).join("..")}return r},$i=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Oh=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=pS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ru,r.maxLength):ru,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=Et.isWindows(e),u=tu.globChars(c),l=tu.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:m,DOTS_SLASH:h,NO_DOT:v,NO_DOT_SLASH:S,NO_DOTS_SLASH:O,QMARK:E,QMARK_NO_DOT:A,STAR:z,START_ANCHOR:Ae}=u,he=j=>`(${a}(?:(?!${Ae}${j.dot?h:d}).)*?)`,M=r.dot?"":v,se=r.dot?E:A,Te=r.bash===!0?he(r):z;r.capture&&(Te=`(${Te})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let x={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Et.removePrefix(t,x),i=t.length;let xe=[],ve=[],Yt=[],y=o,$,it=()=>x.index===i-1,me=x.peek=(j=1)=>t[x.index+j],Xt=x.advance=()=>t[++x.index]||"",Qt=()=>t.slice(x.index+1),yt=(j="",Pe=0)=>{x.consumed+=j,x.index+=Pe},Ms=j=>{x.output+=j.output!=null?j.output:j.value,yt(j.value)},n0=()=>{let j=1;for(;me()==="!"&&(me(2)!=="("||me(3)==="?");)Xt(),x.start++,j++;return j%2===0?!1:(x.negated=!0,x.start++,!0)},Ls=j=>{x[j]++,Yt.push(j)},en=j=>{x[j]--,Yt.pop()},ae=j=>{if(y.type==="globstar"){let Pe=x.braces>0&&(j.type==="comma"||j.type==="brace"),I=j.extglob===!0||xe.length&&(j.type==="pipe"||j.type==="paren");j.type!=="slash"&&j.type!=="paren"&&!Pe&&!I&&(x.output=x.output.slice(0,-y.output.length),y.type="star",y.value="*",y.output=Te,x.output+=y.output)}if(xe.length&&j.type!=="paren"&&(xe[xe.length-1].inner+=j.value),(j.value||j.output)&&Ms(j),y&&y.type==="text"&&j.type==="text"){y.value+=j.value,y.output=(y.output||"")+j.value;return}j.prev=y,s.push(j),y=j},qs=(j,Pe)=>{let I={...l[Pe],conditions:1,inner:""};I.prev=y,I.parens=x.parens,I.output=x.output;let ne=(r.capture?"(":"")+I.open;Ls("parens"),ae({type:j,value:Pe,output:x.output?"":m}),ae({type:"paren",extglob:!0,value:Xt(),output:ne}),xe.push(I)},i0=j=>{let Pe=j.close+(r.capture?")":""),I;if(j.type==="negate"){let ne=Te;if(j.inner&&j.inner.length>1&&j.inner.includes("/")&&(ne=he(r)),(ne!==Te||it()||/^\)+$/.test(Qt()))&&(Pe=j.close=`)$))${ne}`),j.inner.includes("*")&&(I=Qt())&&/^\.[^\\/.]+$/.test(I)){let Ce=Oh(I,{...e,fastpaths:!1}).output;Pe=j.close=`)${Ce})${ne})`}j.prev.type==="bos"&&(x.negatedExtglob=!0)}ae({type:"paren",extglob:!0,value:$,output:Pe}),en("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let j=!1,Pe=t.replace(mA,(I,ne,Ce,ot,Me,Au)=>ot==="\\"?(j=!0,I):ot==="?"?ne?ne+ot+(Me?E.repeat(Me.length):""):Au===0?se+(Me?E.repeat(Me.length):""):E.repeat(Ce.length):ot==="."?d.repeat(Ce.length):ot==="*"?ne?ne+ot+(Me?Te:""):Te:ne?I:`\\${I}`);return j===!0&&(r.unescape===!0?Pe=Pe.replace(/\\/g,""):Pe=Pe.replace(/\\+/g,I=>I.length%2===0?"\\\\":I?"\\":"")),Pe===t&&r.contains===!0?(x.output=t,x):(x.output=Et.wrapOutput(Pe,x,e),x)}for(;!it();){if($=Xt(),$==="\0")continue;if($==="\\"){let I=me();if(I==="/"&&r.bash!==!0||I==="."||I===";")continue;if(!I){$+="\\",ae({type:"text",value:$});continue}let ne=/^\\+/.exec(Qt()),Ce=0;if(ne&&ne[0].length>2&&(Ce=ne[0].length,x.index+=Ce,Ce%2!==0&&($+="\\")),r.unescape===!0?$=Xt():$+=Xt(),x.brackets===0){ae({type:"text",value:$});continue}}if(x.brackets>0&&($!=="]"||y.value==="["||y.value==="[^")){if(r.posix!==!1&&$===":"){let I=y.value.slice(1);if(I.includes("[")&&(y.posix=!0,I.includes(":"))){let ne=y.value.lastIndexOf("["),Ce=y.value.slice(0,ne),ot=y.value.slice(ne+2),Me=fA[ot];if(Me){y.value=Ce+Me,x.backtrack=!0,Xt(),!o.output&&s.indexOf(y)===1&&(o.output=m);continue}}}($==="["&&me()!==":"||$==="-"&&me()==="]")&&($=`\\${$}`),$==="]"&&(y.value==="["||y.value==="[^")&&($=`\\${$}`),r.posix===!0&&$==="!"&&y.value==="["&&($="^"),y.value+=$,Ms({value:$});continue}if(x.quotes===1&&$!=='"'){$=Et.escapeRegex($),y.value+=$,Ms({value:$});continue}if($==='"'){x.quotes=x.quotes===1?0:1,r.keepQuotes===!0&&ae({type:"text",value:$});continue}if($==="("){Ls("parens"),ae({type:"paren",value:$});continue}if($===")"){if(x.parens===0&&r.strictBrackets===!0)throw new SyntaxError($i("opening","("));let I=xe[xe.length-1];if(I&&x.parens===I.parens+1){i0(xe.pop());continue}ae({type:"paren",value:$,output:x.parens?")":"\\)"}),en("parens");continue}if($==="["){if(r.nobracket===!0||!Qt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError($i("closing","]"));$=`\\${$}`}else Ls("brackets");ae({type:"bracket",value:$});continue}if($==="]"){if(r.nobracket===!0||y&&y.type==="bracket"&&y.value.length===1){ae({type:"text",value:$,output:`\\${$}`});continue}if(x.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError($i("opening","["));ae({type:"text",value:$,output:`\\${$}`});continue}en("brackets");let I=y.value.slice(1);if(y.posix!==!0&&I[0]==="^"&&!I.includes("/")&&($=`/${$}`),y.value+=$,Ms({value:$}),r.literalBrackets===!1||Et.hasRegexChars(I))continue;let ne=Et.escapeRegex(y.value);if(x.output=x.output.slice(0,-y.value.length),r.literalBrackets===!0){x.output+=ne,y.value=ne;continue}y.value=`(${a}${ne}|${y.value})`,x.output+=y.value;continue}if($==="{"&&r.nobrace!==!0){Ls("braces");let I={type:"brace",value:$,output:"(",outputIndex:x.output.length,tokensIndex:x.tokens.length};ve.push(I),ae(I);continue}if($==="}"){let I=ve[ve.length-1];if(r.nobrace===!0||!I){ae({type:"text",value:$,output:$});continue}let ne=")";if(I.dots===!0){let Ce=s.slice(),ot=[];for(let Me=Ce.length-1;Me>=0&&(s.pop(),Ce[Me].type!=="brace");Me--)Ce[Me].type!=="dots"&&ot.unshift(Ce[Me].value);ne=hA(ot,r),x.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let Ce=x.output.slice(0,I.outputIndex),ot=x.tokens.slice(I.tokensIndex);I.value=I.output="\\{",$=ne="\\}",x.output=Ce;for(let Me of ot)x.output+=Me.output||Me.value}ae({type:"brace",value:$,output:ne}),en("braces"),ve.pop();continue}if($==="|"){xe.length>0&&xe[xe.length-1].conditions++,ae({type:"text",value:$});continue}if($===","){let I=$,ne=ve[ve.length-1];ne&&Yt[Yt.length-1]==="braces"&&(ne.comma=!0,I="|"),ae({type:"comma",value:$,output:I});continue}if($==="/"){if(y.type==="dot"&&x.index===x.start+1){x.start=x.index+1,x.consumed="",x.output="",s.pop(),y=o;continue}ae({type:"slash",value:$,output:p});continue}if($==="."){if(x.braces>0&&y.type==="dot"){y.value==="."&&(y.output=d);let I=ve[ve.length-1];y.type="dots",y.output+=$,y.value+=$,I.dots=!0;continue}if(x.braces+x.parens===0&&y.type!=="bos"&&y.type!=="slash"){ae({type:"text",value:$,output:d});continue}ae({type:"dot",value:$,output:d});continue}if($==="?"){if(!(y&&y.value==="(")&&r.noextglob!==!0&&me()==="("&&me(2)!=="?"){qs("qmark",$);continue}if(y&&y.type==="paren"){let ne=me(),Ce=$;if(ne==="<"&&!Et.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(y.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test(Qt()))&&(Ce=`\\${$}`),ae({type:"text",value:$,output:Ce});continue}if(r.dot!==!0&&(y.type==="slash"||y.type==="bos")){ae({type:"qmark",value:$,output:A});continue}ae({type:"qmark",value:$,output:E});continue}if($==="!"){if(r.noextglob!==!0&&me()==="("&&(me(2)!=="?"||!/[!=<:]/.test(me(3)))){qs("negate",$);continue}if(r.nonegate!==!0&&x.index===0){n0();continue}}if($==="+"){if(r.noextglob!==!0&&me()==="("&&me(2)!=="?"){qs("plus",$);continue}if(y&&y.value==="("||r.regex===!1){ae({type:"plus",value:$,output:f});continue}if(y&&(y.type==="bracket"||y.type==="paren"||y.type==="brace")||x.parens>0){ae({type:"plus",value:$});continue}ae({type:"plus",value:f});continue}if($==="@"){if(r.noextglob!==!0&&me()==="("&&me(2)!=="?"){ae({type:"at",extglob:!0,value:$,output:""});continue}ae({type:"text",value:$});continue}if($!=="*"){($==="$"||$==="^")&&($=`\\${$}`);let I=pA.exec(Qt());I&&($+=I[0],x.index+=I[0].length),ae({type:"text",value:$});continue}if(y&&(y.type==="globstar"||y.star===!0)){y.type="star",y.star=!0,y.value+=$,y.output=Te,x.backtrack=!0,x.globstar=!0,yt($);continue}let j=Qt();if(r.noextglob!==!0&&/^\([^?]/.test(j)){qs("star",$);continue}if(y.type==="star"){if(r.noglobstar===!0){yt($);continue}let I=y.prev,ne=I.prev,Ce=I.type==="slash"||I.type==="bos",ot=ne&&(ne.type==="star"||ne.type==="globstar");if(r.bash===!0&&(!Ce||j[0]&&j[0]!=="/")){ae({type:"star",value:$,output:""});continue}let Me=x.braces>0&&(I.type==="comma"||I.type==="brace"),Au=xe.length&&(I.type==="pipe"||I.type==="paren");if(!Ce&&I.type!=="paren"&&!Me&&!Au){ae({type:"star",value:$,output:""});continue}for(;j.slice(0,3)==="/**";){let Fs=t[x.index+4];if(Fs&&Fs!=="/")break;j=j.slice(3),yt("/**",3)}if(I.type==="bos"&&it()){y.type="globstar",y.value+=$,y.output=he(r),x.output=y.output,x.globstar=!0,yt($);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!ot&&it()){x.output=x.output.slice(0,-(I.output+y.output).length),I.output=`(?:${I.output}`,y.type="globstar",y.output=he(r)+(r.strictSlashes?")":"|$)"),y.value+=$,x.globstar=!0,x.output+=I.output+y.output,yt($);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&j[0]==="/"){let Fs=j[1]!==void 0?"|$":"";x.output=x.output.slice(0,-(I.output+y.output).length),I.output=`(?:${I.output}`,y.type="globstar",y.output=`${he(r)}${p}|${p}${Fs})`,y.value+=$,x.output+=I.output+y.output,x.globstar=!0,yt($+Xt()),ae({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&j[0]==="/"){y.type="globstar",y.value+=$,y.output=`(?:^|${p}|${he(r)}${p})`,x.output=y.output,x.globstar=!0,yt($+Xt()),ae({type:"slash",value:"/",output:""});continue}x.output=x.output.slice(0,-y.output.length),y.type="globstar",y.output=he(r),y.value+=$,x.output+=y.output,x.globstar=!0,yt($);continue}let Pe={type:"star",value:$,output:Te};if(r.bash===!0){Pe.output=".*?",(y.type==="bos"||y.type==="slash")&&(Pe.output=M+Pe.output),ae(Pe);continue}if(y&&(y.type==="bracket"||y.type==="paren")&&r.regex===!0){Pe.output=$,ae(Pe);continue}(x.index===x.start||y.type==="slash"||y.type==="dot")&&(y.type==="dot"?(x.output+=S,y.output+=S):r.dot===!0?(x.output+=O,y.output+=O):(x.output+=M,y.output+=M),me()!=="*"&&(x.output+=m,y.output+=m)),ae(Pe)}for(;x.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing","]"));x.output=Et.escapeLast(x.output,"["),en("brackets")}for(;x.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing",")"));x.output=Et.escapeLast(x.output,"("),en("parens")}for(;x.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing","}"));x.output=Et.escapeLast(x.output,"{"),en("braces")}if(r.strictSlashes!==!0&&(y.type==="star"||y.type==="bracket")&&ae({type:"maybe_slash",value:"",output:`${p}?`}),x.backtrack===!0){x.output="";for(let j of x.tokens)x.output+=j.output!=null?j.output:j.value,j.suffix&&(x.output+=j.suffix)}return x};Oh.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ru,r.maxLength):ru,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=pS[t]||t;let o=Et.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:m}=tu.globChars(o),h=r.dot?d:l,v=r.dot?f:l,S=r.capture?"":"?:",O={negated:!1,prefix:""},E=r.bash===!0?".*?":p;r.capture&&(E=`(${E})`);let A=M=>M.noglobstar===!0?E:`(${S}(?:(?!${m}${M.dot?u:s}).)*?)`,z=M=>{switch(M){case"*":return`${h}${c}${E}`;case".*":return`${s}${c}${E}`;case"*.*":return`${h}${E}${s}${c}${E}`;case"*/*":return`${h}${E}${a}${c}${v}${E}`;case"**":return h+A(r);case"**/*":return`(?:${h}${A(r)}${a})?${v}${c}${E}`;case"**/*.*":return`(?:${h}${A(r)}${a})?${v}${E}${s}${c}${E}`;case"**/.*":return`(?:${h}${A(r)}${a})?${s}${c}${E}`;default:{let se=/^(.*?)\.(\w+)$/.exec(M);if(!se)return;let Te=z(se[1]);return Te?Te+s+se[2]:void 0}}},Ae=Et.removePrefix(t,O),he=z(Ae);return he&&r.strictSlashes!==!0&&(he+=`${a}?`),he};mS.exports=Oh});var _S=b((yB,gS)=>{"use strict";var gA=G("path"),_A=fS(),Rh=hS(),Nh=eu(),vA=vs(),yA=t=>t&&typeof t=="object"&&!Array.isArray(t),Ue=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>Ue(f,e,r));return f=>{for(let p of l){let m=p(f);if(m)return m}return!1}}let n=yA(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=Nh.isWindows(e),s=n?Ue.compileRe(t,e):Ue.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=Ue(i.ignore,l,r)}let u=(l,d=!1)=>{let{isMatch:f,match:p,output:m}=Ue.test(l,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:l,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(l)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(u.state=a),u};Ue.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?Nh.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Ue.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Ue.matchBase=(t,e,r,n=Nh.isWindows(r))=>(e instanceof RegExp?e:Ue.makeRe(e,r)).test(gA.basename(t));Ue.isMatch=(t,e,r)=>Ue(e,r)(t);Ue.parse=(t,e)=>Array.isArray(t)?t.map(r=>Ue.parse(r,e)):Rh(t,{...e,fastpaths:!1});Ue.scan=(t,e)=>_A(t,e);Ue.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Ue.toRegex(a,e);return n===!0&&(c.state=t),c};Ue.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=Rh.fastpaths(t,e)),i.output||(i=Rh(t,e)),Ue.compileRe(i,e,r,n)};Ue.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Ue.constants=vA;gS.exports=Ue});var jh=b(($B,vS)=>{"use strict";vS.exports=_S()});var ES=b((bB,kS)=>{"use strict";var bs=G("fs"),{Readable:$A}=G("stream"),$s=G("path"),{promisify:su}=G("util"),Ah=jh(),bA=su(bs.readdir),xA=su(bs.stat),yS=su(bs.lstat),SA=su(bs.realpath),wA="!",SS="READDIRP_RECURSIVE_ERROR",kA=new Set(["ENOENT","EPERM","EACCES","ELOOP",SS]),Ch="files",wS="directories",iu="files_directories",nu="all",$S=[Ch,wS,iu,nu],EA=t=>kA.has(t.code),[bS,zA]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),IA=process.platform==="win32"&&(bS>10||bS===10&&zA>=5),xS=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Ah(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let i=n.trim();i.charAt(0)===wA?r.push(Ah(i.slice(1))):e.push(Ah(i))}return r.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!r.some(i=>i(n.basename)):n=>!r.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},ou=class t extends $A{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Ch,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:i}=r;this._fileFilter=xS(r.fileFilter),this._directoryFilter=xS(r.directoryFilter);let o=r.lstat?yS:xA;IA?this._stat=s=>o(s,{bigint:!0}):this._stat=o,this._maxDepth=r.depth,this._wantsDir=[wS,iu,nu].includes(i),this._wantsFile=[Ch,iu,nu].includes(i),this._wantsEverything=i===nu,this._root=$s.resolve(n),this._isDirent="Dirent"in bs&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let o=i.splice(0,e).map(s=>this._formatEntry(s,r));for(let s of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(s);a==="directory"&&this._directoryFilter(s)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(s.fullPath,n+1)),this._wantsDir&&(this.push(s),e--)):(a==="file"||this._includeAsFile(s))&&this._fileFilter(s)&&this._wantsFile&&(this.push(s),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await bA(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let i=this._isDirent?e.name:e,o=$s.resolve($s.join(r,i));n={path:$s.relative(this._root,o),fullPath:o,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(i){this._onError(i)}return n}_onError(e){EA(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let i=await SA(n),o=await yS(i);if(o.isFile())return"file";if(o.isDirectory()){let s=i.length;if(n.startsWith(i)&&n.substr(s,1)===$s.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=SS,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},bi=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=iu),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!$S.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${$S.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new ou(e)},TA=(t,e={})=>new Promise((r,n)=>{let i=[];bi(t,e).on("data",o=>i.push(o)).on("end",()=>r(i)).on("error",o=>n(o))});bi.promise=TA;bi.ReaddirpStream=ou;bi.default=bi;kS.exports=bi});var Dh=b((xB,zS)=>{zS.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var i=t[2];(i==="?"||i===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//")}var o=t.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),n+o.join("/")}});var NS=b((OS,RS)=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var PS=jh(),PA=Dh(),IS="!",OA={returnIndex:!1},RA=t=>Array.isArray(t)?t:[t],NA=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=PS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},TS=(t,e,r,n)=>{let i=Array.isArray(r),o=i?r[0]:r;if(!i&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let s=PA(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(s))return n?-1:!1}let a=i&&[s].concat(r.slice(1));for(let c=0;c<t.length;c++){let u=t[c];if(i?u(...a):u(s))return n?c:!0}return n?-1:!1},Uh=(t,e,r=OA)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,i=n.returnIndex||!1,o=RA(t),s=o.filter(c=>typeof c=="string"&&c.charAt(0)===IS).map(c=>c.slice(1)).map(c=>PS(c,n)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==IS).map(c=>NA(c,n));return e==null?(c,u=!1)=>TS(a,s,c,typeof u=="boolean"?u:!1):TS(a,s,e,i)};Uh.default=Uh;RS.exports=Uh});var AS=b((SB,jS)=>{jS.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Zh=b((wB,DS)=>{var jA=AS(),CS={"{":"}","(":")","[":"]"},AA=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,i=-2,o=-2,s=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(s===-1||s>n||(s=t.indexOf("\\",e),s===-1||s>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(s=t.indexOf("\\",e),s===-1||s>i))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(s=t.indexOf("\\",e),s===-1||s>o))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(o=t.indexOf(")",r),o>r&&(s=t.indexOf("\\",r),s===-1||s>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=CS[a];if(c){var u=t.indexOf(c,e);u!==-1&&(e=u+1)}if(t[e]==="!")return!0}else e++}return!1},CA=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=CS[r];if(n){var i=t.indexOf(n,e);i!==-1&&(e=i+1)}if(t[e]==="!")return!0}else e++}return!1};DS.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(jA(e))return!0;var n=AA;return r&&r.strict===!1&&(n=CA),n(e)}});var ZS=b((kB,US)=>{"use strict";var DA=Zh(),UA=G("path").posix.dirname,ZA=G("os").platform()==="win32",Mh="/",MA=/\\/g,LA=/[\{\[].*[\}\]]$/,qA=/(^|[^\\])([\{\[]|\([^\)]+$)/,FA=/\\([\!\*\?\|\[\]\(\)\{\}])/g;US.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&ZA&&e.indexOf(Mh)<0&&(e=e.replace(MA,Mh)),LA.test(e)&&(e+=Mh),e+="a";do e=UA(e);while(DA(e)||qA.test(e));return e.replace(FA,"$1")}});var au=b(Ut=>{"use strict";Ut.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Ut.find=(t,e)=>t.nodes.find(r=>r.type===e);Ut.exceedsLimit=(t,e,r=1,n)=>n===!1||!Ut.isInteger(t)||!Ut.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;Ut.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Ut.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;Ut.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Ut.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Ut.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Ut.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let o=n[i];if(Array.isArray(o)){r(o);continue}o!==void 0&&e.push(o)}return e};return r(t),e}});var cu=b((zB,LS)=>{"use strict";var MS=au();LS.exports=(t,e={})=>{let r=(n,i={})=>{let o=e.escapeInvalid&&MS.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(o||s)&&MS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)}});var FS=b((IB,qS)=>{"use strict";qS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var XS=b((TB,YS)=>{"use strict";var VS=FS(),bn=(t,e,r)=>{if(VS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(VS(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),o=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+i+o+s+a;if(bn.cache.hasOwnProperty(c))return bn.cache[c].result;let u=Math.min(t,e),l=Math.max(t,e);if(Math.abs(u-l)===1){let h=t+"|"+e;return n.capture?`(${h})`:n.wrap===!1?h:`(?:${h})`}let d=KS(t)||KS(e),f={min:t,max:e,a:u,b:l},p=[],m=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),u<0){let h=l<0?Math.abs(l):1;m=HS(h,Math.abs(u),f,n),u=f.a=0}return l>=0&&(p=HS(u,l,f,n)),f.negatives=m,f.positives=p,f.result=VA(m,p,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&p.length+m.length>1&&(f.result=`(?:${f.result})`),bn.cache[c]=f,f.result};function VA(t,e,r){let n=Lh(t,e,"-",!1,r)||[],i=Lh(e,t,"",!1,r)||[],o=Lh(t,e,"-?",!0,r)||[];return n.concat(o).concat(i).join("|")}function HA(t,e){let r=1,n=1,i=WS(t,r),o=new Set([e]);for(;t<=i&&i<=e;)o.add(i),r+=1,i=WS(t,r);for(i=GS(e+1,n)-1;t<i&&i<=e;)o.add(i),n+=1,i=GS(e+1,n)-1;return o=[...o],o.sort(GA),o}function BA(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=WA(t,e),i=n.length,o="",s=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?o+=c:c!=="0"||u!=="9"?o+=JA(c,u,r):s++}return s&&(o+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function HS(t,e,r,n){let i=HA(t,e),o=[],s=t,a;for(let c=0;c<i.length;c++){let u=i[c],l=BA(String(s),String(u),n),d="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+JS(a.count),s=u+1;continue}r.isPadded&&(d=KA(u,r,n)),l.string=d+l.pattern+JS(l.count),o.push(l),s=u+1,a=l}return o}function Lh(t,e,r,n,i){let o=[];for(let s of t){let{string:a}=s;!n&&!BS(e,"string",a)&&o.push(r+a),n&&BS(e,"string",a)&&o.push(r+a)}return o}function WA(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function GA(t,e){return t>e?1:e>t?-1:0}function BS(t,e,r){return t.some(n=>n[e]===r)}function WS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function GS(t,e){return t-t%Math.pow(10,e)}function JS(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function JA(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function KS(t){return/^-?(0+)\d/.test(t)}function KA(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}bn.cache={};bn.clearCache=()=>bn.cache={};YS.exports=bn});var Vh=b((PB,ow)=>{"use strict";var YA=G("util"),ew=XS(),QS=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),XA=t=>e=>t===!0?Number(e):String(e),qh=t=>typeof t=="number"||typeof t=="string"&&t!=="",xs=t=>Number.isInteger(+t),Fh=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},QA=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,eC=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},lu=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},tC=(t,e,r)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",o="",s;return t.positives.length&&(i=t.positives.map(a=>lu(String(a),r)).join("|")),t.negatives.length&&(o=`-(${n}${t.negatives.map(a=>lu(String(a),r)).join("|")})`),i&&o?s=`${i}|${o}`:s=i||o,e.wrap?`(${n}${s})`:s},tw=(t,e,r,n)=>{if(r)return ew(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let o=String.fromCharCode(e);return`[${i}-${o}]`},rw=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return ew(t,e,r)},nw=(...t)=>new RangeError("Invalid range arguments: "+YA.inspect(...t)),iw=(t,e,r)=>{if(r.strictRanges===!0)throw nw([t,e]);return[]},rC=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},nC=(t,e,r=1,n={})=>{let i=Number(t),o=Number(e);if(!Number.isInteger(i)||!Number.isInteger(o)){if(n.strictRanges===!0)throw nw([t,e]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,a=String(t),c=String(e),u=String(r);r=Math.max(Math.abs(r),1);let l=Fh(a)||Fh(c)||Fh(u),d=l?Math.max(a.length,c.length,u.length):0,f=l===!1&&QA(t,e,n)===!1,p=n.transform||XA(f);if(n.toRegex&&r===1)return tw(lu(t,d),lu(e,d),!0,n);let m={negatives:[],positives:[]},h=O=>m[O<0?"negatives":"positives"].push(Math.abs(O)),v=[],S=0;for(;s?i>=o:i<=o;)n.toRegex===!0&&r>1?h(i):v.push(eC(p(i,S),d,f)),i=s?i-r:i+r,S++;return n.toRegex===!0?r>1?tC(m,n,d):rw(v,null,{wrap:!1,...n}):v},iC=(t,e,r=1,n={})=>{if(!xs(t)&&t.length>1||!xs(e)&&e.length>1)return iw(t,e,n);let i=n.transform||(f=>String.fromCharCode(f)),o=`${t}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,c=Math.min(o,s),u=Math.max(o,s);if(n.toRegex&&r===1)return tw(c,u,!1,n);let l=[],d=0;for(;a?o>=s:o<=s;)l.push(i(o,d)),o=a?o-r:o+r,d++;return n.toRegex===!0?rw(l,null,{wrap:!1,options:n}):l},uu=(t,e,r,n={})=>{if(e==null&&qh(t))return[t];if(!qh(t)||!qh(e))return iw(t,e,n);if(typeof r=="function")return uu(t,e,1,{transform:r});if(QS(r))return uu(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,xs(r)?xs(t)&&xs(e)?nC(t,e,r,i):iC(t,e,Math.max(Math.abs(r),1),i):r!=null&&!QS(r)?rC(r,i):uu(t,e,1,r)};ow.exports=uu});var cw=b((OB,aw)=>{"use strict";var oC=Vh(),sw=au(),sC=(t,e={})=>{let r=(n,i={})=>{let o=sw.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=sw.reduce(n.nodes),d=oC(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(t)};aw.exports=sC});var dw=b((RB,lw)=>{"use strict";var aC=Vh(),uw=cu(),xi=au(),xn=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?xi.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let o of i)n.push(xn(o,e,r));else for(let o of e)r===!0&&typeof o=="string"&&(o=`{${o}}`),n.push(Array.isArray(o)?xn(i,o,r):i+o);return xi.flatten(n)},cC=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,o={})=>{i.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(i.invalid||i.dollar){a.push(xn(a.pop(),uw(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(xn(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let d=xi.reduce(i.nodes);if(xi.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=aC(...d,e);f.length===0&&(f=uw(i,e)),a.push(xn(a.pop(),f)),i.nodes=[];return}let c=xi.encloseBrace(i),u=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let d=0;d<i.nodes.length;d++){let f=i.nodes[d];if(f.type==="comma"&&i.type==="brace"){d===1&&u.push(""),u.push("");continue}if(f.type==="close"){a.push(xn(a.pop(),u,c));continue}if(f.value&&f.type!=="open"){u.push(xn(u.pop(),f.value));continue}f.nodes&&n(f,i)}return u};return xi.flatten(n(t))};lw.exports=cC});var pw=b((NB,fw)=>{"use strict";fw.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
10
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var vw=b((jB,_w)=>{"use strict";var uC=cu(),{MAX_LENGTH:mw,CHAR_BACKSLASH:Hh,CHAR_BACKTICK:lC,CHAR_COMMA:dC,CHAR_DOT:fC,CHAR_LEFT_PARENTHESES:pC,CHAR_RIGHT_PARENTHESES:mC,CHAR_LEFT_CURLY_BRACE:hC,CHAR_RIGHT_CURLY_BRACE:gC,CHAR_LEFT_SQUARE_BRACKET:hw,CHAR_RIGHT_SQUARE_BRACKET:gw,CHAR_DOUBLE_QUOTE:_C,CHAR_SINGLE_QUOTE:vC,CHAR_NO_BREAK_SPACE:yC,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$C}=pw(),bC=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(mw,r.maxLength):mw;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},o=[i],s=i,a=i,c=0,u=t.length,l=0,d=0,f,p=()=>t[l++],m=h=>{if(h.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&h.type==="text"){a.value+=h.value;return}return s.nodes.push(h),h.parent=s,h.prev=a,a=h,h};for(m({type:"bos"});l<u;)if(s=o[o.length-1],f=p(),!(f===$C||f===yC)){if(f===Hh){m({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===gw){m({type:"text",value:"\\"+f});continue}if(f===hw){c++;let h;for(;l<u&&(h=p());){if(f+=h,h===hw){c++;continue}if(h===Hh){f+=p();continue}if(h===gw&&(c--,c===0))break}m({type:"text",value:f});continue}if(f===pC){s=m({type:"paren",nodes:[]}),o.push(s),m({type:"text",value:f});continue}if(f===mC){if(s.type!=="paren"){m({type:"text",value:f});continue}s=o.pop(),m({type:"text",value:f}),s=o[o.length-1];continue}if(f===_C||f===vC||f===lC){let h=f,v;for(e.keepQuotes!==!0&&(f="");l<u&&(v=p());){if(v===Hh){f+=v+p();continue}if(v===h){e.keepQuotes===!0&&(f+=v);break}f+=v}m({type:"text",value:f});continue}if(f===hC){d++;let v={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=m(v),o.push(s),m({type:"open",value:f});continue}if(f===gC){if(s.type!=="brace"){m({type:"text",value:f});continue}let h="close";s=o.pop(),s.close=!0,m({type:h,value:f}),d--,s=o[o.length-1];continue}if(f===dC&&d>0){if(s.ranges>0){s.ranges=0;let h=s.nodes.shift();s.nodes=[h,{type:"text",value:uC(s)}]}m({type:"comma",value:f}),s.commas++;continue}if(f===fC&&d>0&&s.commas===0){let h=s.nodes;if(d===0||h.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){h.pop();let v=h[h.length-1];v.value+=a.value+f,a=v,s.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let h=o[o.length-1],v=h.nodes.indexOf(s);h.nodes.splice(v,1,...s.nodes)}while(o.length>0);return m({type:"eos"}),i};_w.exports=bC});var bw=b((AB,$w)=>{"use strict";var yw=cu(),xC=cw(),SC=dw(),wC=vw(),zt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=zt.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(zt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};zt.parse=(t,e={})=>wC(t,e);zt.stringify=(t,e={})=>yw(typeof t=="string"?zt.parse(t,e):t,e);zt.compile=(t,e={})=>(typeof t=="string"&&(t=zt.parse(t,e)),xC(t,e));zt.expand=(t,e={})=>{typeof t=="string"&&(t=zt.parse(t,e));let r=SC(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};zt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?zt.compile(t,e):zt.expand(t,e);$w.exports=zt});var xw=b((CB,kC)=>{kC.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var ww=b((DB,Sw)=>{Sw.exports=xw()});var Ew=b((UB,kw)=>{"use strict";var EC=G("path"),zC=ww(),IC=new Set(zC);kw.exports=t=>IC.has(EC.extname(t).slice(1).toLowerCase())});var du=b(Z=>{"use strict";var{sep:TC}=G("path"),{platform:Bh}=process,PC=G("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${TC}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=t=>t;Z.isWindows=Bh==="win32";Z.isMacos=Bh==="darwin";Z.isLinux=Bh==="linux";Z.isIBMi=PC.type()==="OS400"});var Rw=b((MB,Ow)=>{"use strict";var zr=G("fs"),qe=G("path"),{promisify:Es}=G("util"),OC=Ew(),{isWindows:RC,isLinux:NC,EMPTY_FN:jC,EMPTY_STR:AC,KEY_LISTENERS:Si,KEY_ERR:Wh,KEY_RAW:Ss,HANDLER_KEYS:CC,EV_CHANGE:pu,EV_ADD:fu,EV_ADD_DIR:DC,EV_ERROR:Iw,STR_DATA:UC,STR_END:ZC,BRACE_START:MC,STAR:LC}=du(),qC="watch",FC=Es(zr.open),Tw=Es(zr.stat),VC=Es(zr.lstat),HC=Es(zr.close),Gh=Es(zr.realpath),BC={lstat:VC,stat:Tw},Kh=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},ws=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},WC=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},ks=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Pw=t=>t instanceof Set?t.size===0:!t,mu=new Map;function zw(t,e,r,n,i){let o=(s,a)=>{r(t),i(s,a,{watchedPath:t}),a&&t!==a&&hu(qe.resolve(t,a),Si,qe.join(t,a))};try{return zr.watch(t,e,o)}catch(s){n(s)}}var hu=(t,e,r,n,i)=>{let o=mu.get(t);o&&Kh(o[e],s=>{s(r,n,i)})},GC=(t,e,r,n)=>{let{listener:i,errHandler:o,rawEmitter:s}=n,a=mu.get(e),c;if(!r.persistent)return c=zw(t,r,i,o,s),c.close.bind(c);if(a)ws(a,Si,i),ws(a,Wh,o),ws(a,Ss,s);else{if(c=zw(t,r,hu.bind(null,e,Si),o,hu.bind(null,e,Ss)),!c)return;c.on(Iw,async u=>{let l=hu.bind(null,e,Wh);if(a.watcherUnusable=!0,RC&&u.code==="EPERM")try{let d=await FC(t,"r");await HC(d),l(u)}catch{}else l(u)}),a={listeners:i,errHandlers:o,rawEmitters:s,watcher:c},mu.set(e,a)}return()=>{ks(a,Si,i),ks(a,Wh,o),ks(a,Ss,s),Pw(a.listeners)&&(a.watcher.close(),mu.delete(e),CC.forEach(WC(a)),a.watcher=void 0,Object.freeze(a))}},Jh=new Map,JC=(t,e,r,n)=>{let{listener:i,rawEmitter:o}=n,s=Jh.get(e),a=new Set,c=new Set,u=s&&s.options;return u&&(u.persistent<r.persistent||u.interval>r.interval)&&(a=s.listeners,c=s.rawEmitters,zr.unwatchFile(e),s=void 0),s?(ws(s,Si,i),ws(s,Ss,o)):(s={listeners:i,rawEmitters:o,options:r,watcher:zr.watchFile(e,r,(l,d)=>{Kh(s.rawEmitters,p=>{p(pu,e,{curr:l,prev:d})});let f=l.mtimeMs;(l.size!==d.size||f>d.mtimeMs||f===0)&&Kh(s.listeners,p=>p(t,l))})},Jh.set(e,s)),()=>{ks(s,Si,i),ks(s,Ss,o),Pw(s.listeners)&&(Jh.delete(e),zr.unwatchFile(e),s.options=s.watcher=void 0,Object.freeze(s))}},Yh=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,i=qe.dirname(e),o=qe.basename(e);this.fsw._getWatchedDir(i).add(o);let a=qe.resolve(e),c={persistent:n.persistent};r||(r=jC);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&OC(o)?n.binaryInterval:n.interval,u=JC(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})):u=GC(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,r,n){if(this.fsw.closed)return;let i=qe.dirname(e),o=qe.basename(e),s=this.fsw._getWatchedDir(i),a=r;if(s.has(o))return;let c=async(l,d)=>{if(this.fsw._throttle(qC,e,5)){if(!d||d.mtimeMs===0)try{let f=await Tw(e);if(this.fsw.closed)return;let p=f.atimeMs,m=f.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(pu,e,f),NC&&a.ino!==f.ino?(this.fsw._closeFile(l),a=f,this.fsw._addPathCloser(l,this._watchWithNodeFs(e,c))):a=f}catch{this.fsw._remove(i,o)}else if(s.has(o)){let f=d.atimeMs,p=d.mtimeMs;(!f||f<=p||p!==a.mtimeMs)&&this.fsw._emit(pu,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(fu,e,0))return;this.fsw._emit(fu,e,r)}return u}async _handleSymlink(e,r,n,i){if(this.fsw.closed)return;let o=e.fullPath,s=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Gh(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(s.has(i)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(pu,n,e.stats)):(s.add(i),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(fu,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,r,n,i,o,s,a){if(e=qe.join(e,AC),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,l=this.fsw._readdirp(e,{fileFilter:d=>n.filterPath(d),directoryFilter:d=>n.filterDir(d),depth:0}).on(UC,async d=>{if(this.fsw.closed){l=void 0;return}let f=d.path,p=qe.join(e,f);if(u.add(f),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,p,f))){if(this.fsw.closed){l=void 0;return}(f===i||!i&&!c.has(f))&&(this.fsw._incrReadyCount(),p=qe.join(o,qe.relative(o,p)),this._addToNodeFs(p,r,n,s+1))}}).on(Iw,this._boundHandleError);return new Promise(d=>l.once(ZC,()=>{if(this.fsw.closed){l=void 0;return}let f=a?a.clear():!1;d(),c.getChildren().filter(p=>p!==e&&!u.has(p)&&(!n.hasGlob||n.filterPath({fullPath:qe.resolve(e,p)}))).forEach(p=>{this.fsw._remove(e,p)}),l=void 0,f&&this._handleRead(e,!1,n,i,o,s,a)}))}async _handleDir(e,r,n,i,o,s,a){let c=this.fsw._getWatchedDir(qe.dirname(e)),u=c.has(qe.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!s.hasGlob||s.globFilter(e))&&this.fsw._emit(DC,e,r),c.add(qe.basename(e)),this.fsw._getWatchedDir(e);let l,d,f=this.fsw.options.depth;if((f==null||i<=f)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,n,s,o,e,i,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(p,m)=>{m&&m.mtimeMs===0||this._handleRead(p,!1,s,o,e,i,l)})}return d}async _addToNodeFs(e,r,n,i,o){let s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await BC[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return s(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(LC)&&!e.includes(MC),l;if(c.isDirectory()){let d=qe.resolve(e),f=u?await Gh(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,i,o,a,f),this.fsw.closed))return;d!==f&&f!==void 0&&this.fsw._symlinkPaths.set(d,f)}else if(c.isSymbolicLink()){let d=u?await Gh(e):e;if(this.fsw.closed)return;let f=qe.dirname(a.watchPath);if(this.fsw._getWatchedDir(f).add(a.watchPath),this.fsw._emit(fu,a.watchPath,c),l=await this._handleDir(f,c,r,i,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(qe.resolve(e),d)}else l=this._handleFile(a.watchPath,c,r);return s(),this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return s(),e}}};Ow.exports=Yh});var Zw=b((LB,og)=>{"use strict";var ng=G("fs"),Fe=G("path"),{promisify:ig}=G("util"),wi;try{wi=G("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(wi){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(wi=void 0)}}var{EV_ADD:Xh,EV_CHANGE:KC,EV_ADD_DIR:Nw,EV_UNLINK:gu,EV_ERROR:YC,STR_DATA:XC,STR_END:QC,FSEVENT_CREATED:eD,FSEVENT_MODIFIED:tD,FSEVENT_DELETED:rD,FSEVENT_MOVED:nD,FSEVENT_UNKNOWN:iD,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:oD,FSEVENT_TYPE_FILE:sD,FSEVENT_TYPE_DIRECTORY:zs,FSEVENT_TYPE_SYMLINK:Uw,ROOT_GLOBSTAR:jw,DIR_SUFFIX:aD,DOT_SLASH:Aw,FUNCTION_TYPE:Qh,EMPTY_FN:cD,IDENTITY_FN:uD}=du(),lD=t=>isNaN(t)?{}:{depth:t},tg=ig(ng.stat),dD=ig(ng.lstat),Cw=ig(ng.realpath),fD={stat:tg,lstat:dD},Sn=new Map,pD=10,mD=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),hD=(t,e)=>({stop:wi.watch(t,e)});function gD(t,e,r,n){let i=Fe.extname(e)?Fe.dirname(e):e,o=Fe.dirname(i),s=Sn.get(i);_D(o)&&(i=o);let a=Fe.resolve(t),c=a!==e,u=(d,f,p)=>{c&&(d=d.replace(e,a)),(d===a||!d.indexOf(a+Fe.sep))&&r(d,f,p)},l=!1;for(let d of Sn.keys())if(e.indexOf(Fe.resolve(d)+Fe.sep)===0){i=d,s=Sn.get(i),l=!0;break}return s||l?s.listeners.add(u):(s={listeners:new Set([u]),rawEmitter:n,watcher:hD(i,(d,f)=>{if(!s.listeners.size||f&oD)return;let p=wi.getInfo(d,f);s.listeners.forEach(m=>{m(d,f,p)}),s.rawEmitter(p.event,d,p)})},Sn.set(i,s)),()=>{let d=s.listeners;if(d.delete(u),!d.size&&(Sn.delete(i),s.watcher))return s.watcher.stop().then(()=>{s.rawEmitter=s.watcher=void 0,Object.freeze(s)})}}var _D=t=>{let e=0;for(let r of Sn.keys())if(r.indexOf(t)===0&&(e++,e>=pD))return!0;return!1},vD=()=>wi&&Sn.size<128,eg=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=Fe.dirname(t))!==e;)r++;return r},Dw=(t,e)=>t.type===zs&&e.isDirectory()||t.type===Uw&&e.isSymbolicLink()||t.type===sD&&e.isFile(),rg=class{constructor(e){this.fsw=e}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+jw),!0;n.delete(e),n.delete(e+jw)}addOrChange(e,r,n,i,o,s,a,c){let u=o.has(s)?KC:Xh;this.handleEvent(u,e,r,n,i,o,s,a,c)}async checkExists(e,r,n,i,o,s,a,c){try{let u=await tg(e);if(this.fsw.closed)return;Dw(a,u)?this.addOrChange(e,r,n,i,o,s,a,c):this.handleEvent(gu,e,r,n,i,o,s,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,r,n,i,o,s,a,c):this.handleEvent(gu,e,r,n,i,o,s,a,c)}}handleEvent(e,r,n,i,o,s,a,c,u){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===gu){let l=c.type===zs;(l||s.has(a))&&this.fsw._remove(o,a,l)}else{if(e===Xh){if(c.type===zs&&this.fsw._getWatchedDir(r),c.type===Uw&&u.followSymlinks){let d=u.depth===void 0?void 0:eg(n,i)+1;return this._addToFsEvents(r,!1,!0,d)}this.fsw._getWatchedDir(o).add(a)}let l=c.type===zs?e+aD:e;this.fsw._emit(l,r),l===Nw&&this._addToFsEvents(r,!1,!0)}}_watchWithFsEvents(e,r,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=gD(e,r,async(c,u,l)=>{if(this.fsw.closed||o.depth!==void 0&&eg(c,r)>o.depth)return;let d=n(Fe.join(e,Fe.relative(e,c)));if(i&&!i(d))return;let f=Fe.dirname(d),p=Fe.basename(d),m=this.fsw._getWatchedDir(l.type===zs?d:f);if(mD.has(u)||l.event===iD)if(typeof o.ignored===Qh){let h;try{h=await tg(d)}catch{}if(this.fsw.closed||this.checkIgnored(d,h))return;Dw(l,h)?this.addOrChange(d,c,r,f,m,p,l,o):this.handleEvent(gu,d,c,r,f,m,p,l,o)}else this.checkExists(d,c,r,f,m,p,l,o);else switch(l.event){case eD:case tD:return this.addOrChange(d,c,r,f,m,p,l,o);case rD:case nD:return this.checkExists(d,c,r,f,m,p,l,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,r,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let o=await Cw(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,s=>{let a=e;return o&&o!==Aw?a=s.replace(o,e):s!==Aw&&(a=Fe.join(e,s)),n(a)},!1,i)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,r,n,i,o){let s=n(e),a=r.isDirectory(),c=this.fsw._getWatchedDir(Fe.dirname(s)),u=Fe.basename(s);a&&this.fsw._getWatchedDir(s),!c.has(u)&&(c.add(u),(!i.ignoreInitial||o===!0)&&this.fsw._emit(a?Nw:Xh,s,r))}initWatch(e,r,n,i){if(this.fsw.closed)return;let o=this._watchWithFsEvents(n.watchPath,Fe.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(r,o)}async _addToFsEvents(e,r,n,i){if(this.fsw.closed)return;let o=this.fsw.options,s=typeof r===Qh?r:uD,a=this.fsw._getWatchHelpers(e);try{let c=await fD[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(s(e),c,s,o,n),i&&i>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...lD(o.depth-(i||0))}).on(XC,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let l=Fe.join(a.watchPath,u.path),{fullPath:d}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let f=o.depth===void 0?void 0:eg(l,Fe.resolve(a.watchPath))+1;this._handleFsEventsSymlink(l,d,s,f)}else this.emitAdd(l,u.stats,s,o,n)}).on(YC,cD).on(QC,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,s,o,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&n!==!0)if(typeof r===Qh)this.initWatch(void 0,e,a,s);else{let c;try{c=await Cw(a.watchPath)}catch{}this.initWatch(c,e,a,s)}}};og.exports=rg;og.exports.canUse=vD});var Kw=b($g=>{"use strict";var{EventEmitter:yD}=G("events"),vg=G("fs"),_e=G("path"),{promisify:Bw}=G("util"),$D=ES(),dg=NS().default,bD=ZS(),sg=Zh(),xD=bw(),SD=Dh(),wD=Rw(),Mw=Zw(),{EV_ALL:ag,EV_READY:kD,EV_ADD:_u,EV_CHANGE:Is,EV_UNLINK:Lw,EV_ADD_DIR:ED,EV_UNLINK_DIR:zD,EV_RAW:ID,EV_ERROR:cg,STR_CLOSE:TD,STR_END:PD,BACK_SLASH_RE:OD,DOUBLE_SLASH_RE:qw,SLASH_OR_BACK_SLASH_RE:RD,DOT_RE:ND,REPLACER_RE:jD,SLASH:ug,SLASH_SLASH:AD,BRACE_START:CD,BANG:fg,ONE_DOT:Ww,TWO_DOTS:DD,GLOBSTAR:UD,SLASH_GLOBSTAR:lg,ANYMATCH_OPTS:pg,STRING_TYPE:yg,FUNCTION_TYPE:ZD,EMPTY_STR:mg,EMPTY_FN:MD,isWindows:LD,isMacos:qD,isIBMi:FD}=du(),VD=Bw(vg.stat),HD=Bw(vg.readdir),hg=(t=[])=>Array.isArray(t)?t:[t],Gw=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?Gw(r,e):e.push(r)}),e),Fw=t=>{let e=Gw(hg(t));if(!e.every(r=>typeof r===yg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Jw)},Vw=t=>{let e=t.replace(OD,ug),r=!1;for(e.startsWith(AD)&&(r=!0);e.match(qw);)e=e.replace(qw,ug);return r&&(e=ug+e),e},Jw=t=>Vw(_e.normalize(Vw(t))),Hw=(t=mg)=>e=>typeof e!==yg?e:Jw(_e.isAbsolute(e)?e:_e.join(t,e)),BD=(t,e)=>_e.isAbsolute(t)?t:t.startsWith(fg)?fg+_e.join(e,t.slice(1)):_e.join(e,t),Jt=(t,e)=>t[e]===void 0,gg=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==Ww&&e!==DD&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await HD(n)}catch{this._removeWatcher&&this._removeWatcher(_e.dirname(n),_e.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},WD="stat",GD="lstat",_g=class{constructor(e,r,n,i){this.fsw=i,this.path=e=e.replace(jD,mg),this.watchPath=r,this.fullWatchPath=_e.resolve(r),this.hasGlob=r!==e,e===mg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?dg(e,void 0,pg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=n,this.statMethod=n?WD:GD}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return _e.join(this.watchPath,_e.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===ZD?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return[];let r=[];return(e.includes(CD)?xD.expand(e):[e]).forEach(i=>{r.push(_e.relative(this.watchPath,i).split(RD))}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((o,s)=>(o===UD&&(n=!0),n||!r[0][s]||dg(o,r[0][s],pg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},vu=class extends yD{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Jt(r,"persistent")&&(r.persistent=!0),Jt(r,"ignoreInitial")&&(r.ignoreInitial=!1),Jt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),Jt(r,"interval")&&(r.interval=100),Jt(r,"binaryInterval")&&(r.binaryInterval=300),Jt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,Jt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Mw.canUse()||(r.useFsEvents=!1),Jt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=qD),FD&&(r.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(r.interval=Number.parseInt(o,10)),Jt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),Jt(r,"followSymlinks")&&(r.followSymlinks=!0),Jt(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let s=r.awaitWriteFinish;s&&(s.stabilityThreshold||(s.stabilityThreshold=2e3),s.pollInterval||(s.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=hg(r.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=MD,this._readyEmitted=!0,process.nextTick(()=>this.emit(kD)))},this._emitRaw=(...c)=>this.emit(ID,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Mw(this):this._nodeFsHandler=new wD(this),Object.freeze(r)}add(e,r,n){let{cwd:i,disableGlobbing:o}=this.options;this.closed=!1;let s=Fw(e);return i&&(s=s.map(a=>{let c=BD(a,i);return o||!sg(a)?c:SD(c)})),s=s.filter(a=>a.startsWith(fg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+lg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=s.length),this.options.persistent&&(this._readyCount+=s.length),s.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,r);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(_e.dirname(c),_e.basename(r||c))})})),this}unwatch(e){if(this.closed)return this;let r=Fw(e),{cwd:n}=this.options;return r.forEach(i=>{!_e.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=_e.join(n,i)),i=_e.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+lg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let i=this.options.cwd?_e.relative(this.options.cwd,n):n;e[i||Ww]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(...r),e!==cg&&this.emit(ag,...r)}async _emit(e,r,n,i,o){if(this.closed)return;let s=this.options;LD&&(r=_e.normalize(r)),s.cwd&&(r=_e.relative(s.cwd,r));let a=[e,r];o!==void 0?a.push(n,i,o):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=s.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(r)))return u.lastChange=new Date,this;if(s.atomic){if(e===Lw)return this._pendingUnlinks.set(r,a),setTimeout(()=>{this._pendingUnlinks.forEach((l,d)=>{this.emit(...l),this.emit(ag,...l),this._pendingUnlinks.delete(d)})},typeof s.atomic=="number"?s.atomic:100),this;e===_u&&this._pendingUnlinks.has(r)&&(e=a[0]=Is,this._pendingUnlinks.delete(r))}if(c&&(e===_u||e===Is)&&this._readyEmitted){let l=(d,f)=>{d?(e=a[0]=cg,a[1]=d,this.emitWithAll(e,a)):f&&(a.length>2?a[2]=f:a.push(f),this.emitWithAll(e,a))};return this._awaitWriteFinish(r,c.stabilityThreshold,e,l),this}if(e===Is&&!this._throttle(Is,r,50))return this;if(s.alwaysStat&&n===void 0&&(e===_u||e===ED||e===Is)){let l=s.cwd?_e.join(s.cwd,r):r,d;try{d=await VD(l)}catch{}if(!d||this.closed)return;a.push(d)}return this.emitWithAll(e,a),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(cg,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),o=i.get(r);if(o)return o.count++,!1;let s,a=()=>{let u=i.get(r),l=u?u.count:0;return i.delete(r),clearTimeout(s),u&&clearTimeout(u.timeoutObject),l};s=setTimeout(a,n);let c={timeoutObject:s,clear:a,count:0};return i.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,i){let o,s=e;this.options.cwd&&!_e.isAbsolute(e)&&(s=_e.join(this.options.cwd,e));let a=new Date,c=u=>{vg.stat(s,(l,d)=>{if(l||!this._pendingWrites.has(e)){l&&l.code!=="ENOENT"&&i(l);return}let f=Number(new Date);u&&d.size!==u.size&&(this._pendingWrites.get(e).lastChange=f);let p=this._pendingWrites.get(e);f-p.lastChange>=r?(this._pendingWrites.delete(e),i(void 0,d)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),n)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&ND.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,o=i&&i.map(Hw(n)),s=hg(o).filter(c=>typeof c===yg&&!sg(c)).map(c=>c+lg),a=this._getGlobIgnored().map(Hw(n)).concat(o,s);this._userIgnored=dg(a,void 0,pg)}return this._userIgnored([e,r])}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!sg(e)?e:bD(e),i=this.options.followSymlinks;return new _g(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=_e.resolve(e);return this._watched.has(r)||this._watched.set(r,new gg(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let i=_e.join(e,r),o=_e.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(o)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(i).getChildren().forEach(f=>this._remove(i,f));let c=this._getWatchedDir(e),u=c.has(r);c.remove(r),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let l=i;if(this.options.cwd&&(l=_e.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===_u)return;this._watched.delete(i),this._watched.delete(o);let d=n?zD:Lw;u&&!this._isIgnored(i)&&this._emit(d,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let r=_e.dirname(e);this._getWatchedDir(r).remove(_e.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:ag,alwaysStat:!0,lstat:!0,...r},i=$D(e,n);return this._streams.add(i),i.once(TD,()=>{i=void 0}),i.once(PD,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};$g.FSWatcher=vu;var JD=(t,e)=>{let r=new vu(e);return r.add(t),r};$g.watch=JD});var Ir=b((VB,tk)=>{"use strict";var Qw=["nodebuffer","arraybuffer","fragments"],ek=typeof Blob<"u";ek&&Qw.push("blob");tk.exports={BINARY_TYPES:Qw,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ek,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Ps=b((HB,$u)=>{"use strict";var{EMPTY_BUFFER:KD}=Ir(),bg=Buffer[Symbol.species];function YD(t,e){if(t.length===0)return KD;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),n=0;for(let i=0;i<t.length;i++){let o=t[i];r.set(o,n),n+=o.length}return n<e?new bg(r.buffer,r.byteOffset,n):r}function rk(t,e,r,n,i){for(let o=0;o<i;o++)r[n+o]=t[o]^e[o&3]}function nk(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function XD(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function xg(t){if(xg.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new bg(t):ArrayBuffer.isView(t)?e=new bg(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),xg.readOnly=!1),e}$u.exports={concat:YD,mask:rk,toArrayBuffer:XD,toBuffer:xg,unmask:nk};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=G("bufferutil");$u.exports.mask=function(e,r,n,i,o){o<48?rk(e,r,n,i,o):t.mask(e,r,n,i,o)},$u.exports.unmask=function(e,r){e.length<32?nk(e,r):t.unmask(e,r)}}catch{}});var sk=b((BB,ok)=>{"use strict";var ik=Symbol("kDone"),Sg=Symbol("kRun"),wg=class{constructor(e){this[ik]=()=>{this.pending--,this[Sg]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Sg]()}[Sg](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[ik])}}};ok.exports=wg});var Rs=b((WB,lk)=>{"use strict";var Os=G("zlib"),ak=Ps(),QD=sk(),{kStatusCode:ck}=Ir(),e4=Buffer[Symbol.species],t4=Buffer.from([0,0,255,255]),xu=Symbol("permessage-deflate"),Tr=Symbol("total-length"),ki=Symbol("callback"),Xr=Symbol("buffers"),Ei=Symbol("error"),bu,kg=class{constructor(e,r,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!bu){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;bu=new QD(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[ki];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,n=e.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),e}decompress(e,r,n){bu.add(i=>{this._decompress(e,r,(o,s)=>{i(),n(o,s)})})}compress(e,r,n){bu.add(i=>{this._compress(e,r,(o,s)=>{i(),n(o,s)})})}_decompress(e,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Os.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Os.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[xu]=this,this._inflate[Tr]=0,this._inflate[Xr]=[],this._inflate.on("error",n4),this._inflate.on("data",uk)}this._inflate[ki]=n,this._inflate.write(e),r&&this._inflate.write(t4),this._inflate.flush(()=>{let o=this._inflate[Ei];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=ak.concat(this._inflate[Xr],this._inflate[Tr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Tr]=0,this._inflate[Xr]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(e,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Os.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Os.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Tr]=0,this._deflate[Xr]=[],this._deflate.on("data",r4)}this._deflate[ki]=n,this._deflate.write(e),this._deflate.flush(Os.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=ak.concat(this._deflate[Xr],this._deflate[Tr]);r&&(o=new e4(o.buffer,o.byteOffset,o.length-4)),this._deflate[ki]=null,this._deflate[Tr]=0,this._deflate[Xr]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};lk.exports=kg;function r4(t){this[Xr].push(t),this[Tr]+=t.length}function uk(t){if(this[Tr]+=t.length,this[xu]._maxPayload<1||this[Tr]<=this[xu]._maxPayload){this[Xr].push(t);return}this[Ei]=new RangeError("Max payload size exceeded"),this[Ei].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ei][ck]=1009,this.removeListener("data",uk),this.reset()}function n4(t){if(this[xu]._inflate=null,this[Ei]){this[ki](this[Ei]);return}t[ck]=1007,this[ki](t)}});var zi=b((GB,Su)=>{"use strict";var{isUtf8:dk}=G("buffer"),{hasBlob:i4}=Ir(),o4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function s4(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Eg(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function a4(t){return i4&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Su.exports={isBlob:a4,isValidStatusCode:s4,isValidUTF8:Eg,tokenChars:o4};if(dk)Su.exports.isValidUTF8=function(t){return t.length<24?Eg(t):dk(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=G("utf-8-validate");Su.exports.isValidUTF8=function(e){return e.length<32?Eg(e):t(e)}}catch{}});var Og=b((JB,vk)=>{"use strict";var{Writable:c4}=G("stream"),fk=Rs(),{BINARY_TYPES:u4,EMPTY_BUFFER:pk,kStatusCode:l4,kWebSocket:d4}=Ir(),{concat:zg,toArrayBuffer:f4,unmask:p4}=Ps(),{isValidStatusCode:m4,isValidUTF8:mk}=zi(),wu=Buffer[Symbol.species],Zt=0,hk=1,gk=2,_k=3,Ig=4,Tg=5,ku=6,Pg=class extends c4{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||u4[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[d4]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Zt}_write(e,r,n){if(this._opcode===8&&this._state==Zt)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new wu(n.buffer,n.byteOffset+e,n.length-e),new wu(n.buffer,n.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=r.length-e;e>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new wu(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case Zt:this.getInfo(e);break;case hk:this.getPayloadLength16(e);break;case gk:this.getPayloadLength64(e);break;case _k:this.getMask();break;case Ig:this.getData(e);break;case Tg:case ku:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[fk.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=hk:this._payloadLength===127?this._state=gk:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=_k:this._state=Ig}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ig}getData(e){let r=pk;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&p4(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=Tg,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[fk.extensionName].decompress(e,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Zt&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=Zt;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=zg(n,r):this._binaryType==="arraybuffer"?i=f4(zg(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Zt):(this._state=ku,setImmediate(()=>{this.emit("message",i,!0),this._state=Zt,this.startLoop(e)}))}else{let i=zg(n,r);if(!this._skipUTF8Validation&&!mk(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===Tg||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Zt):(this._state=ku,setImmediate(()=>{this.emit("message",i,!1),this._state=Zt,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,pk),this.end();else{let n=e.readUInt16BE(0);if(!m4(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new wu(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!mk(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Zt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Zt):(this._state=ku,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Zt,this.startLoop(r)}))}createError(e,r,n,i,o){this._loop=!1,this._errored=!0;let s=new e(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[l4]=i,s}};vk.exports=Pg});var jg=b((YB,bk)=>{"use strict";var{Duplex:KB}=G("stream"),{randomFillSync:h4}=G("crypto"),yk=Rs(),{EMPTY_BUFFER:g4,kWebSocket:_4,NOOP:v4}=Ir(),{isBlob:Ii,isValidStatusCode:y4}=zi(),{mask:$k,toBuffer:wn}=Ps(),Mt=Symbol("kByteLength"),$4=Buffer.alloc(4),Eu=8*1024,kn,Ti=Eu,Kt=0,b4=1,x4=2,Rg=class t{constructor(e,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Kt,this.onerror=v4,this[_4]=void 0}static frame(e,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||$4,r.generateMask?r.generateMask(n):(Ti===Eu&&(kn===void 0&&(kn=Buffer.alloc(Eu)),h4(kn,0,Eu),Ti=0),n[0]=kn[Ti++],n[1]=kn[Ti++],n[2]=kn[Ti++],n[3]=kn[Ti++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof e=="string"?(!r.mask||s)&&r[Mt]!==void 0?a=r[Mt]:(e=Buffer.from(e),a=e.length):(a=e.length,i=r.mask&&r.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(i?a+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[o-4]=n[0],u[o-3]=n[1],u[o-2]=n[2],u[o-1]=n[3],s?[u,e]:i?($k(e,n,u,o,a),[u]):($k(e,n,e,0,a),[u,e])):[u,e]}close(e,r,n,i){let o;if(e===void 0)o=g4;else{if(typeof e!="number"||!y4(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(e,0),typeof r=="string"?o.write(r,2):o.set(r,2)}}let s={[Mt]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Kt?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(t.frame(o,s),i)}ping(e,r,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):Ii(e)?(i=e.size,o=!1):(e=wn(e),i=e.length,o=wn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Mt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Ii(e)?this._state!==Kt?this.enqueue([this.getBlobData,e,!1,s,n]):this.getBlobData(e,!1,s,n):this._state!==Kt?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(t.frame(e,s),n)}pong(e,r,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):Ii(e)?(i=e.size,o=!1):(e=wn(e),i=e.length,o=wn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Mt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Ii(e)?this._state!==Kt?this.enqueue([this.getBlobData,e,!1,s,n]):this.getBlobData(e,!1,s,n):this._state!==Kt?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(t.frame(e,s),n)}send(e,r,n){let i=this._extensions[yk.extensionName],o=r.binary?2:1,s=r.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Ii(e)?(a=e.size,c=!1):(e=wn(e),a=e.length,c=wn.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[Mt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Ii(e)?this._state!==Kt?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Kt?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,r,n,i){this._bufferedBytes+=n[Mt],this._state=x4,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Ng,this,a,i);return}this._bufferedBytes-=n[Mt];let s=wn(o);r?this.dispatch(s,r,n,i):(this._state=Kt,this.sendFrame(t.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(S4,this,o,i)})}dispatch(e,r,n,i){if(!r){this.sendFrame(t.frame(e,n),i);return}let o=this._extensions[yk.extensionName];this._bufferedBytes+=n[Mt],this._state=b4,o.compress(e,n.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ng(this,c,i);return}this._bufferedBytes-=n[Mt],this._state=Kt,n.readOnly=!1,this.sendFrame(t.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Kt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Mt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Mt],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};bk.exports=Rg;function Ng(t,e,r){typeof r=="function"&&r(e);for(let n=0;n<t._queue.length;n++){let i=t._queue[n],o=i[i.length-1];typeof o=="function"&&o(e)}}function S4(t,e,r){Ng(t,e,r),t.onerror(e)}});var Pk=b((XB,Tk)=>{"use strict";var{kForOnEventAttribute:Ns,kListener:Ag}=Ir(),xk=Symbol("kCode"),Sk=Symbol("kData"),wk=Symbol("kError"),kk=Symbol("kMessage"),Ek=Symbol("kReason"),Pi=Symbol("kTarget"),zk=Symbol("kType"),Ik=Symbol("kWasClean"),Pr=class{constructor(e){this[Pi]=null,this[zk]=e}get target(){return this[Pi]}get type(){return this[zk]}};Object.defineProperty(Pr.prototype,"target",{enumerable:!0});Object.defineProperty(Pr.prototype,"type",{enumerable:!0});var En=class extends Pr{constructor(e,r={}){super(e),this[xk]=r.code===void 0?0:r.code,this[Ek]=r.reason===void 0?"":r.reason,this[Ik]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[xk]}get reason(){return this[Ek]}get wasClean(){return this[Ik]}};Object.defineProperty(En.prototype,"code",{enumerable:!0});Object.defineProperty(En.prototype,"reason",{enumerable:!0});Object.defineProperty(En.prototype,"wasClean",{enumerable:!0});var Oi=class extends Pr{constructor(e,r={}){super(e),this[wk]=r.error===void 0?null:r.error,this[kk]=r.message===void 0?"":r.message}get error(){return this[wk]}get message(){return this[kk]}};Object.defineProperty(Oi.prototype,"error",{enumerable:!0});Object.defineProperty(Oi.prototype,"message",{enumerable:!0});var js=class extends Pr{constructor(e,r={}){super(e),this[Sk]=r.data===void 0?null:r.data}get data(){return this[Sk]}};Object.defineProperty(js.prototype,"data",{enumerable:!0});var w4={addEventListener(t,e,r={}){for(let i of this.listeners(t))if(!r[Ns]&&i[Ag]===e&&!i[Ns])return;let n;if(t==="message")n=function(o,s){let a=new js("message",{data:s?o:o.toString()});a[Pi]=this,zu(e,this,a)};else if(t==="close")n=function(o,s){let a=new En("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Pi]=this,zu(e,this,a)};else if(t==="error")n=function(o){let s=new Oi("error",{error:o,message:o.message});s[Pi]=this,zu(e,this,s)};else if(t==="open")n=function(){let o=new Pr("open");o[Pi]=this,zu(e,this,o)};else return;n[Ns]=!!r[Ns],n[Ag]=e,r.once?this.once(t,n):this.on(t,n)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[Ag]===e&&!r[Ns]){this.removeListener(t,r);break}}};Tk.exports={CloseEvent:En,ErrorEvent:Oi,Event:Pr,EventTarget:w4,MessageEvent:js};function zu(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var Cg=b((QB,Ok)=>{"use strict";var{tokenChars:As}=zi();function lr(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function k4(t){let e=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,c=-1,u=-1,l=-1,d=0;for(;d<t.length;d++)if(u=t.charCodeAt(d),s===void 0)if(l===-1&&As[u]===1)c===-1&&(c=d);else if(d!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let p=t.slice(c,l);u===44?(lr(e,p,r),r=Object.create(null)):s=p,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&As[u]===1)c===-1&&(c=d);else if(u===32||u===9)l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),lr(r,t.slice(c,l),!0),u===44&&(lr(e,s,r),r=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=t.slice(c,d),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(As[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:n||(n=!0),i=!1}else if(o)if(As[u]===1)c===-1&&(c=d);else if(u===34&&c!==-1)o=!1,l=d;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(u===34&&t.charCodeAt(d-1)===61)o=!0;else if(l===-1&&As[u]===1)c===-1&&(c=d);else if(c!==-1&&(u===32||u===9))l===-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let p=t.slice(c,l);n&&(p=p.replace(/\\/g,""),n=!1),lr(r,a,p),u===44&&(lr(e,s,r),r=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=t.slice(c,l);return s===void 0?lr(e,f,r):(a===void 0?lr(r,f,!0):n?lr(r,a,f.replace(/\\/g,"")):lr(r,a,f),lr(e,s,r)),e}function E4(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(n=>[e].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Ok.exports={format:E4,parse:k4}});var Ou=b((rW,Fk)=>{"use strict";var z4=G("events"),I4=G("https"),T4=G("http"),jk=G("net"),P4=G("tls"),{randomBytes:O4,createHash:R4}=G("crypto"),{Duplex:eW,Readable:tW}=G("stream"),{URL:Dg}=G("url"),Qr=Rs(),N4=Og(),j4=jg(),{isBlob:A4}=zi(),{BINARY_TYPES:Rk,CLOSE_TIMEOUT:C4,EMPTY_BUFFER:Iu,GUID:D4,kForOnEventAttribute:Ug,kListener:U4,kStatusCode:Z4,kWebSocket:Ve,NOOP:Ak}=Ir(),{EventTarget:{addEventListener:M4,removeEventListener:L4}}=Pk(),{format:q4,parse:F4}=Cg(),{toBuffer:V4}=Ps(),Ck=Symbol("kAborted"),Zg=[8,13],Or=["CONNECTING","OPEN","CLOSING","CLOSED"],H4=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,je=class t extends z4{constructor(e,r,n){super(),this._binaryType=Rk[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Iu,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),Dk(this,e,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Rk.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,r,n){let i=new N4({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new j4(e,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=e,i[Ve]=this,o[Ve]=this,e[Ve]=this,i.on("conclude",G4),i.on("drain",J4),i.on("error",K4),i.on("message",Y4),i.on("ping",X4),i.on("pong",Q4),o.onerror=eU,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",Mk),e.on("data",Pu),e.on("end",Lk),e.on("error",qk),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Qr.extensionName]&&this._extensions[Qr.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){It(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Zk(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,n){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Mg(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||Iu,r,n)}pong(e,r,n){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Mg(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||Iu,r,n)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,n){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Mg(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Qr.extensionName]||(i.compress=!1),this._sender.send(e||Iu,i,n)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){It(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(je,"CONNECTING",{enumerable:!0,value:Or.indexOf("CONNECTING")});Object.defineProperty(je.prototype,"CONNECTING",{enumerable:!0,value:Or.indexOf("CONNECTING")});Object.defineProperty(je,"OPEN",{enumerable:!0,value:Or.indexOf("OPEN")});Object.defineProperty(je.prototype,"OPEN",{enumerable:!0,value:Or.indexOf("OPEN")});Object.defineProperty(je,"CLOSING",{enumerable:!0,value:Or.indexOf("CLOSING")});Object.defineProperty(je.prototype,"CLOSING",{enumerable:!0,value:Or.indexOf("CLOSING")});Object.defineProperty(je,"CLOSED",{enumerable:!0,value:Or.indexOf("CLOSED")});Object.defineProperty(je.prototype,"CLOSED",{enumerable:!0,value:Or.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(je.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(je.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Ug])return e[U4];return null},set(e){for(let r of this.listeners(t))if(r[Ug]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[Ug]:!0})}})});je.prototype.addEventListener=M4;je.prototype.removeEventListener=L4;Fk.exports=je;function Dk(t,e,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:C4,protocolVersion:Zg[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=i.autoPong,t._closeTimeout=i.closeTimeout,!Zg.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Zg.join(", ")})`);let o;if(e instanceof Dg)o=e;else try{o=new Dg(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),t._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let h=new SyntaxError(c);if(t._redirects===0)throw h;Tu(t,h);return}let u=s?443:80,l=O4(16).toString("base64"),d=s?I4.request:T4.request,f=new Set,p;if(i.createConnection=i.createConnection||(s?W4:B4),i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(p=new Qr(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=q4({[Qr.extensionName]:p.offer()})),r.length){for(let h of r){if(typeof h!="string"||!H4.test(h)||f.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(h)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}let m;if(i.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?i.socketPath:o.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[v,S]of Object.entries(h))n.headers[v.toLowerCase()]=S}else if(t.listenerCount("redirect")===0){let h=a?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!h||t._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=t._req=d(i),t._redirects&&t.emit("redirect",t.url,m)}else m=t._req=d(i);i.timeout&&m.on("timeout",()=>{It(t,m,"Opening handshake has timed out")}),m.on("error",h=>{m===null||m[Ck]||(m=t._req=null,Tu(t,h))}),m.on("response",h=>{let v=h.headers.location,S=h.statusCode;if(v&&i.followRedirects&&S>=300&&S<400){if(++t._redirects>i.maxRedirects){It(t,m,"Maximum redirects exceeded");return}m.abort();let O;try{O=new Dg(v,e)}catch{let A=new SyntaxError(`Invalid URL: ${v}`);Tu(t,A);return}Dk(t,O,r,n)}else t.emit("unexpected-response",m,h)||It(t,m,`Unexpected server response: ${h.statusCode}`)}),m.on("upgrade",(h,v,S)=>{if(t.emit("upgrade",h),t.readyState!==je.CONNECTING)return;m=t._req=null;let O=h.headers.upgrade;if(O===void 0||O.toLowerCase()!=="websocket"){It(t,v,"Invalid Upgrade header");return}let E=R4("sha1").update(l+D4).digest("base64");if(h.headers["sec-websocket-accept"]!==E){It(t,v,"Invalid Sec-WebSocket-Accept header");return}let A=h.headers["sec-websocket-protocol"],z;if(A!==void 0?f.size?f.has(A)||(z="Server sent an invalid subprotocol"):z="Server sent a subprotocol but none was requested":f.size&&(z="Server sent no subprotocol"),z){It(t,v,z);return}A&&(t._protocol=A);let Ae=h.headers["sec-websocket-extensions"];if(Ae!==void 0){if(!p){It(t,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let he;try{he=F4(Ae)}catch{It(t,v,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(he);if(M.length!==1||M[0]!==Qr.extensionName){It(t,v,"Server indicated an extension that was not requested");return}try{p.accept(he[Qr.extensionName])}catch{It(t,v,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Qr.extensionName]=p}t.setSocket(v,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,t):m.end()}function Tu(t,e){t._readyState=je.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function B4(t){return t.path=t.socketPath,jk.connect(t)}function W4(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=jk.isIP(t.host)?"":t.host),P4.connect(t)}function It(t,e,r){t._readyState=je.CLOSING;let n=new Error(r);Error.captureStackTrace(n,It),e.setHeader?(e[Ck]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Tu,t,n)):(e.destroy(n),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Mg(t,e,r){if(e){let n=A4(e)?e.size:V4(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${t.readyState} (${Or[t.readyState]})`);process.nextTick(r,n)}}function G4(t,e){let r=this[Ve];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[Ve]!==void 0&&(r._socket.removeListener("data",Pu),process.nextTick(Uk,r._socket),t===1005?r.close():r.close(t,e))}function J4(){let t=this[Ve];t.isPaused||t._socket.resume()}function K4(t){let e=this[Ve];e._socket[Ve]!==void 0&&(e._socket.removeListener("data",Pu),process.nextTick(Uk,e._socket),e.close(t[Z4])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Nk(){this[Ve].emitClose()}function Y4(t,e){this[Ve].emit("message",t,e)}function X4(t){let e=this[Ve];e._autoPong&&e.pong(t,!this._isServer,Ak),e.emit("ping",t)}function Q4(t){this[Ve].emit("pong",t)}function Uk(t){t.resume()}function eU(t){let e=this[Ve];e.readyState!==je.CLOSED&&(e.readyState===je.OPEN&&(e._readyState=je.CLOSING,Zk(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Zk(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Mk(){let t=this[Ve];if(this.removeListener("close",Mk),this.removeListener("data",Pu),this.removeListener("end",Lk),t._readyState=je.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[Ve]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Nk),t._receiver.on("finish",Nk))}function Pu(t){this[Ve]._receiver.write(t)||this.pause()}function Lk(){let t=this[Ve];t._readyState=je.CLOSING,t._receiver.end(),this.end()}function qk(){let t=this[Ve];this.removeListener("error",qk),this.on("error",Ak),t&&(t._readyState=je.CLOSING,this.destroy())}});var Wk=b((iW,Bk)=>{"use strict";var nW=Ou(),{Duplex:tU}=G("stream");function Vk(t){t.emit("close")}function rU(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Hk(t){this.removeListener("error",Hk),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function nU(t,e){let r=!0,n=new tU({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||t.pause()}),t.once("error",function(o){n.destroyed||(r=!1,n.destroy(o))}),t.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(t.readyState===t.CLOSED){o(i),process.nextTick(Vk,n);return}let s=!1;t.once("error",function(c){s=!0,o(c)}),t.once("close",function(){s||o(i),process.nextTick(Vk,n)}),r&&t.terminate()},n._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){n._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},n._read=function(){t.isPaused&&t.resume()},n._write=function(i,o,s){if(t.readyState===t.CONNECTING){t.once("open",function(){n._write(i,o,s)});return}t.send(i,s)},n.on("end",rU),n.on("error",Hk),n}Bk.exports=nU});var Jk=b((oW,Gk)=>{"use strict";var{tokenChars:iU}=zi();function oU(t){let e=new Set,r=-1,n=-1,i=0;for(i;i<t.length;i++){let s=t.charCodeAt(i);if(n===-1&&iU[s]===1)r===-1&&(r=i);else if(i!==0&&(s===32||s===9))n===-1&&r!==-1&&(n=i);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=t.slice(r,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=t.slice(r,i);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}Gk.exports={parse:oU}});var r0=b((aW,t0)=>{"use strict";var sU=G("events"),Ru=G("http"),{Duplex:sW}=G("stream"),{createHash:aU}=G("crypto"),Kk=Cg(),zn=Rs(),cU=Jk(),uU=Ou(),{CLOSE_TIMEOUT:lU,GUID:dU,kWebSocket:fU}=Ir(),pU=/^[+/0-9A-Za-z]{22}==$/,Yk=0,Xk=1,e0=2,Lg=class extends sU{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:lU,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:uU,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Ru.createServer((n,i)=>{let o=Ru.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=mU(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Yk}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===e0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Cs,this);return}if(e&&this.once("close",e),this._state!==Xk)if(this._state=Xk,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Cs,this):process.nextTick(Cs,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Cs(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,n,i){r.on("error",Qk);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){In(this,e,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){In(this,e,r,400,"Invalid Upgrade header");return}if(o===void 0||!pU.test(o)){In(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){In(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Ds(r,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=cU.parse(c)}catch{In(this,e,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new zn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let p=Kk.parse(l);p[zn.extensionName]&&(f.accept(p[zn.extensionName]),d[zn.extensionName]=f)}catch{In(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(p,m,h,v)=>{if(!p)return Ds(r,m||401,h,v);this.completeUpgrade(d,o,u,e,r,n,i)});return}if(!this.options.verifyClient(f))return Ds(r,401)}this.completeUpgrade(d,o,u,e,r,n,i)}completeUpgrade(e,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[fU])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Yk)return Ds(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${aU("sha1").update(r+dU).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[zn.extensionName]){let d=e[zn.extensionName].params,f=Kk.format({[zn.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=e}this.emit("headers",u,i),o.write(u.concat(`\r
11
+ `).join(`\r
12
+ `)),o.removeListener("error",Qk),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Cs,this)})),a(l,i)}};t0.exports=Lg;function mU(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let n of Object.keys(e))t.removeListener(n,e[n])}}function Cs(t){t._state=e0,t.emit("close")}function Qk(){this.destroy()}function Ds(t,e,r,n){r=r||Ru.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Ru.STATUS_CODES[e]}\r
13
+ `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
14
+ `)+`\r
15
+ \r
16
+ `+r)}function In(t,e,r,n,i,o){if(t.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,In),t.emit("wsClientError",s,r,e)}else Ds(r,n,i,o)}});var ce;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(ce||(ce={}));var Vg;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Vg||(Vg={}));var R=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:t===null?R.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?R.promise:typeof Map<"u"&&t instanceof Map?R.map:typeof Set<"u"&&t instanceof Set?R.set:typeof Date<"u"&&t instanceof Date?R.date:R.object;default:return R.unknown}};var w=ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var $t=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};$t.create=t=>new $t(t);var d0=(t,e)=>{let r;switch(t.code){case w.invalid_type:t.received===R.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case w.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case w.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}},Nr=d0;var f0=Nr;function Ni(){return f0}var Vs=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}};function T(t,e){let r=Ni(),n=Vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Nr?void 0:Nr].filter(i=>!!i)});t.common.issues.push(n)}var Ye=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return V;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return V;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},V=Object.freeze({status:"aborted"}),Tn=t=>({status:"dirty",value:t}),st=t=>({status:"valid",value:t}),Du=t=>t.status==="aborted",Uu=t=>t.status==="dirty",tn=t=>t.status==="valid",ji=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(C||(C={}));var Tt=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Hg=(t,e)=>{if(tn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new $t(t.common.issues);return this._error=r,this._error}}};function J(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}var te=class{get description(){return this._def.description}_getType(e){return dr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ye,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ji(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},i=this._parseSync({data:e,path:n.path,parent:n});return Hg(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return tn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>tn(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(ji(i)?i:Promise.resolve(i));return Hg(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:w.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new qt({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Lt.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ar.create(this)}promise(){return rn.create(this,this._def)}or(e){return jn.create([this,e],this._def)}and(e){return An.create(this,e,this._def)}transform(e){return new qt({...J(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Mn({...J(this._def),innerType:this,defaultValue:r,typeName:L.ZodDefault})}brand(){return new Hs({typeName:L.ZodBranded,type:this,...J(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ln({...J(this._def),innerType:this,catchValue:r,typeName:L.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Bs.create(this,e)}readonly(){return qn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},p0=/^c[^\s-]{8,}$/i,m0=/^[0-9a-z]+$/,h0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,g0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_0=/^[a-z0-9_-]{21}$/i,v0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,y0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,b0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Zu,x0=/^(?:(?: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])$/,S0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,w0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,k0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,E0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Bg="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",I0=new RegExp(`^${Bg}$`);function Wg(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function T0(t){return new RegExp(`^${Wg(t)}$`)}function P0(t){let e=`${Bg}T${Wg(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function O0(t,e){return!!((e==="v4"||!e)&&x0.test(t)||(e==="v6"||!e)&&w0.test(t))}function R0(t,e){if(!v0.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function N0(t,e){return!!((e==="v4"||!e)&&S0.test(t)||(e==="v6"||!e)&&k0.test(t))}var On=class t extends te{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){let o=this._getOrReturnCtx(e);return T(o,{code:w.invalid_type,expected:R.string,received:o.parsedType}),V}let n=new Ye,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),T(i,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),T(i,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?T(i,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&T(i,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")$0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"email",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Zu||(Zu=new RegExp(b0,"u")),Zu.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"emoji",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")g0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"uuid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")_0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"nanoid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")p0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"cuid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")m0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"cuid2",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")h0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"ulid",code:w.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),T(i,{validation:"url",code:w.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"regex",code:w.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?P0(o).test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?I0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?T0(o).test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{code:w.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?y0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"duration",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?O0(e.data,o.version)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"ip",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?R0(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"jwt",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?N0(e.data,o.version)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"cidr",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?E0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"base64",code:w.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?z0.test(e.data)||(i=this._getOrReturnCtx(e,i),T(i,{validation:"base64url",code:w.invalid_string,message:o.message}),n.dirty()):ce.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:w.invalid_string,...C.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...C.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errToObj(r)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};On.create=t=>new On({checks:[],typeName:L.ZodString,coerce:t?.coerce??!1,...J(t)});function j0(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var Ai=class t extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){let o=this._getOrReturnCtx(e);return T(o,{code:w.invalid_type,expected:R.number,received:o.parsedType}),V}let n,i=new Ye;for(let o of this._def.checks)o.kind==="int"?ce.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:w.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?j0(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:w.not_finite,message:o.message}),i.dirty()):ce.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ai.create=t=>new Ai({checks:[],typeName:L.ZodNumber,coerce:t?.coerce||!1,...J(t)});var Ci=class t extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n,i=new Ye;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):ce.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return T(r,{code:w.invalid_type,expected:R.bigint,received:r.parsedType}),V}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Ci.create=t=>new Ci({checks:[],typeName:L.ZodBigInt,coerce:t?.coerce??!1,...J(t)});var Di=class extends te{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.boolean,received:n.parsedType}),V}return st(e.data)}};Di.create=t=>new Di({typeName:L.ZodBoolean,coerce:t?.coerce||!1,...J(t)});var Ui=class t extends te{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){let o=this._getOrReturnCtx(e);return T(o,{code:w.invalid_type,expected:R.date,received:o.parsedType}),V}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return T(o,{code:w.invalid_date}),V}let n=new Ye,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),T(i,{code:w.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),T(i,{code:w.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):ce.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Ui.create=t=>new Ui({checks:[],coerce:t?.coerce||!1,typeName:L.ZodDate,...J(t)});var Zi=class extends te{_parse(e){if(this._getType(e)!==R.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.symbol,received:n.parsedType}),V}return st(e.data)}};Zi.create=t=>new Zi({typeName:L.ZodSymbol,...J(t)});var Rn=class extends te{_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.undefined,received:n.parsedType}),V}return st(e.data)}};Rn.create=t=>new Rn({typeName:L.ZodUndefined,...J(t)});var Nn=class extends te{_parse(e){if(this._getType(e)!==R.null){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.null,received:n.parsedType}),V}return st(e.data)}};Nn.create=t=>new Nn({typeName:L.ZodNull,...J(t)});var Mi=class extends te{constructor(){super(...arguments),this._any=!0}_parse(e){return st(e.data)}};Mi.create=t=>new Mi({typeName:L.ZodAny,...J(t)});var jr=class extends te{constructor(){super(...arguments),this._unknown=!0}_parse(e){return st(e.data)}};jr.create=t=>new jr({typeName:L.ZodUnknown,...J(t)});var er=class extends te{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:w.invalid_type,expected:R.never,received:r.parsedType}),V}};er.create=t=>new er({typeName:L.ZodNever,...J(t)});var Li=class extends te{_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.void,received:n.parsedType}),V}return st(e.data)}};Li.create=t=>new Li({typeName:L.ZodVoid,...J(t)});var Ar=class t extends te{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==R.array)return T(r,{code:w.invalid_type,expected:R.array,received:r.parsedType}),V;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(T(r,{code:s?w.too_big:w.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(T(r,{code:w.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(T(r,{code:w.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new Tt(r,s,r.path,a)))).then(s=>Ye.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new Tt(r,s,r.path,a)));return Ye.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:C.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:C.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:C.toString(r)}})}nonempty(e){return this.min(1,e)}};Ar.create=(t,e)=>new Ar({type:t,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...J(e)});function Pn(t){if(t instanceof bt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Lt.create(Pn(n))}return new bt({...t._def,shape:()=>e})}else return t instanceof Ar?new Ar({...t._def,type:Pn(t.element)}):t instanceof Lt?Lt.create(Pn(t.unwrap())):t instanceof mr?mr.create(Pn(t.unwrap())):t instanceof pr?pr.create(t.items.map(e=>Pn(e))):t}var bt=class t extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ce.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==R.object){let u=this._getOrReturnCtx(e);return T(u,{code:w.invalid_type,expected:R.object,received:u.parsedType}),V}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof er&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=o[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Tt(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof er){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(T(i,{code:w.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Tt(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>Ye.mergeObjectSync(n,u)):Ye.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:C.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:L.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of ce.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of ce.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Pn(this)}partial(e){let r={};for(let n of ce.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of ce.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Lt;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return Gg(ce.objectKeys(this.shape))}};bt.create=(t,e)=>new bt({shape:()=>t,unknownKeys:"strip",catchall:er.create(),typeName:L.ZodObject,...J(e)});bt.strictCreate=(t,e)=>new bt({shape:()=>t,unknownKeys:"strict",catchall:er.create(),typeName:L.ZodObject,...J(e)});bt.lazycreate=(t,e)=>new bt({shape:t,unknownKeys:"strip",catchall:er.create(),typeName:L.ZodObject,...J(e)});var jn=class extends te{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new $t(a.ctx.common.issues));return T(r,{code:w.invalid_union,unionErrors:s}),V}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new $t(c));return T(r,{code:w.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};jn.create=(t,e)=>new jn({options:t,typeName:L.ZodUnion,...J(e)});var fr=t=>t instanceof Cn?fr(t.schema):t instanceof qt?fr(t.innerType()):t instanceof Dn?[t.value]:t instanceof Un?t.options:t instanceof Zn?ce.objectValues(t.enum):t instanceof Mn?fr(t._def.innerType):t instanceof Rn?[void 0]:t instanceof Nn?[null]:t instanceof Lt?[void 0,...fr(t.unwrap())]:t instanceof mr?[null,...fr(t.unwrap())]:t instanceof Hs||t instanceof qn?fr(t.unwrap()):t instanceof Ln?fr(t._def.innerType):[],Mu=class t extends te{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.object)return T(r,{code:w.invalid_type,expected:R.object,received:r.parsedType}),V;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(T(r,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=fr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:L.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...J(n)})}};function Lu(t,e){let r=dr(t),n=dr(e);if(t===e)return{valid:!0,data:t};if(r===R.object&&n===R.object){let i=ce.objectKeys(e),o=ce.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=Lu(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===R.array&&n===R.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=Lu(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===R.date&&n===R.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var An=class extends te{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Du(o)||Du(s))return V;let a=Lu(o.value,s.value);return a.valid?((Uu(o)||Uu(s))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:w.invalid_intersection_types}),V)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};An.create=(t,e,r)=>new An({left:t,right:e,typeName:L.ZodIntersection,...J(r)});var pr=class t extends te{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return T(n,{code:w.invalid_type,expected:R.array,received:n.parsedType}),V;if(n.data.length<this._def.items.length)return T(n,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Tt(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ye.mergeArray(r,s)):Ye.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};pr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pr({items:t,typeName:L.ZodTuple,rest:null,...J(e)})};var qu=class t extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.object)return T(n,{code:w.invalid_type,expected:R.object,received:n.parsedType}),V;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new Tt(n,a,n.path,a)),value:s._parse(new Tt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ye.mergeObjectAsync(r,i):Ye.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof te?new t({keyType:e,valueType:r,typeName:L.ZodRecord,...J(n)}):new t({keyType:On.create(),valueType:e,typeName:L.ZodRecord,...J(r)})}},qi=class extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return T(n,{code:w.invalid_type,expected:R.map,received:n.parsedType}),V;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new Tt(n,a,n.path,[u,"key"])),value:o._parse(new Tt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return V;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return V;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};qi.create=(t,e,r)=>new qi({valueType:e,keyType:t,typeName:L.ZodMap,...J(r)});var Fi=class t extends te{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return T(n,{code:w.invalid_type,expected:R.set,received:n.parsedType}),V;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(T(n,{code:w.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(T(n,{code:w.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return V;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new Tt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:C.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:C.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Fi.create=(t,e)=>new Fi({valueType:t,minSize:null,maxSize:null,typeName:L.ZodSet,...J(e)});var Fu=class t extends te{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.function)return T(r,{code:w.invalid_type,expected:R.function,received:r.parsedType}),V;function n(a,c){return Vs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ni(),Nr].filter(u=>!!u),issueData:{code:w.invalid_arguments,argumentsError:c}})}function i(a,c){return Vs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ni(),Nr].filter(u=>!!u),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof rn){let a=this;return st(async function(...c){let u=new $t([]),l=await a._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(i(d,p)),u})})}else{let a=this;return st(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new $t([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new $t([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:pr.create(e).rest(jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||pr.create([]).rest(jr.create()),returns:r||jr.create(),typeName:L.ZodFunction,...J(n)})}},Cn=class extends te{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cn.create=(t,e)=>new Cn({getter:t,typeName:L.ZodLazy,...J(e)});var Dn=class extends te{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:w.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}};Dn.create=(t,e)=>new Dn({value:t,typeName:L.ZodLiteral,...J(e)});function Gg(t,e){return new Un({values:t,typeName:L.ZodEnum,...J(e)})}var Un=class t extends te{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:ce.joinValues(n),received:r.parsedType,code:w.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:w.invalid_enum_value,options:n}),V}return st(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Un.create=Gg;var Zn=class extends te{_parse(e){let r=ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){let i=ce.objectValues(r);return T(n,{expected:ce.joinValues(i),received:n.parsedType,code:w.invalid_type}),V}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=ce.objectValues(r);return T(n,{received:n.data,code:w.invalid_enum_value,options:i}),V}return st(e.data)}get enum(){return this._def.values}};Zn.create=(t,e)=>new Zn({values:t,typeName:L.ZodNativeEnum,...J(e)});var rn=class extends te{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==R.promise&&r.common.async===!1)return T(r,{code:w.invalid_type,expected:R.promise,received:r.parsedType}),V;let n=r.parsedType===R.promise?r.data:Promise.resolve(r.data);return st(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};rn.create=(t,e)=>new rn({type:t,typeName:L.ZodPromise,...J(e)});var qt=class extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{T(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return V;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?V:c.status==="dirty"?Tn(c.value):r.value==="dirty"?Tn(c.value):c});{if(r.value==="aborted")return V;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?V:a.status==="dirty"?Tn(a.value):r.value==="dirty"?Tn(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?V:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?V:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tn(s))return V;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>tn(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):V);ce.assertNever(i)}};qt.create=(t,e,r)=>new qt({schema:t,typeName:L.ZodEffects,effect:e,...J(r)});qt.createWithPreprocess=(t,e,r)=>new qt({schema:e,effect:{type:"preprocess",transform:t},typeName:L.ZodEffects,...J(r)});var Lt=class extends te{_parse(e){return this._getType(e)===R.undefined?st(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:L.ZodOptional,...J(e)});var mr=class extends te{_parse(e){return this._getType(e)===R.null?st(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:L.ZodNullable,...J(e)});var Mn=class extends te{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Mn.create=(t,e)=>new Mn({innerType:t,typeName:L.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...J(e)});var Ln=class extends te{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ji(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $t(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $t(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ln.create=(t,e)=>new Ln({innerType:t,typeName:L.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...J(e)});var Vi=class extends te{_parse(e){if(this._getType(e)!==R.nan){let n=this._getOrReturnCtx(e);return T(n,{code:w.invalid_type,expected:R.nan,received:n.parsedType}),V}return{status:"valid",value:e.data}}};Vi.create=t=>new Vi({typeName:L.ZodNaN,...J(t)});var Hs=class extends te{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Bs=class t extends te{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?V:o.status==="dirty"?(r.dirty(),Tn(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?V:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:L.ZodPipeline})}},qn=class extends te{_parse(e){let r=this._def.innerType._parse(e),n=i=>(tn(i)&&(i.value=Object.freeze(i.value)),i);return ji(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};qn.create=(t,e)=>new qn({innerType:t,typeName:L.ZodReadonly,...J(e)});var UU={object:bt.lazycreate},L;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(L||(L={}));var ZU=On.create,MU=Ai.create,LU=Vi.create,qU=Ci.create,FU=Di.create,VU=Ui.create,HU=Zi.create,BU=Rn.create,WU=Nn.create,GU=Mi.create,JU=jr.create,KU=er.create,YU=Li.create,XU=Ar.create,A0=bt.create,QU=bt.strictCreate,eZ=jn.create,tZ=Mu.create,rZ=An.create,nZ=pr.create,iZ=qu.create,oZ=qi.create,sZ=Fi.create,aZ=Fu.create,cZ=Cn.create,uZ=Dn.create,lZ=Un.create,dZ=Zn.create,fZ=rn.create,pZ=qt.create,mZ=Lt.create,hZ=mr.create,gZ=qt.createWithPreprocess,_Z=Bs.create;var Jg=Object.freeze({status:"aborted"});function g(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=s.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let f=l[d];f in a||(a[f]=u[f].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var tr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},nn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Ws={};function Le(t){return t&&Object.assign(Ws,t),Ws}var k={};Ri(k,{BIGINT_FORMAT_RANGES:()=>Qu,Class:()=>Hu,NUMBER_FORMAT_RANGES:()=>Xu,aborted:()=>Zr,allowsEval:()=>Gu,assert:()=>q0,assertEqual:()=>U0,assertIs:()=>M0,assertNever:()=>L0,assertNotEqual:()=>Z0,assignProp:()=>Dr,base64ToUint8Array:()=>n_,base64urlToUint8Array:()=>Q0,cached:()=>Vn,captureStackTrace:()=>Js,cleanEnum:()=>X0,cleanRegex:()=>Wi,clone:()=>at,cloneDef:()=>V0,createTransparentProxy:()=>K0,defineLazy:()=>K,esc:()=>Gs,escapeRegex:()=>Pt,extend:()=>Qg,finalizeIssue:()=>pt,floatSafeRemainder:()=>Bu,getElementAtPath:()=>H0,getEnumValues:()=>Bi,getLengthableOrigin:()=>Ki,getParsedType:()=>J0,getSizableOrigin:()=>Ji,hexToUint8Array:()=>tE,isObject:()=>on,isPlainObject:()=>Ur,issue:()=>Hn,joinValues:()=>q,jsonStringifyReplacer:()=>Fn,merge:()=>Y0,mergeDefs:()=>hr,normalizeParams:()=>P,nullish:()=>Cr,numKeys:()=>G0,objectClone:()=>F0,omit:()=>Xg,optionalKeys:()=>Yu,parsedType:()=>H,partial:()=>t_,pick:()=>Yg,prefixIssues:()=>xt,primitiveTypes:()=>Ku,promiseAllObject:()=>B0,propertyKeyTypes:()=>Gi,randomString:()=>W0,required:()=>r_,safeExtend:()=>e_,shallowClone:()=>Ju,slugify:()=>Wu,stringifyPrimitive:()=>F,uint8ArrayToBase64:()=>i_,uint8ArrayToBase64url:()=>eE,uint8ArrayToHex:()=>rE,unwrapMessage:()=>Hi});function U0(t){return t}function Z0(t){return t}function M0(t){}function L0(t){throw new Error("Unexpected value in exhaustive check")}function q0(t){}function Bi(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function q(t,e="|"){return t.map(r=>F(r)).join(e)}function Fn(t,e){return typeof e=="bigint"?e.toString():e}function Vn(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Cr(t){return t==null}function Wi(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Bu(t,e){let r=(t.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let o=r>i?r:i,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Kg=Symbol("evaluating");function K(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Kg)return n===void 0&&(n=Kg,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function F0(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Dr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function hr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function V0(t){return hr(t._zod.def)}function H0(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function B0(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function W0(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function Gs(t){return JSON.stringify(t)}function Wu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Js="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function on(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Gu=Vn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ur(t){if(on(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(on(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ju(t){return Ur(t)?{...t}:Array.isArray(t)?[...t]:t}function G0(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var J0=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}`)}},Gi=new Set(["string","number","symbol"]),Ku=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function at(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function P(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 K0(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,o){return e??(e=t()),Reflect.set(e,n,i,o)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function F(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Yu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Xu={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]},Qu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yg(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=hr(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return Dr(this,"shape",s),s},checks:[]});return at(t,o)}function Xg(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=hr(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Dr(this,"shape",s),s},checks:[]});return at(t,o)}function Qg(t,e){if(!Ur(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=hr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Dr(this,"shape",o),o}});return at(t,i)}function e_(t,e){if(!Ur(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=hr(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Dr(this,"shape",n),n}});return at(t,r)}function Y0(t,e){let r=hr(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Dr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return at(t,r)}function t_(t,e,r){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=hr(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 Dr(this,"shape",c),c},checks:[]});return at(e,s)}function r_(t,e,r){let n=hr(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new t({type:"nonoptional",innerType:i[s]});return Dr(this,"shape",o),o}});return at(e,n)}function Zr(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 xt(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Hi(t){return typeof t=="string"?t:t?.message}function pt(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=Hi(t.inst?._zod.def?.error?.(t))??Hi(e?.error?.(t))??Hi(r.customError?.(t))??Hi(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Ji(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Ki(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function H(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 Hn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function X0(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function n_(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function i_(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Q0(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return n_(e+r)}function eE(t){return i_(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function tE(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 n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function rE(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Hu=class{constructor(...e){}};var o_=(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,Fn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ks=g("$ZodError",o_),Yi=g("$ZodError",o_,{Parent:Error});function Ys(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function Xs(t,e=r=>r.message){let r={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return n(t),r}var Xi=t=>(e,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new tr;if(s.issues.length){let a=new(i?.Err??t)(s.issues.map(c=>pt(c,o,Le())));throw Js(a,i?.callee),a}return s.value},Qi=Xi(Yi),eo=t=>async(e,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??t)(s.issues.map(c=>pt(c,o,Le())));throw Js(a,i?.callee),a}return s.value},to=eo(Yi),ro=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new tr;return o.issues.length?{success:!1,error:new(t??Ks)(o.issues.map(s=>pt(s,i,Le())))}:{success:!0,data:o.value}},Bn=ro(Yi),no=t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>pt(s,i,Le())))}:{success:!0,data:o.value}},io=no(Yi),s_=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xi(t)(e,r,i)};var a_=t=>(e,r,n)=>Xi(t)(e,r,n);var c_=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return eo(t)(e,r,i)};var u_=t=>async(e,r,n)=>eo(t)(e,r,n);var l_=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ro(t)(e,r,i)};var d_=t=>(e,r,n)=>ro(t)(e,r,n);var f_=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return no(t)(e,r,i)};var p_=t=>async(e,r,n)=>no(t)(e,r,n);var Ot={};Ri(Ot,{base64:()=>hl,base64url:()=>Qs,bigint:()=>bl,boolean:()=>Sl,browserEmail:()=>dE,cidrv4:()=>pl,cidrv6:()=>ml,cuid:()=>el,cuid2:()=>tl,date:()=>_l,datetime:()=>yl,domain:()=>mE,duration:()=>sl,e164:()=>gl,email:()=>cl,emoji:()=>ul,extendedDuration:()=>iE,guid:()=>al,hex:()=>hE,hostname:()=>pE,html5Email:()=>cE,idnEmail:()=>lE,integer:()=>xl,ipv4:()=>ll,ipv6:()=>dl,ksuid:()=>il,lowercase:()=>El,mac:()=>fl,md5_base64:()=>_E,md5_base64url:()=>vE,md5_hex:()=>gE,nanoid:()=>ol,null:()=>wl,number:()=>ea,rfc5322Email:()=>uE,sha1_base64:()=>$E,sha1_base64url:()=>bE,sha1_hex:()=>yE,sha256_base64:()=>SE,sha256_base64url:()=>wE,sha256_hex:()=>xE,sha384_base64:()=>EE,sha384_base64url:()=>zE,sha384_hex:()=>kE,sha512_base64:()=>TE,sha512_base64url:()=>PE,sha512_hex:()=>IE,string:()=>$l,time:()=>vl,ulid:()=>rl,undefined:()=>kl,unicodeEmail:()=>m_,uppercase:()=>zl,uuid:()=>sn,uuid4:()=>oE,uuid6:()=>sE,uuid7:()=>aE,xid:()=>nl});var el=/^[cC][^\s-]{8,}$/,tl=/^[0-9a-z]+$/,rl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nl=/^[0-9a-vA-V]{20}$/,il=/^[A-Za-z0-9]{27}$/,ol=/^[a-zA-Z0-9_-]{21}$/,sl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,al=/^([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})$/,sn=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)$/,oE=sn(4),sE=sn(6),aE=sn(7),cl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,m_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,lE=m_,dE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ul(){return new RegExp(fE,"u")}var ll=/^(?:(?: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])$/,dl=/^(([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}|:))$/,fl=t=>{let e=Pt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},pl=/^((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])$/,ml=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qs=/^[A-Za-z0-9_-]*$/,pE=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,mE=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,gl=/^\+[1-9]\d{6,14}$/,h_="(?:(?:\\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])))",_l=new RegExp(`^${h_}$`);function g_(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 vl(t){return new RegExp(`^${g_(t)}$`)}function yl(t){let e=g_({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${h_}T(?:${n})$`)}var $l=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},bl=/^-?\d+n?$/,xl=/^-?\d+$/,ea=/^-?\d+(?:\.\d+)?$/,Sl=/^(?:true|false)$/i,wl=/^null$/i;var kl=/^undefined$/i;var El=/^[^A-Z]*$/,zl=/^[^a-z]*$/,hE=/^[0-9a-fA-F]*$/;function oo(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function so(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var gE=/^[0-9a-fA-F]{32}$/,_E=oo(22,"=="),vE=so(22),yE=/^[0-9a-fA-F]{40}$/,$E=oo(27,"="),bE=so(27),xE=/^[0-9a-fA-F]{64}$/,SE=oo(43,"="),wE=so(43),kE=/^[0-9a-fA-F]{96}$/,EE=oo(64,""),zE=so(64),IE=/^[0-9a-fA-F]{128}$/,TE=oo(86,"=="),PE=so(86);var Se=g("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),v_={number:"number",bigint:"bigint",object:"date"},Il=g("$ZodCheckLessThan",(t,e)=>{Se.init(t,e);let r=v_[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Tl=g("$ZodCheckGreaterThan",(t,e)=>{Se.init(t,e);let r=v_[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),y_=g("$ZodCheckMultipleOf",(t,e)=>{Se.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.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):Bu(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})}}),$_=g("$ZodCheckNumberFormat",(t,e)=>{Se.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,o]=Xu[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,r&&(a.pattern=xl)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),b_=g("$ZodCheckBigIntFormat",(t,e)=>{Se.init(t,e);let[r,n]=Qu[e.format];t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=r,o.maximum=n}),t._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),x_=g("$ZodCheckMaxSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:Ji(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),S_=g("$ZodCheckMinSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:Ji(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),w_=g("$ZodCheckSizeEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let s=o>e.size;n.issues.push({origin:Ji(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),k_=g("$ZodCheckMaxLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let s=Ki(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),E_=g("$ZodCheckMinLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=Ki(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),z_=g("$ZodCheckLengthEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Cr(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let s=Ki(i),a=o>e.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),ao=g("$ZodCheckStringFormat",(t,e)=>{var r,n;Se.init(t,e),t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),I_=g("$ZodCheckRegex",(t,e)=>{ao.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})}}),T_=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=El),ao.init(t,e)}),P_=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=zl),ao.init(t,e)}),O_=g("$ZodCheckIncludes",(t,e)=>{Se.init(t,e);let r=Pt(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),R_=g("$ZodCheckStartsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`^${Pt(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),N_=g("$ZodCheckEndsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`.*${Pt(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function __(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues))}var j_=g("$ZodCheckProperty",(t,e)=>{Se.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>__(i,r,e.property));__(n,r,e.property)}}),A_=g("$ZodCheckMimeType",(t,e)=>{Se.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),C_=g("$ZodCheckOverwrite",(t,e)=>{Se.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var ta=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 n=e.split(`
17
+ `).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),o=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,i.join(`
18
+ `))}};var U_={major:4,minor:3,patch:6};var W=g("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=U_;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let o of i._zod.onattach)o(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=(s,a,c)=>{let u=Zr(s),l;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(u)continue;let f=s.issues.length,p=d._zod.check(s);if(p instanceof Promise&&c?.async===!1)throw new tr;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,s.issues.length!==f&&(u||(u=Zr(s,f)))});else{if(s.issues.length===f)continue;u||(u=Zr(s,f))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Zr(s))return s.aborted=!0,s;let u=i(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new tr;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let u=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new tr;return c.then(u=>i(u,n,a))}return i(c,n,a)}}K(t,"~standard",()=>({validate:i=>{try{let o=Bn(t,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return io(t,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),an=g("$ZodString",(t,e)=>{W.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??$l(t._zod.bag),t._zod.parse=(r,n)=>{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}}),ye=g("$ZodStringFormat",(t,e)=>{ao.init(t,e),an.init(t,e)}),Ol=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=al),ye.init(t,e)}),Rl=g("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=sn(n))}else e.pattern??(e.pattern=sn());ye.init(t,e)}),Nl=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=cl),ye.init(t,e)}),jl=g("$ZodURL",(t,e)=>{ye.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Al=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=ul()),ye.init(t,e)}),Cl=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=ol),ye.init(t,e)}),Dl=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=el),ye.init(t,e)}),Ul=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=tl),ye.init(t,e)}),Zl=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=rl),ye.init(t,e)}),Ml=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=nl),ye.init(t,e)}),Ll=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=il),ye.init(t,e)}),ql=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=yl(e)),ye.init(t,e)}),Fl=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=_l),ye.init(t,e)}),Vl=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=vl(e)),ye.init(t,e)}),Hl=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=sl),ye.init(t,e)}),Bl=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=ll),ye.init(t,e),t._zod.bag.format="ipv4"}),Wl=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=dl),ye.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})}}}),Gl=g("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=fl(e.delimiter)),ye.init(t,e),t._zod.bag.format="mac"}),Jl=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=pl),ye.init(t,e)}),Kl=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ml),ye.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function K_(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Yl=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=hl),ye.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{K_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function OE(t){if(!Qs.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return K_(r)}var Xl=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Qs),ye.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{OE(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Ql=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=gl),ye.init(t,e)});function RE(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var ed=g("$ZodJWT",(t,e)=>{ye.init(t,e),t._zod.check=r=>{RE(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),td=g("$ZodCustomStringFormat",(t,e)=>{ye.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),aa=g("$ZodNumber",(t,e)=>{W.init(t,e),t._zod.pattern=t._zod.bag.pattern??ea,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...o?{received:o}:{}}),r}}),rd=g("$ZodNumberFormat",(t,e)=>{$_.init(t,e),aa.init(t,e)}),co=g("$ZodBoolean",(t,e)=>{W.init(t,e),t._zod.pattern=Sl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),ca=g("$ZodBigInt",(t,e)=>{W.init(t,e),t._zod.pattern=bl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),nd=g("$ZodBigIntFormat",(t,e)=>{b_.init(t,e),ca.init(t,e)}),id=g("$ZodSymbol",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),od=g("$ZodUndefined",(t,e)=>{W.init(t,e),t._zod.pattern=kl,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),sd=g("$ZodNull",(t,e)=>{W.init(t,e),t._zod.pattern=wl,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),ad=g("$ZodAny",(t,e)=>{W.init(t,e),t._zod.parse=r=>r}),cd=g("$ZodUnknown",(t,e)=>{W.init(t,e),t._zod.parse=r=>r}),ud=g("$ZodNever",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),ld=g("$ZodVoid",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),dd=g("$ZodDate",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:t}),r}});function Z_(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}var fd=g("$ZodArray",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],c=e.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Z_(u,r,s))):Z_(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function sa(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...xt(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function Y_(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Yu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function X_(t,e,r,n,i,o){let s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in e){if(a.has(d))continue;if(u==="never"){s.push(d);continue}let f=c.run({value:e[d],issues:[]},n);f instanceof Promise?t.push(f.then(p=>sa(p,r,d,e,l))):sa(f,r,d,e,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}var Q_=g("$ZodObject",(t,e)=>{if(W.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 n=Vn(()=>Y_(e));K(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 i=on,o=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=n.value);let u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=s.shape;for(let f of s.keys){let p=d[f],m=p._zod.optout==="optional",h=p._zod.run({value:u[f],issues:[]},c);h instanceof Promise?l.push(h.then(v=>sa(v,a,f,u,m))):sa(h,a,f,u,m)}return o?X_(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),ev=g("$ZodObjectJIT",(t,e)=>{Q_.init(t,e);let r=t._zod.parse,n=Vn(()=>Y_(e)),i=f=>{let p=new ta(["shape","payload","ctx"]),m=n.value,h=E=>{let A=Gs(E);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};p.write("const input = payload.value;");let v=Object.create(null),S=0;for(let E of m.keys)v[E]=`key_${S++}`;p.write("const newResult = {};");for(let E of m.keys){let A=v[E],z=Gs(E),he=f[E]?._zod?.optout==="optional";p.write(`const ${A} = ${h(E)};`),he?p.write(`
19
+ if (${A}.issues.length) {
20
+ if (${z} in input) {
21
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
22
+ ...iss,
23
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
24
+ })));
25
+ }
26
+ }
27
+
28
+ if (${A}.value === undefined) {
29
+ if (${z} in input) {
30
+ newResult[${z}] = undefined;
31
+ }
32
+ } else {
33
+ newResult[${z}] = ${A}.value;
34
+ }
35
+
36
+ `):p.write(`
37
+ if (${A}.issues.length) {
38
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
39
+ ...iss,
40
+ path: iss.path ? [${z}, ...iss.path] : [${z}]
41
+ })));
42
+ }
43
+
44
+ if (${A}.value === undefined) {
45
+ if (${z} in input) {
46
+ newResult[${z}] = undefined;
47
+ }
48
+ } else {
49
+ newResult[${z}] = ${A}.value;
50
+ }
51
+
52
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");let O=p.compile();return(E,A)=>O(f,E,A)},o,s=on,a=!Ws.jitless,u=a&&Gu.value,l=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=n.value);let m=f.value;return s(m)?a&&u&&p?.async===!1&&p.jitless!==!0?(o||(o=i(e.shape)),f=o(f,p),l?X_([],m,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f)}});function M_(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let i=t.filter(o=>!Zr(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>pt(s,n,Le())))}),e)}var uo=g("$ZodUnion",(t,e)=>{W.init(t,e),K(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),K(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),K(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),K(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Wi(o.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>M_(c,i,t,o)):M_(a,i,t,o)}});function L_(t,e,r,n){let i=t.filter(o=>o.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>pt(s,n,Le())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var pd=g("$ZodXor",(t,e)=>{uo.init(t,e),e.inclusive=!1;let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},o);u instanceof Promise?(a.push(u),s=!0):a.push(u)}return s?Promise.all(a).then(c=>L_(c,i,t,o)):L_(a,i,t,o)}}),md=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,uo.init(t,e);let r=t._zod.parse;K(t._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){i[a]||(i[a]=new Set);for(let u of c)i[a].add(u)}}return i});let n=Vn(()=>{let i=e.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(i,o)=>{let s=i.value;if(!on(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),i)}}),hd=g("$ZodIntersection",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,o=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,u])=>q_(r,c,u)):q_(r,o,s)}});function Pl(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(Ur(t)&&Ur(e)){let r=Object.keys(e),n=Object.keys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(let o of n){let s=Pl(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=e[n],s=Pl(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function q_(t,e,r){let n=new Map,i;for(let a of e.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.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)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&i&&t.issues.push({...i,keys:o}),Zr(t))return t;let s=Pl(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var ua=g("$ZodTuple",(t,e)=>{W.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],a=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let l=o.length>r.length,d=o.length<c-1;if(l||d)return n.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:t,origin:"array"}),n}let u=-1;for(let l of r){if(u++,u>=o.length&&u>=c)continue;let d=l._zod.run({value:o[u],issues:[]},i);d instanceof Promise?s.push(d.then(f=>ra(f,n,u))):ra(d,n,u)}if(e.rest){let l=o.slice(r.length);for(let d of l){u++;let f=e.rest._zod.run({value:d,issues:[]},i);f instanceof Promise?s.push(f.then(p=>ra(p,n,u))):ra(f,n,u)}}return s.length?Promise.all(s).then(()=>n):n}});function ra(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}var gd=g("$ZodRecord",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ur(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...xt(u,d.issues)),r.value[u]=d.value})):(l.issues.length&&r.issues.push(...xt(u,l.issues)),r.value[u]=l.value)}let c;for(let u in i)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ea.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);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]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>pt(d,n,Le())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:i[a],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...xt(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...xt(a,l.issues)),r.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),_d=g("$ZodMap",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of i){let c=e.keyType._zod.run({value:s,issues:[]},n),u=e.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,d])=>{F_(l,d,r,s,i,t,n)})):F_(c,u,r,s,i,t,n)}return o.length?Promise.all(o).then(()=>r):r}});function F_(t,e,r,n,i,o,s){t.issues.length&&(Gi.has(typeof n)?r.issues.push(...xt(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:t.issues.map(a=>pt(a,s,Le()))})),e.issues.length&&(Gi.has(typeof n)?r.issues.push(...xt(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:e.issues.map(a=>pt(a,s,Le()))})),r.value.set(t.value,e.value)}var vd=g("$ZodSet",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(c=>V_(c,r))):V_(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function V_(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var yd=g("$ZodEnum",(t,e)=>{W.init(t,e);let r=Bi(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Gi.has(typeof i)).map(i=>typeof i=="string"?Pt(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),$d=g("$ZodLiteral",(t,e)=>{if(W.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(n=>typeof n=="string"?Pt(n):n?Pt(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}}),bd=g("$ZodFile",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),xd=g("$ZodTransform",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nn(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new tr;return r.value=i,r}});function H_(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}var la=g("$ZodOptional",(t,e)=>{W.init(t,e),t._zod.optin="optional",t._zod.optout="optional",K(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),K(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Wi(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>H_(o,r.value)):H_(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),Sd=g("$ZodExactOptional",(t,e)=>{la.init(t,e),K(t._zod,"values",()=>e.innerType._zod.values),K(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),wd=g("$ZodNullable",(t,e)=>{W.init(t,e),K(t._zod,"optin",()=>e.innerType._zod.optin),K(t._zod,"optout",()=>e.innerType._zod.optout),K(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Wi(r.source)}|null)$`):void 0}),K(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),kd=g("$ZodDefault",(t,e)=>{W.init(t,e),t._zod.optin="optional",K(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>B_(o,e)):B_(i,e)}});function B_(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Ed=g("$ZodPrefault",(t,e)=>{W.init(t,e),t._zod.optin="optional",K(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),zd=g("$ZodNonOptional",(t,e)=>{W.init(t,e),K(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>W_(o,t)):W_(i,t)}});function W_(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 Id=g("$ZodSuccess",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nn("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),Td=g("$ZodCatch",(t,e)=>{W.init(t,e),K(t._zod,"optin",()=>e.innerType._zod.optin),K(t._zod,"optout",()=>e.innerType._zod.optout),K(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>pt(s,n,Le()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(o=>pt(o,n,Le()))},input:r.value}),r.issues=[]),r)}}),Pd=g("$ZodNaN",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Od=g("$ZodPipe",(t,e)=>{W.init(t,e),K(t._zod,"values",()=>e.in._zod.values),K(t._zod,"optin",()=>e.in._zod.optin),K(t._zod,"optout",()=>e.out._zod.optout),K(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>na(s,e.in,n)):na(o,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>na(o,e.out,n)):na(i,e.out,n)}});function na(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}var lo=g("$ZodCodec",(t,e)=>{W.init(t,e),K(t._zod,"values",()=>e.in._zod.values),K(t._zod,"optin",()=>e.in._zod.optin),K(t._zod,"optout",()=>e.out._zod.optout),K(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>ia(s,e,n)):ia(o,e,n)}else{let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>ia(s,e,n)):ia(o,e,n)}}});function ia(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>oa(t,o,e.out,r)):oa(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(o=>oa(t,o,e.in,r)):oa(t,i,e.in,r)}}function oa(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var Rd=g("$ZodReadonly",(t,e)=>{W.init(t,e),K(t._zod,"propValues",()=>e.innerType._zod.propValues),K(t._zod,"values",()=>e.innerType._zod.values),K(t._zod,"optin",()=>e.innerType?._zod?.optin),K(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(G_):G_(i)}});function G_(t){return t.value=Object.freeze(t.value),t}var Nd=g("$ZodTemplateLiteral",(t,e)=>{W.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,s))}else if(n===null||Ku.has(typeof n))r.push(Pt(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),jd=g("$ZodFunction",(t,e)=>(W.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?Qi(t._def.input,n):n,o=Reflect.apply(r,this,i);return t._def.output?Qi(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await to(t._def.input,n):n,o=await Reflect.apply(r,this,i);return t._def.output?await to(t._def.output,o):o}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new ua({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),Ad=g("$ZodPromise",(t,e)=>{W.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),Cd=g("$ZodLazy",(t,e)=>{W.init(t,e),K(t._zod,"innerType",()=>e.getter()),K(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),K(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),K(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),K(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),Dd=g("$ZodCustom",(t,e)=>{Se.init(t,e),W.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>J_(o,r,n,t));J_(i,r,n,t)}});function J_(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Hn(i))}}var jE=()=>{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(i){return t[i]??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"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=H(i.input),a=n[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${F(i.values[0])}`:`Invalid option: expected one of ${q(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${q(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ud(){return{localeError:jE()}}var tv;var Md=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.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 n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ld(){return new Md}(tv=globalThis).__zod_globalRegistry??(tv.__zod_globalRegistry=Ld());var ct=globalThis.__zod_globalRegistry;function qd(t,e){return new t({type:"string",...P(e)})}function da(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...P(e)})}function fo(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...P(e)})}function fa(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...P(e)})}function pa(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(e)})}function ma(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(e)})}function ha(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(e)})}function po(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...P(e)})}function ga(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...P(e)})}function _a(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(e)})}function va(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...P(e)})}function ya(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(e)})}function $a(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...P(e)})}function ba(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...P(e)})}function xa(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(e)})}function Sa(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(e)})}function wa(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(e)})}function Fd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...P(e)})}function ka(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(e)})}function Ea(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(e)})}function za(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...P(e)})}function Ia(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...P(e)})}function Ta(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...P(e)})}function Pa(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...P(e)})}function Vd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(e)})}function Hd(t,e){return new t({type:"string",format:"date",check:"string_format",...P(e)})}function Bd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...P(e)})}function Wd(t,e){return new t({type:"string",format:"duration",check:"string_format",...P(e)})}function Gd(t,e){return new t({type:"number",checks:[],...P(e)})}function Jd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...P(e)})}function Kd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...P(e)})}function Yd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...P(e)})}function Xd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...P(e)})}function Qd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...P(e)})}function ef(t,e){return new t({type:"boolean",...P(e)})}function tf(t,e){return new t({type:"bigint",...P(e)})}function rf(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(e)})}function nf(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(e)})}function of(t,e){return new t({type:"symbol",...P(e)})}function sf(t,e){return new t({type:"undefined",...P(e)})}function af(t,e){return new t({type:"null",...P(e)})}function cf(t){return new t({type:"any"})}function uf(t){return new t({type:"unknown"})}function lf(t,e){return new t({type:"never",...P(e)})}function df(t,e){return new t({type:"void",...P(e)})}function ff(t,e){return new t({type:"date",...P(e)})}function pf(t,e){return new t({type:"nan",...P(e)})}function gr(t,e){return new Il({check:"less_than",...P(e),value:t,inclusive:!1})}function St(t,e){return new Il({check:"less_than",...P(e),value:t,inclusive:!0})}function _r(t,e){return new Tl({check:"greater_than",...P(e),value:t,inclusive:!1})}function ut(t,e){return new Tl({check:"greater_than",...P(e),value:t,inclusive:!0})}function mf(t){return _r(0,t)}function hf(t){return gr(0,t)}function gf(t){return St(0,t)}function _f(t){return ut(0,t)}function cn(t,e){return new y_({check:"multiple_of",...P(e),value:t})}function un(t,e){return new x_({check:"max_size",...P(e),maximum:t})}function vr(t,e){return new S_({check:"min_size",...P(e),minimum:t})}function Wn(t,e){return new w_({check:"size_equals",...P(e),size:t})}function Gn(t,e){return new k_({check:"max_length",...P(e),maximum:t})}function Mr(t,e){return new E_({check:"min_length",...P(e),minimum:t})}function Jn(t,e){return new z_({check:"length_equals",...P(e),length:t})}function mo(t,e){return new I_({check:"string_format",format:"regex",...P(e),pattern:t})}function ho(t){return new T_({check:"string_format",format:"lowercase",...P(t)})}function go(t){return new P_({check:"string_format",format:"uppercase",...P(t)})}function _o(t,e){return new O_({check:"string_format",format:"includes",...P(e),includes:t})}function vo(t,e){return new R_({check:"string_format",format:"starts_with",...P(e),prefix:t})}function yo(t,e){return new N_({check:"string_format",format:"ends_with",...P(e),suffix:t})}function vf(t,e,r){return new j_({check:"property",property:t,schema:e,...P(r)})}function $o(t,e){return new A_({check:"mime_type",mime:t,...P(e)})}function rr(t){return new C_({check:"overwrite",tx:t})}function bo(t){return rr(e=>e.normalize(t))}function xo(){return rr(t=>t.trim())}function So(){return rr(t=>t.toLowerCase())}function wo(){return rr(t=>t.toUpperCase())}function Oa(){return rr(t=>Wu(t))}function rv(t,e,r){return new t({type:"array",element:e,...P(r)})}function yf(t,e){return new t({type:"file",...P(e)})}function $f(t,e,r){let n=P(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function bf(t,e,r){return new t({type:"custom",check:"custom",fn:e,...P(r)})}function xf(t){let e=UE(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Hn(n,r.value,e._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),r.issues.push(Hn(i))}},t(r.value,r)));return e}function UE(t,e){let r=new Se({check:"custom",...P(e)});return r._zod.check=t,r}function Sf(t){let e=new Se({check:"describe"});return e._zod.onattach=[r=>{let n=ct.get(r)??{};ct.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function wf(t){let e=new Se({check:"meta"});return e._zod.onattach=[r=>{let n=ct.get(r)??{};ct.add(r,{...n,...t})}],e._zod.check=()=>{},e}function kf(t,e){let r=P(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),i=i.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(n),s=new Set(i),a=t.Codec??lo,c=t.Boolean??co,u=t.String??an,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:l,out:d,transform:((p,m)=>{let h=p;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?n[0]||"true":i[0]||"false"),error:r.error});return f}function Kn(t,e,r,n={}){let i=P(n),o={...P(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...i};return r instanceof RegExp&&(o.pattern=r),new t(o)}function Ra(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??ct,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 ze(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let f=s.schema,p=e.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(t,e,f,l)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),ze(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&lt(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Na(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,f=t.external.uri??(m=>m);if(d)return{ref:f(d)};let p=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let u=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=i(s);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 s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
53
+
54
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let u=t.external.registry.get(s[0])?.id;if(e!==s[0]&&u){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function ja(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let a=t.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){n(l);let f=t.seen.get(l),p=f.schema;if(p.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,u),s._zod.parent===l)for(let h in c)h==="$ref"||h==="allOf"||h in u||delete c[h];if(p.$ref&&f.def)for(let h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}let d=s._zod.parent;if(d&&d!==l){n(d);let f=t.seen.get(d);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let p in c)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(c[p])===JSON.stringify(f.def[p])&&delete c[p]}t.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let o=t.external?.defs??{};for(let s of t.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:ko(e,"input",t.processors),output:ko(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function lt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return lt(n.element,r);if(n.type==="set")return lt(n.valueType,r);if(n.type==="lazy")return lt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return lt(n.innerType,r);if(n.type==="intersection")return lt(n.left,r)||lt(n.right,r);if(n.type==="record"||n.type==="map")return lt(n.keyType,r)||lt(n.valueType,r);if(n.type==="pipe")return lt(n.in,r)||lt(n.out,r);if(n.type==="object"){for(let i in n.shape)if(lt(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(lt(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(lt(i,r))return!0;return!!(n.rest&&lt(n.rest,r))}return!1}var nv=(t,e={})=>r=>{let n=Ra({...r,processors:e});return ze(t,n),Na(n,t),ja(n,t)},ko=(t,e,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Ra({...i??{},target:o,io:e,processors:r});return ze(t,s),Na(s,t),ja(s,t)};var ZE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iv=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=ZE[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?i.pattern=l[0].source:l.length>1&&(i.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ov=(t,e,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),typeof o=="number"&&(i.minimum=o,typeof l=="number"&&e.target!=="draft-04"&&(l>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof s=="number"&&(i.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},sv=(t,e,r,n)=>{r.type="boolean"},av=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},cv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},uv=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},dv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fv=(t,e,r,n)=>{r.not={}},pv=(t,e,r,n)=>{},mv=(t,e,r,n)=>{},hv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},gv=(t,e,r,n)=>{let i=t._zod.def,o=Bi(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},_v=(t,e,r,n)=>{let i=t._zod.def,o=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},vv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},yv=(t,e,r,n)=>{let i=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},$v=(t,e,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,o)},bv=(t,e,r,n)=>{r.type="boolean"},xv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},wv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kv=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ev=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},zv=(t,e,r,n)=>{let i=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=ze(o.element,e,{...n,path:[...n.path,"items"]})},Iv=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object",i.properties={};let s=o.shape;for(let u in s)i.properties[u]=ze(s[u],e,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let l=o.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=ze(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Ef=(t,e,r,n)=>{let i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>ze(a,e,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Tv=(t,e,r,n)=>{let i=t._zod.def,o=ze(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=ze(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Pv=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>ze(f,e,{...n,path:[...n.path,s,p]})),u=o.rest?ze(o.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):e.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(i.minItems=l),typeof d=="number"&&(i.maxItems=d)},Ov=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let l=ze(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=ze(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ze(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=s._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(i.required=l)}},Rv=(t,e,r,n)=>{let i=t._zod.def,o=ze(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Nv=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},jv=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Av=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Cv=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Dv=(t,e,r,n)=>{let i=t._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;ze(o,e,n);let s=e.seen.get(t);s.ref=o},Uv=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},Zv=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},zf=(t,e,r,n)=>{let i=t._zod.def;ze(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},Mv=(t,e,r,n)=>{let i=t._zod.innerType;ze(i,e,n);let o=e.seen.get(t);o.ref=i};function Yn(t){return!!t._zod}function Lr(t,e){return Yn(t)?Bn(t,e):t.safeParse(e)}function Aa(t){if(!t)return;let e;if(Yn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Vv(t){if(Yn(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.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 n=t.value;if(n!==void 0)return n}var Eo={};Ri(Eo,{ZodAny:()=>cy,ZodArray:()=>fy,ZodBase64:()=>Yf,ZodBase64URL:()=>Xf,ZodBigInt:()=>Va,ZodBigIntFormat:()=>tp,ZodBoolean:()=>Fa,ZodCIDRv4:()=>Jf,ZodCIDRv6:()=>Kf,ZodCUID:()=>qf,ZodCUID2:()=>Ff,ZodCatch:()=>Ry,ZodCodec:()=>cp,ZodCustom:()=>Ja,ZodCustomStringFormat:()=>Io,ZodDate:()=>np,ZodDefault:()=>Ey,ZodDiscriminatedUnion:()=>my,ZodE164:()=>Qf,ZodEmail:()=>Zf,ZodEmoji:()=>Mf,ZodEnum:()=>zo,ZodExactOptional:()=>Sy,ZodFile:()=>by,ZodFunction:()=>Ly,ZodGUID:()=>Da,ZodIPv4:()=>Wf,ZodIPv6:()=>Gf,ZodIntersection:()=>hy,ZodJWT:()=>ep,ZodKSUID:()=>Bf,ZodLazy:()=>Uy,ZodLiteral:()=>$y,ZodMAC:()=>iy,ZodMap:()=>vy,ZodNaN:()=>jy,ZodNanoID:()=>Lf,ZodNever:()=>ly,ZodNonOptional:()=>sp,ZodNull:()=>ay,ZodNullable:()=>ky,ZodNumber:()=>qa,ZodNumberFormat:()=>Xn,ZodObject:()=>Ha,ZodOptional:()=>op,ZodPipe:()=>ap,ZodPrefault:()=>Iy,ZodPromise:()=>My,ZodReadonly:()=>Ay,ZodRecord:()=>Ga,ZodSet:()=>yy,ZodString:()=>Ma,ZodStringFormat:()=>we,ZodSuccess:()=>Oy,ZodSymbol:()=>oy,ZodTemplateLiteral:()=>Dy,ZodTransform:()=>xy,ZodTuple:()=>gy,ZodType:()=>Y,ZodULID:()=>Vf,ZodURL:()=>La,ZodUUID:()=>yr,ZodUndefined:()=>sy,ZodUnion:()=>Ba,ZodUnknown:()=>uy,ZodVoid:()=>dy,ZodXID:()=>Hf,ZodXor:()=>py,_ZodString:()=>Uf,_default:()=>zy,_function:()=>nI,any:()=>Zz,array:()=>ie,base64:()=>xz,base64url:()=>Sz,bigint:()=>jz,boolean:()=>Ze,catch:()=>Ny,check:()=>iI,cidrv4:()=>$z,cidrv6:()=>bz,codec:()=>eI,cuid:()=>fz,cuid2:()=>pz,custom:()=>up,date:()=>Lz,describe:()=>oI,discriminatedUnion:()=>Wa,e164:()=>wz,email:()=>rz,emoji:()=>lz,enum:()=>Qe,exactOptional:()=>wy,file:()=>Kz,float32:()=>Pz,float64:()=>Oz,function:()=>nI,guid:()=>nz,hash:()=>Tz,hex:()=>Iz,hostname:()=>zz,httpUrl:()=>uz,instanceof:()=>aI,int:()=>Df,int32:()=>Rz,int64:()=>Az,intersection:()=>Po,ipv4:()=>_z,ipv6:()=>yz,json:()=>uI,jwt:()=>kz,keyof:()=>qz,ksuid:()=>gz,lazy:()=>Zy,literal:()=>D,looseObject:()=>Xe,looseRecord:()=>Bz,mac:()=>vz,map:()=>Wz,meta:()=>sI,nan:()=>Qz,nanoid:()=>dz,nativeEnum:()=>Jz,never:()=>rp,nonoptional:()=>Py,null:()=>To,nullable:()=>Ua,nullish:()=>Yz,number:()=>ge,object:()=>N,optional:()=>Oe,partialRecord:()=>Hz,pipe:()=>Za,prefault:()=>Ty,preprocess:()=>Ka,promise:()=>rI,readonly:()=>Cy,record:()=>Ie,refine:()=>qy,set:()=>Gz,strictObject:()=>Fz,string:()=>_,stringFormat:()=>Ez,stringbool:()=>cI,success:()=>Xz,superRefine:()=>Fy,symbol:()=>Dz,templateLiteral:()=>tI,transform:()=>ip,tuple:()=>_y,uint32:()=>Nz,uint64:()=>Cz,ulid:()=>mz,undefined:()=>Uz,union:()=>$e,unknown:()=>ke,url:()=>cz,uuid:()=>iz,uuidv4:()=>oz,uuidv6:()=>sz,uuidv7:()=>az,void:()=>Mz,xid:()=>hz,xor:()=>Vz});var Ca={};Ri(Ca,{endsWith:()=>yo,gt:()=>_r,gte:()=>ut,includes:()=>_o,length:()=>Jn,lowercase:()=>ho,lt:()=>gr,lte:()=>St,maxLength:()=>Gn,maxSize:()=>un,mime:()=>$o,minLength:()=>Mr,minSize:()=>vr,multipleOf:()=>cn,negative:()=>hf,nonnegative:()=>_f,nonpositive:()=>gf,normalize:()=>bo,overwrite:()=>rr,positive:()=>mf,property:()=>vf,regex:()=>mo,size:()=>Wn,slugify:()=>Oa,startsWith:()=>vo,toLowerCase:()=>So,toUpperCase:()=>wo,trim:()=>xo,uppercase:()=>go});var ln={};Ri(ln,{ZodISODate:()=>Of,ZodISODateTime:()=>Tf,ZodISODuration:()=>Af,ZodISOTime:()=>Nf,date:()=>Rf,datetime:()=>Pf,duration:()=>Cf,time:()=>jf});var Tf=g("ZodISODateTime",(t,e)=>{ql.init(t,e),we.init(t,e)});function Pf(t){return Vd(Tf,t)}var Of=g("ZodISODate",(t,e)=>{Fl.init(t,e),we.init(t,e)});function Rf(t){return Hd(Of,t)}var Nf=g("ZodISOTime",(t,e)=>{Vl.init(t,e),we.init(t,e)});function jf(t){return Bd(Nf,t)}var Af=g("ZodISODuration",(t,e)=>{Hl.init(t,e),we.init(t,e)});function Cf(t){return Wd(Af,t)}var Hv=(t,e)=>{Ks.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Xs(t,r)},flatten:{value:r=>Ys(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Fn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Fn,2)}},isEmpty:{get(){return t.issues.length===0}}})},y2=g("ZodError",Hv),wt=g("ZodError",Hv,{Parent:Error});var Bv=Xi(wt),Wv=eo(wt),Gv=ro(wt),Jv=no(wt),Kv=s_(wt),Yv=a_(wt),Xv=c_(wt),Qv=u_(wt),ey=l_(wt),ty=d_(wt),ry=f_(wt),ny=p_(wt);var Y=g("ZodType",(t,e)=>(W.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ko(t,"input"),output:ko(t,"output")}}),t.toJSONSchema=nv(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(k.mergeDefs(e,{checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),t.with=t.check,t.clone=(r,n)=>at(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>Bv(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Gv(t,r,n),t.parseAsync=async(r,n)=>Wv(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Jv(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>Kv(t,r,n),t.decode=(r,n)=>Yv(t,r,n),t.encodeAsync=async(r,n)=>Xv(t,r,n),t.decodeAsync=async(r,n)=>Qv(t,r,n),t.safeEncode=(r,n)=>ey(t,r,n),t.safeDecode=(r,n)=>ty(t,r,n),t.safeEncodeAsync=async(r,n)=>ry(t,r,n),t.safeDecodeAsync=async(r,n)=>ny(t,r,n),t.refine=(r,n)=>t.check(qy(r,n)),t.superRefine=r=>t.check(Fy(r)),t.overwrite=r=>t.check(rr(r)),t.optional=()=>Oe(t),t.exactOptional=()=>wy(t),t.nullable=()=>Ua(t),t.nullish=()=>Oe(Ua(t)),t.nonoptional=r=>Py(t,r),t.array=()=>ie(t),t.or=r=>$e([t,r]),t.and=r=>Po(t,r),t.transform=r=>Za(t,ip(r)),t.default=r=>zy(t,r),t.prefault=r=>Ty(t,r),t.catch=r=>Ny(t,r),t.pipe=r=>Za(t,r),t.readonly=()=>Cy(t),t.describe=r=>{let n=t.clone();return ct.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return ct.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return ct.get(t);let n=t.clone();return ct.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),Uf=g("_ZodString",(t,e)=>{an.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(n,i,o)=>iv(t,n,i,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(mo(...n)),t.includes=(...n)=>t.check(_o(...n)),t.startsWith=(...n)=>t.check(vo(...n)),t.endsWith=(...n)=>t.check(yo(...n)),t.min=(...n)=>t.check(Mr(...n)),t.max=(...n)=>t.check(Gn(...n)),t.length=(...n)=>t.check(Jn(...n)),t.nonempty=(...n)=>t.check(Mr(1,...n)),t.lowercase=n=>t.check(ho(n)),t.uppercase=n=>t.check(go(n)),t.trim=()=>t.check(xo()),t.normalize=(...n)=>t.check(bo(...n)),t.toLowerCase=()=>t.check(So()),t.toUpperCase=()=>t.check(wo()),t.slugify=()=>t.check(Oa())}),Ma=g("ZodString",(t,e)=>{an.init(t,e),Uf.init(t,e),t.email=r=>t.check(da(Zf,r)),t.url=r=>t.check(po(La,r)),t.jwt=r=>t.check(Pa(ep,r)),t.emoji=r=>t.check(ga(Mf,r)),t.guid=r=>t.check(fo(Da,r)),t.uuid=r=>t.check(fa(yr,r)),t.uuidv4=r=>t.check(pa(yr,r)),t.uuidv6=r=>t.check(ma(yr,r)),t.uuidv7=r=>t.check(ha(yr,r)),t.nanoid=r=>t.check(_a(Lf,r)),t.guid=r=>t.check(fo(Da,r)),t.cuid=r=>t.check(va(qf,r)),t.cuid2=r=>t.check(ya(Ff,r)),t.ulid=r=>t.check($a(Vf,r)),t.base64=r=>t.check(za(Yf,r)),t.base64url=r=>t.check(Ia(Xf,r)),t.xid=r=>t.check(ba(Hf,r)),t.ksuid=r=>t.check(xa(Bf,r)),t.ipv4=r=>t.check(Sa(Wf,r)),t.ipv6=r=>t.check(wa(Gf,r)),t.cidrv4=r=>t.check(ka(Jf,r)),t.cidrv6=r=>t.check(Ea(Kf,r)),t.e164=r=>t.check(Ta(Qf,r)),t.datetime=r=>t.check(Pf(r)),t.date=r=>t.check(Rf(r)),t.time=r=>t.check(jf(r)),t.duration=r=>t.check(Cf(r))});function _(t){return qd(Ma,t)}var we=g("ZodStringFormat",(t,e)=>{ye.init(t,e),Uf.init(t,e)}),Zf=g("ZodEmail",(t,e)=>{Nl.init(t,e),we.init(t,e)});function rz(t){return da(Zf,t)}var Da=g("ZodGUID",(t,e)=>{Ol.init(t,e),we.init(t,e)});function nz(t){return fo(Da,t)}var yr=g("ZodUUID",(t,e)=>{Rl.init(t,e),we.init(t,e)});function iz(t){return fa(yr,t)}function oz(t){return pa(yr,t)}function sz(t){return ma(yr,t)}function az(t){return ha(yr,t)}var La=g("ZodURL",(t,e)=>{jl.init(t,e),we.init(t,e)});function cz(t){return po(La,t)}function uz(t){return po(La,{protocol:/^https?$/,hostname:Ot.domain,...k.normalizeParams(t)})}var Mf=g("ZodEmoji",(t,e)=>{Al.init(t,e),we.init(t,e)});function lz(t){return ga(Mf,t)}var Lf=g("ZodNanoID",(t,e)=>{Cl.init(t,e),we.init(t,e)});function dz(t){return _a(Lf,t)}var qf=g("ZodCUID",(t,e)=>{Dl.init(t,e),we.init(t,e)});function fz(t){return va(qf,t)}var Ff=g("ZodCUID2",(t,e)=>{Ul.init(t,e),we.init(t,e)});function pz(t){return ya(Ff,t)}var Vf=g("ZodULID",(t,e)=>{Zl.init(t,e),we.init(t,e)});function mz(t){return $a(Vf,t)}var Hf=g("ZodXID",(t,e)=>{Ml.init(t,e),we.init(t,e)});function hz(t){return ba(Hf,t)}var Bf=g("ZodKSUID",(t,e)=>{Ll.init(t,e),we.init(t,e)});function gz(t){return xa(Bf,t)}var Wf=g("ZodIPv4",(t,e)=>{Bl.init(t,e),we.init(t,e)});function _z(t){return Sa(Wf,t)}var iy=g("ZodMAC",(t,e)=>{Gl.init(t,e),we.init(t,e)});function vz(t){return Fd(iy,t)}var Gf=g("ZodIPv6",(t,e)=>{Wl.init(t,e),we.init(t,e)});function yz(t){return wa(Gf,t)}var Jf=g("ZodCIDRv4",(t,e)=>{Jl.init(t,e),we.init(t,e)});function $z(t){return ka(Jf,t)}var Kf=g("ZodCIDRv6",(t,e)=>{Kl.init(t,e),we.init(t,e)});function bz(t){return Ea(Kf,t)}var Yf=g("ZodBase64",(t,e)=>{Yl.init(t,e),we.init(t,e)});function xz(t){return za(Yf,t)}var Xf=g("ZodBase64URL",(t,e)=>{Xl.init(t,e),we.init(t,e)});function Sz(t){return Ia(Xf,t)}var Qf=g("ZodE164",(t,e)=>{Ql.init(t,e),we.init(t,e)});function wz(t){return Ta(Qf,t)}var ep=g("ZodJWT",(t,e)=>{ed.init(t,e),we.init(t,e)});function kz(t){return Pa(ep,t)}var Io=g("ZodCustomStringFormat",(t,e)=>{td.init(t,e),we.init(t,e)});function Ez(t,e,r={}){return Kn(Io,t,e,r)}function zz(t){return Kn(Io,"hostname",Ot.hostname,t)}function Iz(t){return Kn(Io,"hex",Ot.hex,t)}function Tz(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Ot[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Kn(Io,n,i,e)}var qa=g("ZodNumber",(t,e)=>{aa.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(n,i,o)=>ov(t,n,i,o),t.gt=(n,i)=>t.check(_r(n,i)),t.gte=(n,i)=>t.check(ut(n,i)),t.min=(n,i)=>t.check(ut(n,i)),t.lt=(n,i)=>t.check(gr(n,i)),t.lte=(n,i)=>t.check(St(n,i)),t.max=(n,i)=>t.check(St(n,i)),t.int=n=>t.check(Df(n)),t.safe=n=>t.check(Df(n)),t.positive=n=>t.check(_r(0,n)),t.nonnegative=n=>t.check(ut(0,n)),t.negative=n=>t.check(gr(0,n)),t.nonpositive=n=>t.check(St(0,n)),t.multipleOf=(n,i)=>t.check(cn(n,i)),t.step=(n,i)=>t.check(cn(n,i)),t.finite=()=>t;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 ge(t){return Gd(qa,t)}var Xn=g("ZodNumberFormat",(t,e)=>{rd.init(t,e),qa.init(t,e)});function Df(t){return Jd(Xn,t)}function Pz(t){return Kd(Xn,t)}function Oz(t){return Yd(Xn,t)}function Rz(t){return Xd(Xn,t)}function Nz(t){return Qd(Xn,t)}var Fa=g("ZodBoolean",(t,e)=>{co.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sv(t,r,n,i)});function Ze(t){return ef(Fa,t)}var Va=g("ZodBigInt",(t,e)=>{ca.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(n,i,o)=>av(t,n,i,o),t.gte=(n,i)=>t.check(ut(n,i)),t.min=(n,i)=>t.check(ut(n,i)),t.gt=(n,i)=>t.check(_r(n,i)),t.gte=(n,i)=>t.check(ut(n,i)),t.min=(n,i)=>t.check(ut(n,i)),t.lt=(n,i)=>t.check(gr(n,i)),t.lte=(n,i)=>t.check(St(n,i)),t.max=(n,i)=>t.check(St(n,i)),t.positive=n=>t.check(_r(BigInt(0),n)),t.negative=n=>t.check(gr(BigInt(0),n)),t.nonpositive=n=>t.check(St(BigInt(0),n)),t.nonnegative=n=>t.check(ut(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(cn(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function jz(t){return tf(Va,t)}var tp=g("ZodBigIntFormat",(t,e)=>{nd.init(t,e),Va.init(t,e)});function Az(t){return rf(tp,t)}function Cz(t){return nf(tp,t)}var oy=g("ZodSymbol",(t,e)=>{id.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cv(t,r,n,i)});function Dz(t){return of(oy,t)}var sy=g("ZodUndefined",(t,e)=>{od.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lv(t,r,n,i)});function Uz(t){return sf(sy,t)}var ay=g("ZodNull",(t,e)=>{sd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uv(t,r,n,i)});function To(t){return af(ay,t)}var cy=g("ZodAny",(t,e)=>{ad.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pv(t,r,n,i)});function Zz(){return cf(cy)}var uy=g("ZodUnknown",(t,e)=>{cd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mv(t,r,n,i)});function ke(){return uf(uy)}var ly=g("ZodNever",(t,e)=>{ud.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fv(t,r,n,i)});function rp(t){return lf(ly,t)}var dy=g("ZodVoid",(t,e)=>{ld.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dv(t,r,n,i)});function Mz(t){return df(dy,t)}var np=g("ZodDate",(t,e)=>{dd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(n,i,o)=>hv(t,n,i,o),t.min=(n,i)=>t.check(ut(n,i)),t.max=(n,i)=>t.check(St(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Lz(t){return ff(np,t)}var fy=g("ZodArray",(t,e)=>{fd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zv(t,r,n,i),t.element=e.element,t.min=(r,n)=>t.check(Mr(r,n)),t.nonempty=r=>t.check(Mr(1,r)),t.max=(r,n)=>t.check(Gn(r,n)),t.length=(r,n)=>t.check(Jn(r,n)),t.unwrap=()=>t.element});function ie(t,e){return rv(fy,t,e)}function qz(t){let e=t._zod.def.shape;return Qe(Object.keys(e))}var Ha=g("ZodObject",(t,e)=>{ev.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Iv(t,r,n,i),k.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Qe(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ke()}),t.loose=()=>t.clone({...t._zod.def,catchall:ke()}),t.strict=()=>t.clone({...t._zod.def,catchall:rp()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>k.extend(t,r),t.safeExtend=r=>k.safeExtend(t,r),t.merge=r=>k.merge(t,r),t.pick=r=>k.pick(t,r),t.omit=r=>k.omit(t,r),t.partial=(...r)=>k.partial(op,t,r[0]),t.required=(...r)=>k.required(sp,t,r[0])});function N(t,e){let r={type:"object",shape:t??{},...k.normalizeParams(e)};return new Ha(r)}function Fz(t,e){return new Ha({type:"object",shape:t,catchall:rp(),...k.normalizeParams(e)})}function Xe(t,e){return new Ha({type:"object",shape:t,catchall:ke(),...k.normalizeParams(e)})}var Ba=g("ZodUnion",(t,e)=>{uo.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ef(t,r,n,i),t.options=e.options});function $e(t,e){return new Ba({type:"union",options:t,...k.normalizeParams(e)})}var py=g("ZodXor",(t,e)=>{Ba.init(t,e),pd.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ef(t,r,n,i),t.options=e.options});function Vz(t,e){return new py({type:"union",options:t,inclusive:!1,...k.normalizeParams(e)})}var my=g("ZodDiscriminatedUnion",(t,e)=>{Ba.init(t,e),md.init(t,e)});function Wa(t,e,r){return new my({type:"union",options:e,discriminator:t,...k.normalizeParams(r)})}var hy=g("ZodIntersection",(t,e)=>{hd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Tv(t,r,n,i)});function Po(t,e){return new hy({type:"intersection",left:t,right:e})}var gy=g("ZodTuple",(t,e)=>{ua.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Pv(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function _y(t,e,r){let n=e instanceof W,i=n?r:e,o=n?e:null;return new gy({type:"tuple",items:t,rest:o,...k.normalizeParams(i)})}var Ga=g("ZodRecord",(t,e)=>{gd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ov(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Ie(t,e,r){return new Ga({type:"record",keyType:t,valueType:e,...k.normalizeParams(r)})}function Hz(t,e,r){let n=at(t);return n._zod.values=void 0,new Ga({type:"record",keyType:n,valueType:e,...k.normalizeParams(r)})}function Bz(t,e,r){return new Ga({type:"record",keyType:t,valueType:e,mode:"loose",...k.normalizeParams(r)})}var vy=g("ZodMap",(t,e)=>{_d.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kv(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(vr(...r)),t.nonempty=r=>t.check(vr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(Wn(...r))});function Wz(t,e,r){return new vy({type:"map",keyType:t,valueType:e,...k.normalizeParams(r)})}var yy=g("ZodSet",(t,e)=>{vd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ev(t,r,n,i),t.min=(...r)=>t.check(vr(...r)),t.nonempty=r=>t.check(vr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(Wn(...r))});function Gz(t,e){return new yy({type:"set",valueType:t,...k.normalizeParams(e)})}var zo=g("ZodEnum",(t,e)=>{yd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(n,i,o)=>gv(t,n,i,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new zo({...e,checks:[],...k.normalizeParams(i),entries:o})},t.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new zo({...e,checks:[],...k.normalizeParams(i),entries:o})}});function Qe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new zo({type:"enum",entries:r,...k.normalizeParams(e)})}function Jz(t,e){return new zo({type:"enum",entries:t,...k.normalizeParams(e)})}var $y=g("ZodLiteral",(t,e)=>{$d.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_v(t,r,n,i),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 D(t,e){return new $y({type:"literal",values:Array.isArray(t)?t:[t],...k.normalizeParams(e)})}var by=g("ZodFile",(t,e)=>{bd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$v(t,r,n,i),t.min=(r,n)=>t.check(vr(r,n)),t.max=(r,n)=>t.check(un(r,n)),t.mime=(r,n)=>t.check($o(Array.isArray(r)?r:[r],n))});function Kz(t){return yf(by,t)}var xy=g("ZodTransform",(t,e)=>{xd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wv(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new nn(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(k.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(k.issue(s))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r)):(r.value=i,r)}});function ip(t){return new xy({type:"transform",transform:t})}var op=g("ZodOptional",(t,e)=>{la.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zf(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Oe(t){return new op({type:"optional",innerType:t})}var Sy=g("ZodExactOptional",(t,e)=>{Sd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zf(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function wy(t){return new Sy({type:"optional",innerType:t})}var ky=g("ZodNullable",(t,e)=>{wd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Rv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Ua(t){return new ky({type:"nullable",innerType:t})}function Yz(t){return Oe(Ua(t))}var Ey=g("ZodDefault",(t,e)=>{kd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function zy(t,e){return new Ey({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():k.shallowClone(e)}})}var Iy=g("ZodPrefault",(t,e)=>{Ed.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Av(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Ty(t,e){return new Iy({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():k.shallowClone(e)}})}var sp=g("ZodNonOptional",(t,e)=>{zd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Nv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Py(t,e){return new sp({type:"nonoptional",innerType:t,...k.normalizeParams(e)})}var Oy=g("ZodSuccess",(t,e)=>{Id.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Xz(t){return new Oy({type:"success",innerType:t})}var Ry=g("ZodCatch",(t,e)=>{Td.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Cv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Ny(t,e){return new Ry({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var jy=g("ZodNaN",(t,e)=>{Pd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vv(t,r,n,i)});function Qz(t){return pf(jy,t)}var ap=g("ZodPipe",(t,e)=>{Od.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Dv(t,r,n,i),t.in=e.in,t.out=e.out});function Za(t,e){return new ap({type:"pipe",in:t,out:e})}var cp=g("ZodCodec",(t,e)=>{ap.init(t,e),lo.init(t,e)});function eI(t,e,r){return new cp({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var Ay=g("ZodReadonly",(t,e)=>{Rd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Uv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Cy(t){return new Ay({type:"readonly",innerType:t})}var Dy=g("ZodTemplateLiteral",(t,e)=>{Nd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yv(t,r,n,i)});function tI(t,e){return new Dy({type:"template_literal",parts:t,...k.normalizeParams(e)})}var Uy=g("ZodLazy",(t,e)=>{Cd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Mv(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function Zy(t){return new Uy({type:"lazy",getter:t})}var My=g("ZodPromise",(t,e)=>{Ad.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Zv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function rI(t){return new My({type:"promise",innerType:t})}var Ly=g("ZodFunction",(t,e)=>{jd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Sv(t,r,n,i)});function nI(t){return new Ly({type:"function",input:Array.isArray(t?.input)?_y(t?.input):t?.input??ie(ke()),output:t?.output??ke()})}var Ja=g("ZodCustom",(t,e)=>{Dd.init(t,e),Y.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xv(t,r,n,i)});function iI(t){let e=new Se({check:"custom"});return e._zod.check=t,e}function up(t,e){return $f(Ja,t??(()=>!0),e)}function qy(t,e={}){return bf(Ja,t,e)}function Fy(t){return xf(t)}var oI=Sf,sI=wf;function aI(t,e={}){let r=new Ja({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...k.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var cI=(...t)=>kf({Codec:cp,Boolean:Fa,String:Ma},...t);function uI(t){let e=Zy(()=>$e([_(t),ge(),Ze(),To(),ie(e),Ie(_(),e)]));return e}function Ka(t,e){return Za(ip(t),e)}var Vy;Vy||(Vy={});var z2={...Eo,...Ca,iso:ln};Le(Ud());var dp="2025-11-25";var Hy=[dp,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],qr="io.modelcontextprotocol/related-task",Xa="2.0",He=up(t=>t!==null&&(typeof t=="object"||typeof t=="function")),By=$e([_(),ge().int()]),Wy=_(),B2=Xe({ttl:$e([ge(),To()]).optional(),pollInterval:ge().optional()}),pI=N({ttl:ge().optional()}),mI=N({taskId:_()}),fp=Xe({progressToken:By.optional(),[qr]:mI.optional()}),kt=N({_meta:fp.optional()}),Oo=kt.extend({task:pI.optional()}),Gy=t=>Oo.safeParse(t).success,Be=N({method:_(),params:kt.loose().optional()}),Rt=N({_meta:fp.optional()}),Nt=N({method:_(),params:Rt.loose().optional()}),We=Xe({_meta:fp.optional()}),Qa=$e([_(),ge().int()]),Jy=N({jsonrpc:D(Xa),id:Qa,...Be.shape}).strict(),pp=t=>Jy.safeParse(t).success,Ky=N({jsonrpc:D(Xa),...Nt.shape}).strict(),Yy=t=>Ky.safeParse(t).success,mp=N({jsonrpc:D(Xa),id:Qa,result:We}).strict(),Ro=t=>mp.safeParse(t).success;var ue;(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"})(ue||(ue={}));var hp=N({jsonrpc:D(Xa),id:Qa.optional(),error:N({code:ge().int(),message:_(),data:ke().optional()})}).strict();var Xy=t=>hp.safeParse(t).success;var Qy=$e([Jy,Ky,mp,hp]),W2=$e([mp,hp]),ec=We.strict(),hI=Rt.extend({requestId:Qa.optional(),reason:_().optional()}),tc=Nt.extend({method:D("notifications/cancelled"),params:hI}),gI=N({src:_(),mimeType:_().optional(),sizes:ie(_()).optional(),theme:Qe(["light","dark"]).optional()}),No=N({icons:ie(gI).optional()}),Qn=N({name:_(),title:_().optional()}),e$=Qn.extend({...Qn.shape,...No.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),_I=Po(N({applyDefaults:Ze().optional()}),Ie(_(),ke())),vI=Ka(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Po(N({form:_I.optional(),url:He.optional()}),Ie(_(),ke()).optional())),yI=Xe({list:He.optional(),cancel:He.optional(),requests:Xe({sampling:Xe({createMessage:He.optional()}).optional(),elicitation:Xe({create:He.optional()}).optional()}).optional()}),$I=Xe({list:He.optional(),cancel:He.optional(),requests:Xe({tools:Xe({call:He.optional()}).optional()}).optional()}),bI=N({experimental:Ie(_(),He).optional(),sampling:N({context:He.optional(),tools:He.optional()}).optional(),elicitation:vI.optional(),roots:N({listChanged:Ze().optional()}).optional(),tasks:yI.optional()}),xI=kt.extend({protocolVersion:_(),capabilities:bI,clientInfo:e$}),gp=Be.extend({method:D("initialize"),params:xI});var SI=N({experimental:Ie(_(),He).optional(),logging:He.optional(),completions:He.optional(),prompts:N({listChanged:Ze().optional()}).optional(),resources:N({subscribe:Ze().optional(),listChanged:Ze().optional()}).optional(),tools:N({listChanged:Ze().optional()}).optional(),tasks:$I.optional()}),wI=We.extend({protocolVersion:_(),capabilities:SI,serverInfo:e$,instructions:_().optional()}),_p=Nt.extend({method:D("notifications/initialized"),params:Rt.optional()});var rc=Be.extend({method:D("ping"),params:kt.optional()}),kI=N({progress:ge(),total:Oe(ge()),message:Oe(_())}),EI=N({...Rt.shape,...kI.shape,progressToken:By}),nc=Nt.extend({method:D("notifications/progress"),params:EI}),zI=kt.extend({cursor:Wy.optional()}),jo=Be.extend({params:zI.optional()}),Ao=We.extend({nextCursor:Wy.optional()}),II=Qe(["working","input_required","completed","failed","cancelled"]),Co=N({taskId:_(),status:II,ttl:$e([ge(),To()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:Oe(ge()),statusMessage:Oe(_())}),ei=We.extend({task:Co}),TI=Rt.merge(Co),Do=Nt.extend({method:D("notifications/tasks/status"),params:TI}),ic=Be.extend({method:D("tasks/get"),params:kt.extend({taskId:_()})}),oc=We.merge(Co),sc=Be.extend({method:D("tasks/result"),params:kt.extend({taskId:_()})}),G2=We.loose(),ac=jo.extend({method:D("tasks/list")}),cc=Ao.extend({tasks:ie(Co)}),uc=Be.extend({method:D("tasks/cancel"),params:kt.extend({taskId:_()})}),t$=We.merge(Co),r$=N({uri:_(),mimeType:Oe(_()),_meta:Ie(_(),ke()).optional()}),n$=r$.extend({text:_()}),vp=_().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),i$=r$.extend({blob:vp}),Uo=Qe(["user","assistant"]),ti=N({audience:ie(Uo).optional(),priority:ge().min(0).max(1).optional(),lastModified:ln.datetime({offset:!0}).optional()}),o$=N({...Qn.shape,...No.shape,uri:_(),description:Oe(_()),mimeType:Oe(_()),annotations:ti.optional(),_meta:Oe(Xe({}))}),PI=N({...Qn.shape,...No.shape,uriTemplate:_(),description:Oe(_()),mimeType:Oe(_()),annotations:ti.optional(),_meta:Oe(Xe({}))}),yp=jo.extend({method:D("resources/list")}),OI=Ao.extend({resources:ie(o$)}),RI=jo.extend({method:D("resources/templates/list")}),NI=Ao.extend({resourceTemplates:ie(PI)}),$p=kt.extend({uri:_()}),jI=$p,bp=Be.extend({method:D("resources/read"),params:jI}),AI=We.extend({contents:ie($e([n$,i$]))}),CI=Nt.extend({method:D("notifications/resources/list_changed"),params:Rt.optional()}),DI=$p,UI=Be.extend({method:D("resources/subscribe"),params:DI}),ZI=$p,MI=Be.extend({method:D("resources/unsubscribe"),params:ZI}),LI=Rt.extend({uri:_()}),qI=Nt.extend({method:D("notifications/resources/updated"),params:LI}),FI=N({name:_(),description:Oe(_()),required:Oe(Ze())}),VI=N({...Qn.shape,...No.shape,description:Oe(_()),arguments:Oe(ie(FI)),_meta:Oe(Xe({}))}),HI=jo.extend({method:D("prompts/list")}),BI=Ao.extend({prompts:ie(VI)}),WI=kt.extend({name:_(),arguments:Ie(_(),_()).optional()}),GI=Be.extend({method:D("prompts/get"),params:WI}),xp=N({type:D("text"),text:_(),annotations:ti.optional(),_meta:Ie(_(),ke()).optional()}),Sp=N({type:D("image"),data:vp,mimeType:_(),annotations:ti.optional(),_meta:Ie(_(),ke()).optional()}),wp=N({type:D("audio"),data:vp,mimeType:_(),annotations:ti.optional(),_meta:Ie(_(),ke()).optional()}),JI=N({type:D("tool_use"),name:_(),id:_(),input:Ie(_(),ke()),_meta:Ie(_(),ke()).optional()}),KI=N({type:D("resource"),resource:$e([n$,i$]),annotations:ti.optional(),_meta:Ie(_(),ke()).optional()}),YI=o$.extend({type:D("resource_link")}),kp=$e([xp,Sp,wp,YI,KI]),XI=N({role:Uo,content:kp}),QI=We.extend({description:_().optional(),messages:ie(XI)}),eT=Nt.extend({method:D("notifications/prompts/list_changed"),params:Rt.optional()}),tT=N({title:_().optional(),readOnlyHint:Ze().optional(),destructiveHint:Ze().optional(),idempotentHint:Ze().optional(),openWorldHint:Ze().optional()}),rT=N({taskSupport:Qe(["required","optional","forbidden"]).optional()}),s$=N({...Qn.shape,...No.shape,description:_().optional(),inputSchema:N({type:D("object"),properties:Ie(_(),He).optional(),required:ie(_()).optional()}).catchall(ke()),outputSchema:N({type:D("object"),properties:Ie(_(),He).optional(),required:ie(_()).optional()}).catchall(ke()).optional(),annotations:tT.optional(),execution:rT.optional(),_meta:Ie(_(),ke()).optional()}),Ep=jo.extend({method:D("tools/list")}),nT=Ao.extend({tools:ie(s$)}),lc=We.extend({content:ie(kp).default([]),structuredContent:Ie(_(),ke()).optional(),isError:Ze().optional()}),J2=lc.or(We.extend({toolResult:ke()})),iT=Oo.extend({name:_(),arguments:Ie(_(),ke()).optional()}),Zo=Be.extend({method:D("tools/call"),params:iT}),oT=Nt.extend({method:D("notifications/tools/list_changed"),params:Rt.optional()}),K2=N({autoRefresh:Ze().default(!0),debounceMs:ge().int().nonnegative().default(300)}),Mo=Qe(["debug","info","notice","warning","error","critical","alert","emergency"]),sT=kt.extend({level:Mo}),zp=Be.extend({method:D("logging/setLevel"),params:sT}),aT=Rt.extend({level:Mo,logger:_().optional(),data:ke()}),cT=Nt.extend({method:D("notifications/message"),params:aT}),uT=N({name:_().optional()}),lT=N({hints:ie(uT).optional(),costPriority:ge().min(0).max(1).optional(),speedPriority:ge().min(0).max(1).optional(),intelligencePriority:ge().min(0).max(1).optional()}),dT=N({mode:Qe(["auto","required","none"]).optional()}),fT=N({type:D("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:ie(kp).default([]),structuredContent:N({}).loose().optional(),isError:Ze().optional(),_meta:Ie(_(),ke()).optional()}),pT=Wa("type",[xp,Sp,wp]),Ya=Wa("type",[xp,Sp,wp,JI,fT]),mT=N({role:Uo,content:$e([Ya,ie(Ya)]),_meta:Ie(_(),ke()).optional()}),hT=Oo.extend({messages:ie(mT),modelPreferences:lT.optional(),systemPrompt:_().optional(),includeContext:Qe(["none","thisServer","allServers"]).optional(),temperature:ge().optional(),maxTokens:ge().int(),stopSequences:ie(_()).optional(),metadata:He.optional(),tools:ie(s$).optional(),toolChoice:dT.optional()}),gT=Be.extend({method:D("sampling/createMessage"),params:hT}),Lo=We.extend({model:_(),stopReason:Oe(Qe(["endTurn","stopSequence","maxTokens"]).or(_())),role:Uo,content:pT}),Ip=We.extend({model:_(),stopReason:Oe(Qe(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Uo,content:$e([Ya,ie(Ya)])}),_T=N({type:D("boolean"),title:_().optional(),description:_().optional(),default:Ze().optional()}),vT=N({type:D("string"),title:_().optional(),description:_().optional(),minLength:ge().optional(),maxLength:ge().optional(),format:Qe(["email","uri","date","date-time"]).optional(),default:_().optional()}),yT=N({type:Qe(["number","integer"]),title:_().optional(),description:_().optional(),minimum:ge().optional(),maximum:ge().optional(),default:ge().optional()}),$T=N({type:D("string"),title:_().optional(),description:_().optional(),enum:ie(_()),default:_().optional()}),bT=N({type:D("string"),title:_().optional(),description:_().optional(),oneOf:ie(N({const:_(),title:_()})),default:_().optional()}),xT=N({type:D("string"),title:_().optional(),description:_().optional(),enum:ie(_()),enumNames:ie(_()).optional(),default:_().optional()}),ST=$e([$T,bT]),wT=N({type:D("array"),title:_().optional(),description:_().optional(),minItems:ge().optional(),maxItems:ge().optional(),items:N({type:D("string"),enum:ie(_())}),default:ie(_()).optional()}),kT=N({type:D("array"),title:_().optional(),description:_().optional(),minItems:ge().optional(),maxItems:ge().optional(),items:N({anyOf:ie(N({const:_(),title:_()}))}),default:ie(_()).optional()}),ET=$e([wT,kT]),zT=$e([xT,ST,ET]),IT=$e([zT,_T,vT,yT]),TT=Oo.extend({mode:D("form").optional(),message:_(),requestedSchema:N({type:D("object"),properties:Ie(_(),IT),required:ie(_()).optional()})}),PT=Oo.extend({mode:D("url"),message:_(),elicitationId:_(),url:_().url()}),OT=$e([TT,PT]),RT=Be.extend({method:D("elicitation/create"),params:OT}),NT=Rt.extend({elicitationId:_()}),jT=Nt.extend({method:D("notifications/elicitation/complete"),params:NT}),ri=We.extend({action:Qe(["accept","decline","cancel"]),content:Ka(t=>t===null?void 0:t,Ie(_(),$e([_(),ge(),Ze(),ie(_())])).optional())}),AT=N({type:D("ref/resource"),uri:_()});var CT=N({type:D("ref/prompt"),name:_()}),DT=kt.extend({ref:$e([CT,AT]),argument:N({name:_(),value:_()}),context:N({arguments:Ie(_(),_()).optional()}).optional()}),UT=Be.extend({method:D("completion/complete"),params:DT});var ZT=We.extend({completion:Xe({values:ie(_()).max(100),total:Oe(ge().int()),hasMore:Oe(Ze())})}),MT=N({uri:_().startsWith("file://"),name:_().optional(),_meta:Ie(_(),ke()).optional()}),LT=Be.extend({method:D("roots/list"),params:kt.optional()}),Tp=We.extend({roots:ie(MT)}),qT=Nt.extend({method:D("notifications/roots/list_changed"),params:Rt.optional()}),Y2=$e([rc,gp,UT,zp,GI,HI,yp,RI,bp,UI,MI,Zo,Ep,ic,sc,ac,uc]),X2=$e([tc,nc,_p,qT,Do]),Q2=$e([ec,Lo,Ip,ri,Tp,oc,cc,ei]),eq=$e([rc,gT,RT,LT,ic,sc,ac,uc]),tq=$e([tc,nc,cT,qI,CI,oT,eT,Do,jT]),rq=$e([ec,wI,ZT,QI,BI,OI,NI,AI,lc,nT,oc,cc,ei]),X=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ue.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new lp(i.elicitations,r)}return new t(e,r,n)}},lp=class extends X{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ue.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function Fr(t){return t==="completed"||t==="failed"||t==="cancelled"}var Cq=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Pp(t){let r=Aa(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Vv(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Op(t,e){let r=Lr(t,e);if(!r.success)throw r.error;return r.data}var GT=6e4,dc=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(tc,r=>{this._oncancel(r)}),this.setNotificationHandler(nc,r=>{this._onprogress(r)}),this.setRequestHandler(rc,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ic,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new X(ue.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(sc,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,f=new X(d.error.code,d.error.message,d.error.data);l(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new X(ue.InvalidParams,`Task not found: ${o}`);if(!Fr(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Fr(s.status)){let a=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[qr]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(ac,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new X(ue.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(uc,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new X(ue.InvalidParams,`Task not found: ${r.params.taskId}`);if(Fr(i.status))throw new X(ue.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new X(ue.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof X?i:new X(ue.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),X.fromError(ue.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});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 n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{i?.(o,s),Ro(o)||Xy(o)?this._onresponse(o):pp(o)?this._onrequest(o,s):Yy(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=X.fromError(ue.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(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(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,o=e.params?._meta?.[qr]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:ue.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=Gy(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,u={signal:s.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(s.signal.aborted)throw new X(ue.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let m=p.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(s.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async l=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:ue.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ro(e))n(e);else{let s=new X(e.error.code,e.error.message,e.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===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 o=!1;if(Ro(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),Ro(e))i(e);else{let s=X.fromError(e.error.code,e.error.message,e.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(s){yield{type:"error",error:s instanceof X?s:new X(ue.InternalError,String(s))}}return}let o;try{let s=await this.request(e,ei,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new X(ue.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:a},Fr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:a.status==="failed"?yield{type:"error",error:new X(ue.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new X(ue.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof X?s:new X(ue.InternalError,String(s))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=O=>{l(O)};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(O){d(O);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[qr]:c}});let m=O=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(O)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`)));let E=O instanceof X?O:new X(ue.RequestTimeout,String(O));l(E)};this._responseHandlers.set(f,O=>{if(!n?.signal?.aborted){if(O instanceof Error)return l(O);try{let E=Lr(r,O.result);E.success?u(E.data):l(E.error)}catch(E){l(E)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??GT,v=()=>m(X.fromError(ue.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,v,n?.resetTimeoutOnProgress??!1);let S=c?.taskId;if(S){let O=E=>{let A=this._responseHandlers.get(f);A?A(E):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,O),this._enqueueTaskMessage(S,{type:"request",message:p,timestamp:Date.now()}).catch(E=>{this._cleanupTimeout(f),l(E)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(O=>{this._cleanupTimeout(f),l(O)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},oc,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},cc,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},t$,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[qr]:r.relatedTask}}};await this._enqueueTaskMessage(n,{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||{},[qr]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[qr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let n=Pp(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let s=Op(e,i);return Promise.resolve(r(s,o))})}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 n=Pp(e);this._notificationHandlers.set(n,i=>{let o=Op(e,i);return Promise.resolve(r(o))})}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,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&pp(i.message)){let o=i.message.id,s=this._requestResolvers.get(o);s?(s(new X(ue.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new X(ue.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),o(new X(ue.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new X(ue.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,s)=>{await n.storeTaskResult(i,o,s,r);let a=await n.getTask(i,r);if(a){let c=Do.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Fr(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,s)=>{let a=await n.getTask(i,r);if(!a)throw new X(ue.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Fr(a.status))throw new X(ue.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,s,r);let c=await n.getTask(i,r);if(c){let u=Do.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Fr(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function a$(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function c$(t,e){let r={...t};for(let n in e){let i=n,o=e[i];if(o===void 0)continue;let s=r[i];a$(s)&&a$(o)?r[i]={...s,...o}:r[i]=o}return r}var Gx=Rr(gh(),1),Jx=Rr(Wx(),1);function Zj(){let t=new Gx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Jx.default)(t),t}var Wc=class{constructor(e){this._ajv=e??Zj()}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 n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Gc=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],s=o.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(s){if(o.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(l.size!==d.size||![...l].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Lo,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},ri,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}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 Kx(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 Yx(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 Jc=class extends dc{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Mo.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Wc,this.setRequestHandler(gp,n=>this._oninitialize(n)),this.setNotificationHandler(_p,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(zp,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Mo.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Gc(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=c$(this._capabilities,e)}setRequestHandler(e,r){let i=Aa(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(Yn(i)){let a=i;o=a._zod?.def?.value??a.value}else{let a=i;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,u)=>{let l=Lr(Zo,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new X(ue.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,f=await Promise.resolve(r(c,u));if(d.task){let m=Lr(ei,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new X(ue.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Lr(lc,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new X(ue.InvalidParams,`Invalid tools/call result: ${m}`)}return p.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){Yx(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Kx(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:Hy.includes(r)?r:dp,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"},ec)}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 n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(u=>u.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(u=>u.type==="tool_use");if(o){if(i.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(i.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},Ip,r):this.request({method:"sampling/createMessage",params:e},Lo,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 i=e;return this.request({method:"elicitation/create",params:i},ri,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:i},ri,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!a.valid)throw new X(ue.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof X?s:new X(ue.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}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},Tp,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 Qx from"node:process";var Kc=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
55
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Mj(r)}clear(){this._buffer=void 0}};function Mj(t){return Qy.parse(JSON.parse(t))}function Xx(t){return JSON.stringify(t)+`
56
+ `}var Yc=class{constructor(e=Qx.stdin,r=Qx.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Kc,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let 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 n=Xx(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var Xc=class{logs=[];config;constructor(e={}){this.config={maxEntries:e.maxEntries??1e3,retentionMinutes:e.retentionMinutes??60},setInterval(()=>this.cleanup(),6e4)}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}add(e){let r={...e,id:this.generateId(),timestamp:new Date};return this.logs.push(r),this.logs.length>this.config.maxEntries&&(this.logs=this.logs.slice(-this.config.maxEntries)),r}getAll(){return[...this.logs]}getBySource(e){return this.logs.filter(r=>r.source===e)}getByLevel(e){return this.logs.filter(r=>r.level===e)}getErrors(){return this.logs.filter(e=>e.level==="error")}getRecent(e=10){let r=new Date(Date.now()-e*60*1e3);return this.logs.filter(n=>n.timestamp>=r)}getRecentErrors(e=10){return this.getRecent(e).filter(r=>r.level==="error")}search(e){let r=e.toLowerCase();return this.logs.filter(n=>n.message.toLowerCase().includes(r)||n.stack?.toLowerCase().includes(r))}getSummary(){let e={},r={};for(let n of this.logs)e[n.source]=(e[n.source]||0)+1,r[n.level]=(r[n.level]||0)+1;return{total:this.logs.length,bySource:e,byLevel:r,recentErrors:this.getRecentErrors(5).length}}clear(){this.logs=[]}clearBySource(e){this.logs=this.logs.filter(r=>r.source!==e)}cleanup(){let e=new Date(Date.now()-this.config.retentionMinutes*60*1e3);this.logs=this.logs.filter(r=>r.timestamp>=e)}formatForDisplay(e){return e.length===0?"No logs found.":e.map(r=>{let n=r.timestamp.toISOString().substring(11,19),i=r.level==="error"?"[ERROR]":r.level==="warn"?"[WARN]":r.level==="info"?"[INFO]":"[LOG]",o=`[${n}] ${i} [${r.source}] ${r.message}`;return r.url&&(o+=`
57
+ URL: ${r.url}`,r.line&&(o+=`:${r.line}`,r.column&&(o+=`:${r.column}`))),r.stack&&(o+=`
58
+ Stack: ${r.stack.split(`
59
+ `).slice(0,3).join(`
60
+ `)}`),o}).join(`
61
+
62
+ `)}};var Xw=Rr(Kw(),1);import*as Ts from"fs";import*as Yw from"path";var yu=class{watchers=[];filePositions=new Map;logStore;constructor(e){this.logStore=e}watch(e){console.error(`[FileWatcher] Starting to watch: ${e}`);let r=Xw.default.watch(e,{persistent:!0,ignoreInitial:!1,followSymlinks:!0});r.on("add",n=>this.handleNewFile(n)),r.on("change",n=>this.handleFileChange(n)),r.on("error",n=>console.error("[FileWatcher] Error:",n)),this.watchers.push(r)}handleNewFile(e){console.error(`[FileWatcher] New file detected: ${e}`);try{let r=Ts.statSync(e);this.filePositions.set(e,r.size)}catch{this.filePositions.set(e,0)}}handleFileChange(e){let r=this.filePositions.get(e)||0;try{let i=Ts.statSync(e).size;if(i<r){this.filePositions.set(e,0);return}if(i>r){let o=Ts.createReadStream(e,{start:r,end:i-1,encoding:"utf8"}),s="";o.on("data",a=>{s+=a}),o.on("end",()=>{this.processNewContent(e,s),this.filePositions.set(e,i)})}}catch(n){console.error(`[FileWatcher] Error reading file ${e}:`,n)}}processNewContent(e,r){let n=r.split(`
63
+ `).filter(o=>o.trim()),i=Yw.basename(e);for(let o of n){let s=this.parseLine(o);s&&this.logStore.add({source:"file",level:s.level,message:s.message,stack:s.stack,metadata:{file:i,fullPath:e}})}}parseLine(e){if(!e.trim())return null;let r=[{regex:/\[(ERROR|error)\]\s*(.+)/i,level:"error"},{regex:/\[(WARN|warn|WARNING|warning)\]\s*(.+)/i,level:"warn"},{regex:/\[(INFO|info)\]\s*(.+)/i,level:"info"},{regex:/^Error:\s*(.+)/i,level:"error"},{regex:/^(\w+Error):\s*(.+)/i,level:"error"},{regex:/^npm ERR!\s*(.+)/i,level:"error"},{regex:/^×\s*(.+)/i,level:"error"},{regex:/UnhandledPromiseRejection.*:\s*(.+)/i,level:"error"},{regex:/(GET|POST|PUT|DELETE|PATCH)\s+\S+\s+(4\d{2}|5\d{2})/i,level:"error"},{regex:/^Warning:\s*(.+)/i,level:"warn"},{regex:/^⚠\s*(.+)/i,level:"warn"}];for(let{regex:n,level:i}of r){let o=e.match(n);if(o)return{level:i,message:o[2]||o[1]||e}}return e.trim().startsWith("at ")?null:/error/i.test(e)?{level:"error",message:e}:{level:"log",message:e}}async close(){for(let e of this.watchers)await e.close();this.watchers=[],this.filePositions.clear()}};var hU=Rr(Wk(),1),gU=Rr(Og(),1),_U=Rr(jg(),1),qg=Rr(Ou(),1),Fg=Rr(r0(),1);var Nu=class{wss=null;logStore;port;clients=new Set;constructor(e,r=9999){this.logStore=e,this.port=r}start(){this.wss=new Fg.default({port:this.port}),console.error(`[BrowserLogServer] WebSocket server started on port ${this.port}`),this.wss.on("connection",(e,r)=>{let n=r.socket.remoteAddress||"unknown";console.error(`[BrowserLogServer] Client connected: ${n}`),this.clients.add(e),e.on("message",i=>{try{let o=JSON.parse(i.toString());this.handleMessage(o)}catch(o){console.error("[BrowserLogServer] Failed to parse message:",o)}}),e.on("close",()=>{console.error(`[BrowserLogServer] Client disconnected: ${n}`),this.clients.delete(e)}),e.on("error",i=>{console.error("[BrowserLogServer] WebSocket error:",i),this.clients.delete(e)}),e.send(JSON.stringify({type:"connected",message:"MCP Log Watcher connected"}))}),this.wss.on("error",e=>{console.error("[BrowserLogServer] Server error:",e)})}handleMessage(e){switch(e.type){case"console":this.handleConsoleMessage(e.data);break;case"network":this.handleNetworkError(e.data);break;case"error":this.handleUncaughtError(e.data);break;default:console.error(`[BrowserLogServer] Unknown message type: ${e.type}`)}}handleConsoleMessage(e){let r=e.type==="error"?"error":e.type==="warn"?"warn":"log";this.logStore.add({source:"browser",level:r,message:e.message,stack:e.stack,url:e.url,line:e.line,column:e.column}),r==="error"&&console.error(`[Browser Error] ${e.message}`)}handleNetworkError(e){this.logStore.add({source:"browser",level:"error",message:`${e.method} ${e.url} - ${e.status} ${e.statusText}`,metadata:{type:"network",status:e.status,method:e.method}}),console.error(`[Network Error] ${e.method} ${e.url} - ${e.status}`)}handleUncaughtError(e){this.logStore.add({source:"browser",level:"error",message:e.message,stack:e.stack,url:e.url,line:e.line,column:e.column,metadata:{type:"uncaught"}}),console.error(`[Uncaught Error] ${e.message}`)}broadcast(e){let r=JSON.stringify(e);for(let n of this.clients)n.readyState===qg.default.OPEN&&n.send(r)}getClientCount(){return this.clients.size}stop(){this.wss&&(this.wss.close(),this.wss=null,this.clients.clear(),console.error("[BrowserLogServer] Server stopped"))}};var nt=new Xc({maxEntries:1e3,retentionMinutes:60}),ju=new yu(nt),Us=new Nu(nt,9999);Us.start();var vU=process.env.LOG_WATCH_PATHS?.split(",")||[];for(let t of vU)t.trim()&&ju.watch(t.trim());var Zs=new Jc({name:"mcp-log-watcher",version:"1.0.0"},{capabilities:{tools:{},resources:{}}});Zs.setRequestHandler(Ep,async()=>({tools:[{name:"get_errors",description:"Get recent errors from browser console and server logs. Use this to see what errors occurred recently.",inputSchema:{type:"object",properties:{minutes:{type:"number",description:"Get errors from the last N minutes (default: 10)"},source:{type:"string",enum:["browser","server","file","all"],description:"Filter by log source (default: all)"}}}},{name:"get_all_logs",description:"Get all collected logs including errors, warnings, and info messages.",inputSchema:{type:"object",properties:{level:{type:"string",enum:["error","warn","info","log","all"],description:"Filter by log level (default: all)"},minutes:{type:"number",description:"Get logs from the last N minutes (default: 10)"},limit:{type:"number",description:"Maximum number of logs to return (default: 50)"}}}},{name:"search_logs",description:"Search logs by keyword or pattern.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query string"}},required:["query"]}},{name:"get_log_summary",description:"Get a summary of collected logs including counts by source and level.",inputSchema:{type:"object",properties:{}}},{name:"clear_logs",description:"Clear all collected logs or logs from a specific source.",inputSchema:{type:"object",properties:{source:{type:"string",enum:["browser","server","file","all"],description:"Source to clear (default: all)"}}}},{name:"watch_file",description:"Start watching a new log file for errors.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Path to the log file to watch"}},required:["path"]}},{name:"get_status",description:"Get the status of the log watcher including WebSocket connections and watched files.",inputSchema:{type:"object",properties:{}}}]}));Zs.setRequestHandler(Zo,async t=>{let{name:e,arguments:r}=t.params;switch(e){case"get_errors":{let n=r?.minutes||10,i=r?.source,o=nt.getRecentErrors(n);if(i&&i!=="all"&&(o=o.filter(u=>u.source===i)),o.length===0)return{content:[{type:"text",text:`No errors found in the last ${n} minutes.`}]};let s=o.length;o=o.slice(-50);let a=nt.formatForDisplay(o),c=a.length>15e3?a.slice(0,15e3)+`
64
+
65
+ --- truncated (${a.length} chars total, showing first 15000) ---`:a;return{content:[{type:"text",text:`Found ${s} error(s) in the last ${n} minutes${s>50?" (showing last 50)":""}:
66
+
67
+ ${c}`}]}}case"get_all_logs":{let n=r?.minutes||10,i=r?.level,o=r?.limit||50,s=nt.getRecent(n);return i&&i!=="all"&&(s=s.filter(a=>a.level===i)),s=s.slice(-o),s.length===0?{content:[{type:"text",text:`No logs found in the last ${n} minutes.`}]}:{content:[{type:"text",text:`Found ${s.length} log(s):
68
+
69
+ ${nt.formatForDisplay(s)}`}]}}case"search_logs":{let n=r?.query;if(!n)return{content:[{type:"text",text:"Error: query is required"}],isError:!0};let i=nt.search(n);if(i.length===0)return{content:[{type:"text",text:`No logs found matching "${n}".`}]};let o=i.length;i=i.slice(-50);let s=nt.formatForDisplay(i),a=s.length>15e3?s.slice(0,15e3)+`
70
+
71
+ --- truncated (${s.length} chars total, showing first 15000) ---`:s;return{content:[{type:"text",text:`Found ${o} log(s) matching "${n}"${o>50?" (showing last 50)":""}:
72
+
73
+ ${a}`}]}}case"get_log_summary":{let n=nt.getSummary(),i=`Log Summary
74
+
75
+ `;i+=`Total logs: ${n.total}
76
+ `,i+=`Recent errors (5min): ${n.recentErrors}
77
+
78
+ `,i+=`By Source:
79
+ `;for(let[o,s]of Object.entries(n.bySource))i+=` - ${o}: ${s}
80
+ `;i+=`
81
+ By Level:
82
+ `;for(let[o,s]of Object.entries(n.byLevel))i+=` - ${o==="error"?"[ERROR]":o==="warn"?"[WARN]":o==="info"?"[INFO]":"[LOG]"} ${o}: ${s}
83
+ `;return i+=`
84
+ WebSocket clients: ${Us.getClientCount()}`,{content:[{type:"text",text:i}]}}case"clear_logs":{let n=r?.source;return n&&n!=="all"?(nt.clearBySource(n),{content:[{type:"text",text:`Cleared all ${n} logs.`}]}):(nt.clear(),{content:[{type:"text",text:"Cleared all logs."}]})}case"watch_file":{let n=r?.path;return n?(ju.watch(n),{content:[{type:"text",text:`Started watching: ${n}`}]}):{content:[{type:"text",text:"Error: path is required"}],isError:!0}}case"get_status":{let n=nt.getSummary(),i=`MCP Log Watcher Status
85
+
86
+ `;return i+=`WebSocket server: Running on port 9999
87
+ `,i+=`Connected browsers: ${Us.getClientCount()}
88
+ `,i+=`Total logs collected: ${n.total}
89
+ `,i+=`Recent errors (5min): ${n.recentErrors}
90
+ `,{content:[{type:"text",text:i}]}}default:return{content:[{type:"text",text:`Unknown tool: ${e}`}],isError:!0}}});Zs.setRequestHandler(yp,async()=>({resources:[{uri:"logs://recent-errors",mimeType:"text/plain",name:"Recent Errors",description:"Recent error logs from browser and server"},{uri:"logs://all",mimeType:"text/plain",name:"All Logs",description:"All collected logs"}]}));Zs.setRequestHandler(bp,async t=>{let{uri:e}=t.params;switch(e){case"logs://recent-errors":{let r=nt.getRecentErrors(10);return{contents:[{uri:e,mimeType:"text/plain",text:r.length>0?nt.formatForDisplay(r):"No recent errors."}]}}case"logs://all":{let r=nt.getAll();return{contents:[{uri:e,mimeType:"text/plain",text:r.length>0?nt.formatForDisplay(r):"No logs collected."}]}}default:throw new Error(`Unknown resource: ${e}`)}});process.on("SIGINT",async()=>{console.error(`
91
+ [MCP] Shutting down...`),Us.stop(),await ju.close(),process.exit(0)});process.on("SIGTERM",async()=>{console.error(`
92
+ [MCP] Shutting down...`),Us.stop(),await ju.close(),process.exit(0)});async function yU(){let t=new Yc;await Zs.connect(t),console.error("[MCP] Log Watcher server started"),console.error("[MCP] WebSocket server running on ws://localhost:9999")}yU().catch(t=>{console.error("[MCP] Fatal error:",t),process.exit(1)});