@fugood/bricks-cli 2.26.0-beta.0 → 2.26.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/lib/{3593.js → 1143.js} +1 -1
- package/lib/1215.js +1 -1
- package/lib/1708.js +6 -6
- package/lib/1826.js +2 -2
- package/lib/1936.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/2557.js +1 -1
- package/lib/3774.js +2 -2
- package/lib/3781.js +78 -0
- package/lib/3976.js +3 -3
- package/lib/{4642.js → 5188.js} +2 -2
- package/lib/6194.js +2 -2
- package/lib/6818.js +1 -1
- package/lib/6954.js +19 -0
- package/lib/7109.js +1 -0
- package/lib/7233.js +231 -231
- package/lib/7294.js +3 -3
- package/lib/7494.js +19 -2
- package/lib/7896.js +13 -0
- package/lib/907.js +5 -4
- package/lib/{6842.js → 9206.js} +1 -1
- package/lib/9320.js +2 -2
- package/lib/9387.js +4 -4
- package/lib/9590.js +1 -1
- package/lib/9663.js +1 -1
- package/lib/index.js +69 -69
- package/lib/lib.js +107 -89
- package/package.json +6 -8
- package/lib/3332.js +0 -13
- package/lib/4479.js +0 -36
- package/lib/6042.js +0 -1
- package/lib/9583.js +0 -19
package/lib/3781.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const __rspack_esm_id=3781;export const __rspack_esm_ids=[3781];export const __webpack_modules__={46594(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let a=r(39290),s=r(11888),i=r(64125),n=r(42479),o=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends a.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(n,o):n;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var u=r(51658);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=r(52805);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var h=r(55238);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var p=r(89127);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},18112(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=a;class s extends r{constructor(e){super(),this._items="string"==typeof e?[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 null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){let r=[e[0]],a=0;for(;a<t.length;)l(r,t[a]),r.push(e[++a]);return new s(r)}t._Code=s,t.nil=new s(""),t._=i;let n=new s("+");function o(e,...t){let r=[d(e[0])],i=0;for(;i<t.length;)r.push(n),l(r,t[i]),r.push(n,d(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){var r,s;let i=(r=e[t-1],'""'===(s=e[t+1])?r:'""'===r?s:"string"==typeof r?s instanceof a||'"'!==r[r.length-1]?void 0:"string"!=typeof s?`${r.slice(0,-1)}${s}"`:'"'===s[0]?r.slice(0,-1)+s.slice(1):void 0:"string"!=typeof s||'"'!==s[0]||r instanceof a?void 0:`"${r}${s.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(r),new s(r)}function l(e,t){var r;t instanceof s?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:d(Array.isArray(r)?r.join(","):r))}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new s(d(e))},t.safeStringify=d,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},52805(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let a=r(18112),s=r(74501);var i=r(18112);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var n=r(74501);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),t.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?s.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class d extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof a.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,e,t),this}get names(){return N(this.lhs instanceof a.Name?{}:{...this.lhs.names},this.rhs)}}class u extends d{constructor(e,t,r,a){super(e,r,a),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class c extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class p extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class m extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,a=r.length;for(;a--;){let s=r[a];s.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,s.names),r.splice(a,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>I(e,t.names),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class v extends y{}v.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(O(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){let e=super.names;return N(e,this.condition),this.else&&I(e,this.else.names),e}}_.kind="if";class $ extends y{}$.kind="for";class b extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class w extends ${constructor(e,t,r,a){super(),this.varKind=e,this.name=t,this.from=r,this.to=a}render(e){let t=e.es5?s.varKinds.var:this.varKind,{name:r,from:a,to:i}=this;return`for(${t} ${r}=${a}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=N(super.names,this.from);return N(e,this.to)}}class k extends ${constructor(e,t,r,a){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class x extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class S extends m{render(e){return"return "+super.render(e)}}S.kind="return";class E extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,a;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(a=this.finally)||a.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class T extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}T.kind="catch";class P extends y{render(e){return"finally"+super.render(e)}}function I(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function N(e,t){return t instanceof a._CodeOrName?I(e,t.names):e}function j(e,t,r){var s;if(e instanceof a.Name)return i(e);if(!((s=e)instanceof a._Code&&s._items.some(e=>e instanceof a.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new a._Code(e._items.reduce((e,t)=>(t instanceof a.Name&&(t=i(t)),t instanceof a._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let a=r[e.str];return void 0===a||1!==t[e.str]?e:(delete t[e.str],a)}}function O(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,a._)`!${R(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,a){let s=this._scope.toName(t);return void 0!==r&&a&&(this._constants[s.str]=r),this._leafNode(new l(e,s,r)),s}const(e,t,r){return this._def(s.varKinds.const,e,t,r)}let(e,t,r){return this._def(s.varKinds.let,e,t,r)}var(e,t,r){return this._def(s.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new d(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==a.nil&&this._leafNode(new f(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,a.addCodeArg)(t,s));return t.push("}"),new a._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(_,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,r,a,i=this.opts.es5?s.varKinds.var:s.varKinds.let){let n=this._scope.toName(e);return this._for(new w(i,n,t,r),()=>a(n))}forOf(e,t,r,i=s.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let e=t instanceof a.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,a._)`${e}.length`,t=>{this.var(n,(0,a._)`${e}[${t}]`),r(n)})}return this._for(new k("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?s.varKinds.var:s.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,a._)`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new k("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new h(e))}return(e){let t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let a=new E;if(this._blockNode(a),this.code(e),t){let e=this.name("e");this._currNode=a.catch=new T(e),t(e)}return r&&(this._currNode=a.finally=new P,this.code(r)),this._endBlockNode(T,P)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=a.nil,r,s){return this._blockNode(new x(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(x)}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,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}},t.not=O;let z=A(t.operators.AND);t.and=function(...e){return e.reduce(z)};let C=A(t.operators.OR);function A(e){return(t,r)=>t===a.nil?r:r===a.nil?t:(0,a._)`${R(t)} ${e} ${R(r)}`}function R(e){return e instanceof a.Name?e:(0,a._)`(${e})`}t.or=function(...e){return e.reduce(C)}},74501(e,t,r){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r(18112);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(s=a||(t.UsedValueState=a={}))[s.Started=0]="Started",s[s.Completed=1]="Completed",t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class l extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=l;let d=(0,i._)`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?d:i.nil}}get(){return this._scope}name(e){return new l(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,i=null!=(r=t.key)?r:t.ref,n=this._values[s];if(n){let e=n.get(i);if(e)return e}else n=this._values[s]=new Map;n.set(i,a);let o=this._scope[s]||(this._scope[s]=[]),l=o.length;return o[l]=t.ref,a.setValue(t,{property:s,itemIndex:l}),a}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},o){let l=i.nil;for(let d in e){let u=e[d];if(!u)continue;let c=s[d]=s[d]||new Map;u.forEach(e=>{if(c.has(e))return;c.set(e,a.Started);let s=r(e);if(s){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=(0,i._)`${l}${r} ${e} = ${s};${this.opts._n}`}else if(s=null==o?void 0:o(e))l=(0,i._)`${l}${s}${this.opts._n}`;else throw new n(e);c.set(e,a.Completed)})}return l}}},11412(e,t,r){t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.y=void 0;let a=r(52805),s=r(46531),i=r(16439);function n(e,t){let r=e.const("err",t);e.if((0,a._)`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,(0,a._)`[${r}]`),(0,a._)`${i.default.vErrors}.push(${r})`),e.code((0,a._)`${i.default.errors}++`)}function o(e,t){let{gen:r,validateName:s,schemaEnv:i}=e;i.$async?r.throw((0,a._)`new ${e.ValidationError}(${t})`):(r.assign((0,a._)`${s}.errors`,t),r.return(!1))}t.y={message:({keyword:e})=>(0,a.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,a.str)`"${e}" keyword must be ${t} ($data)`:(0,a.str)`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.y,s,i){let{it:l}=e,{gen:u,compositeRule:c,allErrors:h}=l,p=d(e,r,s);(null!=i?i:c||h)?n(u,p):o(l,(0,a._)`[${p}]`)},t.reportExtraError=function(e,r=t.y,a){let{it:s}=e,{gen:l,compositeRule:u,allErrors:c}=s;n(l,d(e,r,a)),u||c||o(s,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if((0,a._)`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,a._)`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:n,it:o}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,i.default.errors,n=>{e.const(l,(0,a._)`${i.default.vErrors}[${n}]`),e.if((0,a._)`${l}.instancePath === undefined`,()=>e.assign((0,a._)`${l}.instancePath`,(0,a.strConcat)(i.default.instancePath,o.errorPath))),e.assign((0,a._)`${l}.schemaPath`,(0,a.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,a._)`${l}.schema`,r),e.assign((0,a._)`${l}.data`,s))})};let l={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function d(e,t,r){let{createErrors:n}=e.it;return!1===n?(0,a._)`{}`:function(e,t,r={}){let{gen:n,it:o}=e,d=[function({errorPath:e},{instancePath:t}){let r=t?(0,a.str)`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,r)]}(o,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,a.str)`${t}/${e}`;return r&&(n=(0,a.str)`${n}${(0,s.getErrorPath)(r,s.Type.Str)}`),[l.schemaPath,n]}(e,r)];return function(e,{params:t,message:r},s){let{keyword:n,data:o,schemaValue:d,it:u}=e,{opts:c,propertyName:h,topSchemaRef:p,schemaPath:f}=u;s.push([l.keyword,n],[l.params,"function"==typeof t?t(e):t||(0,a._)`{}`]),c.messages&&s.push([l.message,"function"==typeof r?r(e):r]),c.verbose&&s.push([l.schema,d],[l.parentSchema,(0,a._)`${p}${f}`],[i.default.data,o]),h&&s.push([l.propertyName,h])}(e,t,d),n.object(...d)}(e,t,r)}},72347(e,t,r){t.resolveSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let a=r(52805),s=r(55238),i=r(16439),n=r(45259),o=r(46531),l=r(51658);class d{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,n.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){let t,r,o=h.call(this,e);if(o)return o;let d=(0,n.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:u,lines:c}=this.opts.code,{ownProperties:p}=this.opts,f=new a.CodeGen(this.scope,{es5:u,lines:c,ownProperties:p});e.$async&&(t=f.scopeValue("Error",{ref:s.default,code:(0,a._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[a.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,a.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:d,baseId:e.baseId||d,schemaPath:a.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,a._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,l.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let t=f.toString();r=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let s=Function(`${i.default.self}`,`${i.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:s}),s.errors=null,s.schema=e.schema,s.schemaEnv=e,e.$async&&(s.$async=!0),!0===this.opts.code.source&&(s.source={validateName:m,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:t}=y;s.evaluated={props:e instanceof a.Name?void 0:e,items:t instanceof a.Name?void 0:t,dynamicProps:e instanceof a.Name,dynamicItems:t instanceof a.Name},s.source&&(s.source.evaluated=(0,a.stringify)(s.evaluated))}return e.validate=s,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function c(e){return(0,n.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(let a of this._compilations){var t,r;if(t=a,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return a}}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||f.call(this,e,t)}function f(e,t){let r=this.opts.uriResolver.parse(t),a=(0,n._getFullPath)(this.opts.uriResolver,r),s=(0,n.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===s)return y.call(this,r,e);let i=(0,n.normalizeId)(a),o=this.refs[i]||this.schemas[i];if("string"==typeof o){let t=f.call(this,e,o);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==o?void 0:o.schema)){if(o.validate||u.call(this,o),i===(0,n.normalizeId)(t)){let{schema:t}=o,{schemaId:r}=this.opts,a=t[r];return a&&(s=(0,n.resolveUrl)(this.opts.uriResolver,s,a)),new d({schema:t,schemaId:r,root:e,baseId:s})}return y.call(this,r,o)}}t.SchemaEnv=d,t.compileSchema=u,t.resolveRef=function(e,t,r){var a;r=(0,n.resolveUrl)(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let i=p.call(this,e,r);if(void 0===i){let s=null==(a=e.localRefs)?void 0:a[r],{schemaId:n}=this.opts;s&&(i=new d({schema:s,schemaId:n,root:e,baseId:t}))}if(void 0!==i)return e.refs[r]=c.call(this,i)},t.resolveSchema=f;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:a}){var s;let i;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,o.unescapeFragment)(a)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(a)&&s&&(t=(0,n.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){let e=(0,n.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=f.call(this,a,e)}let{schemaId:l}=this.opts;if((i=i||new d({schema:r,schemaId:l,root:a,baseId:t})).schema!==i.root.schema)return i}},16439(e,t,r){let a=r(52805);t.default={data:new a.Name("data"),valCxt:new a.Name("valCxt"),instancePath:new a.Name("instancePath"),parentData:new a.Name("parentData"),parentDataProperty:new a.Name("parentDataProperty"),rootData:new a.Name("rootData"),dynamicAnchors:new a.Name("dynamicAnchors"),vErrors:new a.Name("vErrors"),errors:new a.Name("errors"),this:new a.Name("this"),self:new a.Name("self"),scope:new a.Name("scope"),json:new a.Name("json"),jsonPos:new a.Name("jsonPos"),jsonLen:new a.Name("jsonLen"),jsonPart:new a.Name("jsonPart")}},89127(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let a=r(45259);t.default=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,a.resolveUrl)(e,t,r),this.missingSchema=(0,a.normalizeId)((0,a.getFullPath)(e,this.missingRef))}}},45259(e,t,r){t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let a=r(46531),s=r(38792),i=r(1645),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!function e(t){for(let r in t){if(o.has(r))return!0;let a=t[r];if(Array.isArray(a)&&a.some(e)||"object"==typeof a&&e(a))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let s in t)if("$ref"===s||(r++,!n.has(s)&&("object"==typeof t[s]&&(0,a.eachItem)(t[s],t=>r+=e(t)),r===1/0)))return 1/0;return r}(e)<=t)};let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e,t="",r){!1!==r&&(t=c(t));let a=e.parse(t);return d(e,a)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=d;let u=/#\/?$/;function c(e){return e?e.replace(u,""):""}t.normalizeId=c,t.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let h=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:a}=this.opts,n=c(e[r]||t),o={"":n},d=l(a,n,!1),u={},p=new Set;return i(e,{allKeys:!0},(e,t,a,s)=>{if(void 0===s)return;let i=d+t,n=o[s];function l(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),p.has(t))throw m(t);p.add(t);let a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?f(e,a.schema,t):t!==c(i)&&("#"===t[0]?(f(e,u[t],t),u[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!h.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(n=l.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),o[t]=n}),u;function f(e,t,r){if(void 0!==t&&!s(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},39244(e,t){t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},46531(e,t,r){var a,s;t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r(52805),n=r(18112);function o(e,t=e.schema){let{opts:r,self:a}=e;if(!r.strictSchema||"boolean"==typeof t)return;let s=a.RULES.keywords;for(let r in t)s[r]||f(e,`unknown keyword: "${r}"`)}function l(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function d(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,n,o,l)=>{let d=void 0===o?n:o instanceof i.Name?(n instanceof i.Name?e(s,n,o):t(s,n,o),o):n instanceof i.Name?(t(s,o,n),n):r(n,o);return l!==i.Name||d instanceof i.Name?d:a(s,d)}}function c(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&h(e,r,t),r}function h(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(a)}`},t.unescapeFragment=function(e){return d(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(l(e))},t.unescapeJsonPointer=d,t.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),h(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:u({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=c;let p={};function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new n._Code(t.code))})},(s=a||(t.Type=a={}))[s.Num=0]="Num",s[s.Str=1]="Str",t.getErrorPath=function(e,t,r){if(e instanceof i.Name){let s=t===a.Num;return r?s?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:s?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+l(e)},t.checkStrictMode=f},415(e,t){function r(e,t){return t.rules.some(t=>a(e,t))}function a(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},a){let s=t.RULES.types[a];return s&&!0!==s&&r(e,s)},t.shouldUseGroup=r,t.shouldUseRule=a},10260(e,t,r){t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let a=r(11412),s=r(52805),i=r(16439),n={message:"boolean schema is false"};function o(e,t){let{gen:r,data:s}=e;(0,a.reportError)({gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},n,void 0,t)}t.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:a}=e;!1===r?o(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign((0,s._)`${a}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){let{gen:r,schema:a}=e;!1===a?(r.var(t,!1),o(e)):r.var(t,!0)}},36752(e,t,r){var a,s;t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r(39244),n=r(415),o=r(11412),l=r(52805),d=r(46531);function u(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(s=a||(t.DataType=a={}))[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong",t.getSchemaTypes=function(e){let t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){var r,s;let{gen:i,data:o,opts:d}=e,u=(r=t,(s=d.coerceTypes)?r.filter(e=>c.has(e)||"array"===s&&"array"===e):[]),h=t.length>0&&!(0===u.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(h){let r=p(t,o,d.strictNumbers,a.Wrong);i.if(r,()=>{u.length?function(e,t,r){let{gen:a,data:s,opts:i}=e,n=a.let("dataType",(0,l._)`typeof ${s}`),o=a.let("coerced",(0,l._)`undefined`);for(let e of("array"===i.coerceTypes&&a.if((0,l._)`${n} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>a.assign(s,(0,l._)`${s}[0]`).assign(n,(0,l._)`typeof ${s}`).if(p(t,s,i.strictNumbers),()=>a.assign(o,s))),a.if((0,l._)`${o} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":a.elseIf((0,l._)`${n} == "number" || ${n} == "boolean"`).assign(o,(0,l._)`"" + ${s}`).elseIf((0,l._)`${s} === null`).assign(o,(0,l._)`""`);return;case"number":a.elseIf((0,l._)`${n} == "boolean" || ${s} === null
|
|
2
|
+
|| (${n} == "string" && ${s} && ${s} == +${s})`).assign(o,(0,l._)`+${s}`);return;case"integer":a.elseIf((0,l._)`${n} === "boolean" || ${s} === null
|
|
3
|
+
|| (${n} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(o,(0,l._)`+${s}`);return;case"boolean":a.elseIf((0,l._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(o,!1).elseIf((0,l._)`${s} === "true" || ${s} === 1`).assign(o,!0);return;case"null":a.elseIf((0,l._)`${s} === "" || ${s} === 0 || ${s} === false`),a.assign(o,null);return;case"array":a.elseIf((0,l._)`${n} === "string" || ${n} === "number"
|
|
4
|
+
|| ${n} === "boolean" || ${s} === null`).assign(o,(0,l._)`[${s}]`)}}(e);a.else(),m(e),a.endIf(),a.if((0,l._)`${o} !== undefined`,()=>{a.assign(s,o),function({gen:e,parentData:t,parentDataProperty:r},a){e.if((0,l._)`${t} !== undefined`,()=>e.assign((0,l._)`${t}[${r}]`,a))}(e,o)})}(e,t,u):m(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function h(e,t,r,s=a.Correct){let i,n=s===a.Correct?l.operators.EQ:l.operators.NEQ;switch(e){case"null":return(0,l._)`${t} ${n} null`;case"array":i=(0,l._)`Array.isArray(${t})`;break;case"object":i=(0,l._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o((0,l._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return(0,l._)`typeof ${t} ${n} ${e}`}return s===a.Correct?i:(0,l.not)(i);function o(e=l.nil){return(0,l.and)((0,l._)`typeof ${t} == "number"`,e,r?(0,l._)`isFinite(${t})`:l.nil)}}function p(e,t,r,a){let s;if(1===e.length)return h(e[0],t,r,a);let i=(0,d.toHash)(e);if(i.array&&i.object){let e=(0,l._)`typeof ${t} != "object"`;s=i.null?e:(0,l._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=l.nil;for(let e in i.number&&delete i.integer,i)s=(0,l.and)(s,h(e,t,r,a));return s}t.checkDataType=h,t.checkDataTypes=p;let f={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,l._)`{type: ${e}}`:(0,l._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:a}=e,s=(0,d.schemaRefOrVal)(e,a,"type");return{gen:t,keyword:"type",data:r,schema:a.type,schemaCode:s,schemaValue:s,parentSchema:a,params:{},it:e}}(e);(0,o.reportError)(t,f)}t.reportTypeError=m},19054(e,t,r){t.assignDefaults=void 0;let a=r(52805),s=r(46531);function i(e,t,r){let{gen:i,compositeRule:n,data:o,opts:l}=e;if(void 0===r)return;let d=(0,a._)`${o}${(0,a.getProperty)(t)}`;if(n)return void(0,s.checkStrictMode)(e,`default is ignored for: ${d}`);let u=(0,a._)`${d} === undefined`;"empty"===l.useDefaults&&(u=(0,a._)`${u} || ${d} === null || ${d} === ""`),i.if(u,(0,a._)`${d} = ${(0,a.stringify)(r)}`)}t.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>i(e,r,t.default))}},51658(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let a=r(10260),s=r(36752),i=r(415),n=r(36752),o=r(19054),l=r(57369),d=r(92543),u=r(52805),c=r(16439),h=r(45259),p=r(46531),f=r(11412);function m({gen:e,validateName:t,schema:r,schemaEnv:a,opts:s},i){var n;s.code.es5?e.func(t,(0,u._)`${c.default.data}, ${c.default.valCxt}`,a.$async,()=>{var t,a;e.code((0,u._)`"use strict"; ${y(r,s)}`),t=e,a=s,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,u._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,u._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,u._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,u._)`${c.default.valCxt}.${c.default.rootData}`),a.dynamicRef&&t.var(c.default.dynamicAnchors,(0,u._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,u._)`""`),t.var(c.default.parentData,(0,u._)`undefined`),t.var(c.default.parentDataProperty,(0,u._)`undefined`),t.var(c.default.rootData,c.default.data),a.dynamicRef&&t.var(c.default.dynamicAnchors,(0,u._)`{}`)}),e.code(i)}):e.func(t,(0,u._)`${c.default.data}, ${(n=s,(0,u._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,u._)`, ${c.default.dynamicAnchors}={}`:u.nil}}={}`)}`,a.$async,()=>e.code(y(r,s)).code(i))}function y(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,u._)`/*# sourceURL=${r} */`:u.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function _(e){(0,p.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:a,self:s}=e;t.$ref&&a.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function $(e,t){if(e.opts.jtd)return w(e,[],!1,t);let r=(0,s.getSchemaTypes)(e.schema),a=(0,s.coerceAndCheckDataType)(e,r);w(e,r,!a,t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:a,opts:s}){let i=r.$comment;if(!0===s.$comment)e.code((0,u._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof s.$comment){let r=(0,u.str)`${a}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,u._)`${c.default.self}.opts.$comment(${i}, ${r}, ${s}.schema)`)}}function w(e,t,r,a){var s,o,l,d;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(f,_)))return void h.block(()=>T(e,"$ref",_.all.$ref.definition));function $(s){(0,i.shouldUseGroup)(f,s)&&(s.type?(h.if((0,n.checkDataType)(s.type,m,g.strictNumbers)),k(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,n.reportTypeError)(e)),h.endIf()):k(e,s),y||h.if((0,u._)`${c.default.errors} === ${a||0}`))}g.jtd||(s=e,o=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{x(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let a of e.dataTypes)x(t,a)?r.push(a):t.includes("integer")&&"number"===a&&r.push("integer");e.dataTypes=r}(e,t)}}(s,o),s.opts.allowUnionTypes||(l=s,(d=o).length>1&&!(2===d.length&&d.includes("null"))&&S(l,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let s=r[a];if("object"==typeof s&&(0,i.shouldUseRule)(e.schema,s)){let{type:r}=s.definition;r.length&&!r.some(e=>{var r,a;return r=t,a=e,r.includes(a)||"number"===a&&r.includes("integer")})&&S(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of _.rules)$(e);$(_.post)})}function k(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,i.shouldUseRule)(a,r)&&T(e,r.keyword,r.definition,t.type)})}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(_(e),g(e))?function(e){let{schema:t,opts:r,gen:a}=e;m(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),a.let(c.default.vErrors,null),a.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,u._)`${r}.evaluated`),t.if((0,u._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,u._)`${e.evaluated}.props`,(0,u._)`undefined`)),t.if((0,u._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,u._)`${e.evaluated}.items`,(0,u._)`undefined`))}(e),$(e),function(e){let{gen:t,schemaEnv:r,validateName:a,ValidationError:s,opts:i}=e;r.$async?t.if((0,u._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,u._)`new ${s}(${c.default.vErrors})`)):(t.assign((0,u._)`${a}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:a}){r instanceof u.Name&&e.assign((0,u._)`${t}.props`,r),a instanceof u.Name&&e.assign((0,u._)`${t}.items`,a)}(e),t.return((0,u._)`${c.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,a.topBoolOrEmptySchema)(e))};class E{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e){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:t}=this;this.fail((0,u._)`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;let{gen:r,schemaCode:a,schemaType:s,def:i}=this;r.if((0,u.or)((0,u._)`${a} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(s.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:a,it:s}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,u._)`${(0,n.checkDataTypes)(e,t,s.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}(),function(){if(a.validateSchema){let r=e.scopeValue("validate$data",{ref:a.validateSchema});return(0,u._)`!${r}(${t})`}return u.nil}())}subschema(e,t){let r=(0,d.getSubschema)(this.it,e);(0,d.extendSubschemaData)(r,this.it,e),(0,d.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(v(e)&&(_(e),g(e)))return function(e,t){var r;let a,{schema:s,gen:i,opts:n}=e;n.$comment&&s.$comment&&b(e),(a=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,h.resolveUrl)(r.opts.uriResolver,r.baseId,a)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let o=i.const("_errs",c.default.errors);$(e,o),i.var(t,(0,u._)`${o} === ${c.default.errors}`)}(e,t);(0,a.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){let{it:r,gen:a}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=p.mergeEvaluated.props(a,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=p.mergeEvaluated.items(a,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:a}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return a.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function T(e,t,r,a){let s=new E(e,r,t);"code"in r?r.code(s,a):s.$data&&r.validate?(0,l.funcKeywordCode)(s,r):"macro"in r?(0,l.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(s,r)}t.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:r,dataPathArr:a}){let s,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,i=c.default.rootData}else{let n=I.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(s=n[2])){if(l>=t)throw Error(o("property/index",l));return a[t-l]}if(l>t)throw Error(o("data",l));if(i=r[t-l],!s)return i}let n=i;for(let e of s.split("/"))e&&(i=(0,u._)`${i}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,n=(0,u._)`${n} && ${i}`);return n;function o(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=N},57369(e,t,r){t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let a=r(52805),s=r(16439),i=r(44165),n=r(11412);function o(e){let{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,(0,a._)`${s.parentData}[${s.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,a.stringify)(r)})}t.macroKeywordCode=function(e,t){let{gen:r,keyword:s,schema:i,parentSchema:n,it:o}=e,d=t.macro.call(o.self,i,n,o),u=l(r,s,d);!1!==o.opts.validateSchema&&o.self.validateSchema(d,!0);let c=r.name("valid");e.subschema({schema:d,schemaPath:a.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;let{gen:d,keyword:u,schema:c,parentSchema:h,$data:p,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,t);let m=l(d,u,!p&&t.compile?t.compile.call(f.self,c,h,f):t.validate),y=d.let("valid");function g(r=t.async?(0,a._)`await `:a.nil){let n=f.opts.passContext?s.default.this:s.default.self,o=!("compile"in t&&!p||!1===t.schema);d.assign(y,(0,a._)`${r}${(0,i.callValidateCode)(e,m,n,o)}`,t.modifying)}function v(e){var r;d.if((0,a.not)(null!=(r=t.valid)?r:y),e)}e.block$data(y,function(){if(!1===t.errors)g(),t.modifying&&o(e),v(()=>e.error());else{let r,i,l=t.async?(r=d.let("ruleErrs",null),d.try(()=>g((0,a._)`await `),e=>d.assign(y,!1).if((0,a._)`${e} instanceof ${f.ValidationError}`,()=>d.assign(r,(0,a._)`${e}.errors`),()=>d.throw(e))),r):(i=(0,a._)`${m}.errors`,d.assign(i,null),g(a.nil),i);t.modifying&&o(e),v(()=>(function(e,t){let{gen:r}=e;r.if((0,a._)`Array.isArray(${t})`,()=>{r.assign(s.default.vErrors,(0,a._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,(0,a._)`${s.default.vErrors}.length`),(0,n.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(r=t.valid)?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:a},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw Error("ajv implementation error");let n=s.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${n.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${a}": `+r.errorsText(s.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},92543(e,t,r){t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let a=r(52805),s=r(46531);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let i=e.schema[t];return void 0===r?{schema:i,schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}${(0,a.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===n||void 0===o||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:l}){if(void 0!==n&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:d}=t;if(void 0!==r){let{errorPath:n,dataPathArr:o,opts:l}=t;u(d.let("data",(0,a._)`${t.data}${(0,a.getProperty)(r)}`,!0)),e.errorPath=(0,a.str)`${n}${(0,s.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,a._)`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==n&&(u(n instanceof a.Name?n:d.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),o&&(e.dataTypes=o)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:a,createErrors:s,allErrors:i}){void 0!==a&&(e.compositeRule=a),void 0!==s&&(e.createErrors=s),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},39290(e,t,r){r(51658),r(52805);let a=r(55238),s=r(89127),i=r(39244),n=r(72347),o=r(52805),l=r(45259),d=r(36752),u=r(46531),c=r(34557),h=r(88216),p=(e,t)=>new RegExp(e,t);p.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class v{constructor(e={}){var t,r,a,s,n,l,d,u,c,f,v,$,E,T,P,I,N,j,O,z,C,A,R,Z,M,q;let D,V,F,L,U;this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,F=!0===(V=null==(r=t.code)?void 0:r.optimize)||void 0===V?1:V||0,L=null!=(s=null==(a=t.code)?void 0:a.regExp)?s:p,U=null!=(n=t.uriResolver)?n:h.default,{strictSchema:null==(d=null!=(l=t.strictSchema)?l:D)||d,strictNumbers:null==(c=null!=(u=t.strictNumbers)?u:D)||c,strictTypes:null!=(v=null!=(f=t.strictTypes)?f:D)?v:"log",strictTuples:null!=(E=null!=($=t.strictTuples)?$:D)?E:"log",strictRequired:null!=(P=null!=(T=t.strictRequired)?T:D)&&P,code:t.code?{...t.code,optimize:F,regExp:L}:{optimize:F,regExp:L},loopRequired:null!=(I=t.loopRequired)?I:200,loopEnum:null!=(N=t.loopEnum)?N:200,meta:null==(j=t.meta)||j,messages:null==(O=t.messages)||O,inlineRefs:null==(z=t.inlineRefs)||z,schemaId:null!=(C=t.schemaId)?C:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(R=t.validateSchema)||R,validateFormats:null==(Z=t.validateFormats)||Z,unicodeRegExp:null==(M=t.unicodeRegExp)||M,int32range:null==(q=t.int32range)||q,uriResolver:U})};let{es5:K,lines:Y}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:m,es5:K,lines:Y}),this.logger=function(e){if(!1===e)return S;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);let H=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=x.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&k.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),b.call(this),e.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,a=c;"id"===r&&((a={...c}).id=a.$id,delete a.$id),t&&e&&this.addMetaSchema(a,a[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let a=r(t);return"$async"in r||(this.errors=r.errors),a}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return a.call(this,e,t);async function a(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await a.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return o.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function o({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await d.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function d(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,a=this.opts.validateSchema){let s;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,a);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(s=e[t])&&"string"!=typeof s)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,a,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(r,e);if(!a&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return a}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,a=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.resolveSchema.call(this,a,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(T.call(this,r,t),!t)return(0,u.eachItem)(r,e=>P.call(this,e)),this;N.call(this,t);let a={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===a.type.length?e=>P.call(this,e,a):e=>a.type.forEach(t=>P.call(this,e,a,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let a of(e=JSON.parse(JSON.stringify(e)),t)){let t=a.split("/").slice(1),s=e;for(let e of t)s=s[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:a}=t.definition,i=s[e];a&&i&&(s[e]=O(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let a=e[r];(!t||t.test(r))&&("string"==typeof a?delete e[r]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[r]))}}_addSchema(e,t,r,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if("object"==typeof e)i=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let d=this._cache.get(e);if(void 0!==d)return d;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return d=new n.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:u}),this._cache.set(d.schema,d),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=d),a&&this.validateSchema(e,!0),d}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):n.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{n.compileSchema.call(this,e)}finally{this.opts=t}}}function _(e,t,r,a="error"){for(let s in e)s in t&&this.logger[a](`${r}: option ${s}. ${e[s]}`)}function $(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function b(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function w(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function k(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function x(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=a.default,v.MissingRefError=s.default,t.default=v;let S={log(){},warn(){},error(){}},E=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!E.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function P(e,t,r){var a;let s=null==t?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,n=s?i.post:i.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},i.rules.push(n)),i.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?I.call(this,n,o,t.before):n.rules.push(o),i.all[e]=o,null==(a=t.implements)||a.forEach(e=>this.addKeyword(e))}function I(e,t,r){let a=e.rules.findIndex(e=>e.keyword===r);a>=0?e.rules.splice(a,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function N(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,j]}}},45994(e,t,r){let a=r(38792);a.code='require("ajv/dist/runtime/equal").default',t.default=a},21709(e,t){function r(e){let t,r=e.length,a=0,s=0;for(;s<r;)a++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<r&&(64512&(t=e.charCodeAt(s)))==56320&&s++;return a}t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},88216(e,t,r){let a=r(81298);a.code='require("ajv/dist/runtime/uri").default',t.default=a},55238(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}},14577(e,t,r){t.validateAdditionalItems=void 0;let a=r(52805),s=r(46531);function i(e,t){let{gen:r,schema:i,data:n,keyword:o,it:l}=e;l.items=!0;let d=r.const("len",(0,a._)`${n}.length`);if(!1===i)e.setParams({len:t.length}),e.pass((0,a._)`${d} <= ${t.length}`);else if("object"==typeof i&&!(0,s.alwaysValidSchema)(l,i)){let i=r.var("valid",(0,a._)`${d} <= ${t.length}`);r.if((0,a.not)(i),()=>{var n;return n=i,void r.forRange("i",t.length,d,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:s.Type.Num},n),l.allErrors||r.if((0,a.not)(n),()=>r.break())})}),e.ok(i)}}t.validateAdditionalItems=i,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;Array.isArray(a)?i(e,a):(0,s.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},68372(e,t,r){let a=r(44165),s=r(52805),i=r(16439),n=r(46531);t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,s._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:o,data:l,errsCount:d,it:u}=e;if(!d)throw Error("ajv implementation error");let{allErrors:c,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,n.alwaysValidSchema)(u,r))return;let p=(0,a.allSchemaProperties)(o.properties),f=(0,a.allSchemaProperties)(o.patternProperties);function m(e){t.code((0,s._)`delete ${l}[${e}]`)}function y(a){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)return void m(a);if(!1===r){e.setParams({additionalProperty:a}),e.error(),c||t.break();return}if("object"==typeof r&&!(0,n.alwaysValidSchema)(u,r)){let r=t.name("valid");"failing"===h.removeAdditional?(g(a,r,!1),t.if((0,s.not)(r),()=>{e.reset(),m(a)})):(g(a,r),c||t.if((0,s.not)(r),()=>t.break()))}}function g(t,r,a){let s={keyword:"additionalProperties",dataProp:t,dataPropType:n.Type.Str};!1===a&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,r)}t.forIn("key",l,r=>{p.length||f.length?t.if(function(r){let i;if(p.length>8){let e=(0,n.schemaRefOrVal)(u,o.properties,"properties");i=(0,a.isOwnProperty)(t,e,r)}else i=p.length?(0,s.or)(...p.map(e=>(0,s._)`${r} === ${e}`)):s.nil;return f.length&&(i=(0,s.or)(i,...f.map(t=>(0,s._)`${(0,a.usePattern)(e,t)}.test(${r})`))),(0,s.not)(i)}(r),()=>y(r)):y(r)}),e.ok((0,s._)`${d} === ${i.default.errors}`)}}},80660(e,t,r){let a=r(46531);t.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((t,r)=>{if((0,a.alwaysValidSchema)(s,t))return;let n=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(n)})}}},74825(e,t,r){t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(44165).validateUnion,error:{message:"must match a schema in anyOf"}}},67301(e,t,r){let a=r(52805),s=r(46531);t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,a.str)`must contain at least ${e} valid item(s)`:(0,a.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,a._)`{minContains: ${e}}`:(0,a._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:i,schema:n,parentSchema:o,data:l,it:d}=e,{minContains:u,maxContains:c}=o;d.opts.next?(t=void 0===u?1:u,r=c):t=1;let h=i.const("len",(0,a._)`${l}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,s.checkStrictMode)(d,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==r&&t>r){(0,s.checkStrictMode)(d,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,s.alwaysValidSchema)(d,n)){let s=(0,a._)`${h} >= ${t}`;void 0!==r&&(s=(0,a._)`${s} && ${h} <= ${r}`),e.pass(s);return}d.items=!0;let p=i.name("valid");function f(){let e=i.name("_valid"),s=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=s,void(i.code((0,a._)`${e}++`),void 0===r?i.if((0,a._)`${e} >= ${t}`,()=>i.assign(p,!0).break()):(i.if((0,a._)`${e} > ${r}`,()=>i.assign(p,!1).break()),1===t?i.assign(p,!0):i.if((0,a._)`${e} >= ${t}`,()=>i.assign(p,!0))))}))}function m(t,r){i.forRange("i",0,h,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:s.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(p,()=>i.if(p,()=>i.break())):0===t?(i.let(p,!0),void 0!==r&&i.if((0,a._)`${l}.length > 0`,f)):(i.let(p,!1),f()),e.result(p,()=>e.reset())}}},64641(e,t,r){t.z3=void 0;let a=r(52805),s=r(46531),i=r(44165);t.z3={message:({params:{property:e,depsCount:t,deps:r}})=>(0,a.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>(0,a._)`{property: ${e},
|
|
5
|
+
missingProperty: ${s},
|
|
6
|
+
depsCount: ${t},
|
|
7
|
+
deps: ${r}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.z3,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let a in e)"__proto__"!==a&&((Array.isArray(e[a])?t:r)[a]=e[a]);return[t,r]}(e);(function(e,t=e.schema){let{gen:r,data:s,it:n}=e;if(0===Object.keys(t).length)return;let o=r.let("missing");for(let l in t){let d=t[l];if(0===d.length)continue;let u=(0,i.propertyInData)(r,s,l,n.opts.ownProperties);e.setParams({property:l,depsCount:d.length,deps:d.join(", ")}),n.allErrors?r.if(u,()=>{for(let t of d)(0,i.checkReportMissingProp)(e,t)}):(r.if((0,a._)`${u} && (${(0,i.checkMissingProp)(e,d,o)})`),(0,i.reportMissingProp)(e,o),r.else())}})(e,t),function(e,t=e.schema){let{gen:r,data:a,keyword:n,it:o}=e,l=r.name("valid");for(let d in t)(0,s.alwaysValidSchema)(o,t[d])||(r.if((0,i.propertyInData)(r,a,d,o.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:d},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}(e,r)}};t.default=n},83527(e,t,r){let a=r(52805),s=r(46531);function i(e,t){let r=e.schema[t];return void 0!==r&&!(0,s.alwaysValidSchema)(e,r)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,a.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,a._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let l=i(o,"then"),d=i(o,"else");if(!l&&!d)return;let u=r.let("valid",!0),c=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c),e.mergeEvaluated(t),e.reset(),l&&d){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(c,h("then",t),h("else",t))}else l?r.if(c,h("then")):r.if((0,a.not)(c),h("else"));function h(t,s){return()=>{let i=e.subschema({keyword:t},c);r.assign(u,c),e.mergeValidEvaluated(i,u),s?r.assign(s,(0,a._)`${t}`):e.setParams({ifClause:t})}}e.pass(u,()=>e.error(!0))}}},38026(e,t,r){let a=r(14577),s=r(40941),i=r(18526),n=r(55934),o=r(67301),l=r(64641),d=r(82257),u=r(68372),c=r(83365),h=r(32293),p=r(66195),f=r(74825),m=r(58643),y=r(80660),g=r(83527),v=r(10378);t.default=function(e=!1){let t=[p.default,f.default,m.default,y.default,g.default,v.default,d.default,u.default,l.default,c.default,h.default];return e?t.push(s.default,n.default):t.push(a.default,i.default),t.push(o.default),t}},18526(e,t,r){t.validateTuple=void 0;let a=r(52805),s=r(46531),i=r(44165);function n(e,t,r=e.schema){let{gen:i,parentSchema:o,data:l,keyword:d,it:u}=e;(function(e){let{opts:a,errSchemaPath:i}=u,n=r.length,o=n===e.minItems&&(n===e.maxItems||!1===e[t]);if(a.strictTuples&&!o){let e=`"${d}" is ${n}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,s.checkStrictMode)(u,e,a.strictTuples)}})(o),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=s.mergeEvaluated.items(i,r.length,u.items));let c=i.name("valid"),h=i.const("len",(0,a._)`${l}.length`);r.forEach((t,r)=>{(0,s.alwaysValidSchema)(u,t)||(i.if((0,a._)`${h} > ${r}`,()=>e.subschema({keyword:d,schemaProp:r,dataProp:r},c)),e.ok(c))})}t.validateTuple=n,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return n(e,"additionalItems",t);r.items=!0,(0,s.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}}},55934(e,t,r){let a=r(52805),s=r(46531),i=r(44165),n=r(14577);t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:a}=e,{prefixItems:o}=r;a.items=!0,(0,s.alwaysValidSchema)(a,t)||(o?(0,n.validateAdditionalItems)(e,o):e.ok((0,i.validateArray)(e)))}}},66195(e,t,r){let a=r(46531);t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:s}=e;if((0,a.alwaysValidSchema)(s,r))return void e.fail();let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}},58643(e,t,r){let a=r(52805),s=r(46531);t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,a._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=t.let("valid",!1),l=t.let("passing",null),d=t.name("_valid");e.setParams({passing:l}),t.block(function(){r.forEach((r,i)=>{let u;(0,s.alwaysValidSchema)(n,r)?t.var(d,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},d),i>0&&t.if((0,a._)`${d} && ${o}`).assign(o,!1).assign(l,(0,a._)`[${l}, ${i}]`).else(),t.if(d,()=>{t.assign(o,!0),t.assign(l,i),u&&e.mergeEvaluated(u,a.Name)})})}),e.result(o,()=>e.reset(),()=>e.error(!0))}}},32293(e,t,r){let a=r(44165),s=r(52805),i=r(46531),n=r(46531);t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:l,it:d}=e,{opts:u}=d,c=(0,a.allSchemaProperties)(r),h=c.filter(e=>(0,i.alwaysValidSchema)(d,r[e]));if(0===c.length||h.length===c.length&&(!d.opts.unevaluated||!0===d.props))return;let p=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=t.name("valid");!0===d.props||d.props instanceof s.Name||(d.props=(0,n.evaluatedPropsToName)(t,d.props));let{props:m}=d;for(let e of c)p&&function(e){for(let t in p)new RegExp(e).test(t)&&(0,i.checkStrictMode)(d,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),d.allErrors?y(e):(t.var(f,!0),y(e),t.if(f));function y(r){t.forIn("key",o,i=>{t.if((0,s._)`${(0,a.usePattern)(e,r)}.test(${i})`,()=>{let a=h.includes(r);a||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:n.Type.Str},f),d.opts.unevaluated&&!0!==m?t.assign((0,s._)`${m}[${i}]`,!0):a||d.allErrors||t.if((0,s.not)(f),()=>t.break())})})}}}},40941(e,t,r){let a=r(18526);t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,a.validateTuple)(e,"items")}},83365(e,t,r){let a=r(51658),s=r(44165),i=r(46531),n=r(68372);t.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:l,it:d}=e;"all"===d.opts.removeAdditional&&void 0===o.additionalProperties&&n.default.code(new a.KeywordCxt(d,n.default,"additionalProperties"));let u=(0,s.allSchemaProperties)(r);for(let e of u)d.definedProperties.add(e);d.opts.unevaluated&&u.length&&!0!==d.props&&(d.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),d.props));let c=u.filter(e=>!(0,i.alwaysValidSchema)(d,r[e]));if(0===c.length)return;let h=t.name("valid");for(let a of c){var p;(p=a,d.opts.useDefaults&&!d.compositeRule&&void 0!==r[p].default)?f(a):(t.if((0,s.propertyInData)(t,l,a,d.opts.ownProperties)),f(a),d.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(a),e.ok(h)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}}},82257(e,t,r){let a=r(52805),s=r(46531);t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,a._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,s.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,a.not)(o),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(o)}}},10378(e,t,r){let a=r(46531);t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,a.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},44165(e,t,r){t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let a=r(52805),s=r(46531),i=r(16439),n=r(46531);function o(e,t,r){return(0,a._)`${e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,a._)`Object.prototype.hasOwnProperty`})}.call(${t}, ${r})`}function l(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} === undefined`;return s?(0,a.or)(i,(0,a.not)(o(e,t,r))):i}t.checkReportMissingProp=function(e,t){let{gen:r,data:s,it:i}=e;r.if(l(r,s,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,a._)`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,i){return(0,a.or)(...s.map(s=>(0,a.and)(l(e,t,s,r.ownProperties),(0,a._)`${i} = ${s}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.isOwnProperty=o;t.propertyInData=function(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} !== undefined`;return s?(0,a._)`${i} && ${o(e,t,r)}`:i},t.noPropertyInData=l,t.allSchemaProperties=function(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:l},d,u,c){let h=c?(0,a._)`${e}, ${t}, ${s}${n}`:t,p=[[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,o)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&p.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let f=(0,a._)`${h}, ${r.object(...p)}`;return u!==a.nil?(0,a._)`${d}.call(${u}, ${f})`:(0,a._)`${d}(${f})`};let d=(0,a._)`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){let s=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,s);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,a._)`${"new RegExp"===i.code?d:(0,n.useFunc)(e,i)}(${r}, ${s})`})},t.validateArray=function(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(o,!0),l(()=>t.break()),o;function l(n){let l=t.const("len",(0,a._)`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:s.Type.Num},o),t.if((0,a.not)(o),n)})}},t.validateUnion=function(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,s.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,s)=>{let n=e.subschema({keyword:i,schemaProp:s,compositeRule:!0},l);t.assign(o,(0,a._)`${o} || ${l}`),e.mergeValidEvaluated(n,l)||t.if((0,a.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}},44887(e,t){t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},96944(e,t,r){let a=r(44887),s=r(82733);t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",a.default,s.default]},82733(e,t,r){let a=r(89127),s=r(44165),i=r(52805),n=r(16439),o=r(72347),l=r(46531);function d(e,t,r,a){let{gen:o,it:d}=e,{allErrors:u,schemaEnv:c,opts:h}=d,p=h.passContext?n.default.this:i.nil;function f(e){let t=(0,i._)`${e}.errors`;o.assign(n.default.vErrors,(0,i._)`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`),o.assign(n.default.errors,(0,i._)`${n.default.vErrors}.length`)}function m(e){var t;if(!d.opts.unevaluated)return;let a=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==d.props)if(a&&!a.dynamicProps)void 0!==a.props&&(d.props=l.mergeEvaluated.props(o,a.props,d.props));else{let t=o.var("props",(0,i._)`${e}.evaluated.props`);d.props=l.mergeEvaluated.props(o,t,d.props,i.Name)}if(!0!==d.items)if(a&&!a.dynamicItems)void 0!==a.items&&(d.items=l.mergeEvaluated.items(o,a.items,d.items));else{let t=o.var("items",(0,i._)`${e}.evaluated.items`);d.items=l.mergeEvaluated.items(o,t,d.items,i.Name)}}a?function(){if(!c.$async)throw Error("async schema referenced by sync schema");let r=o.let("valid");o.try(()=>{o.code((0,i._)`await ${(0,s.callValidateCode)(e,t,p)}`),m(t),u||o.assign(r,!0)},e=>{o.if((0,i._)`!(${e} instanceof ${d.ValidationError})`,()=>o.throw(e)),f(e),u||o.assign(r,!1)}),e.ok(r)}():e.result((0,s.callValidateCode)(e,t,p),()=>m(t),()=>f(t))}t.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let s,n,l,u,{gen:c,schema:h,it:p}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=p,{root:_}=m;if(("#"===h||"#/"===h)&&f===_.baseId){if(m===_)return d(e,y,m,m.$async);let t=c.scopeValue("root",{ref:_});return d(e,(0,i._)`${t}.validate`,_,_.$async)}let $=o.resolveRef.call(v,_,f,h);if(void 0===$)throw new a.default(p.opts.uriResolver,f,h);return $ instanceof o.SchemaEnv?(s=function(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,i._)`${r.scopeValue("wrapper",{ref:t})}.validate`}(e,t=$),void d(e,s,t,t.$async)):(r=$,n=c.scopeValue("schema",!0===g.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),l=c.name("valid"),u=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:h},l),void(e.mergeEvaluated(u),e.ok(l)))}}},64125(e,t,r){let a=r(52805),s=r(6308),i=r(72347),n=r(89127),o=r(46531);t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,a._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:l,parentSchema:d,it:u}=e,{oneOf:c}=d;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=l.propertyName;if("string"!=typeof h)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!c)throw Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),f=t.const("tag",(0,a._)`${r}${(0,a.getProperty)(h)}`);t.if((0,a._)`typeof ${f} == "string"`,()=>(function(){let r=function(){var e;let t={},r=s(d),a=!0;for(let t=0;t<c.length;t++){let d=c[t];if((null==d?void 0:d.$ref)&&!(0,o.schemaHasRulesButRef)(d,u.self.RULES)){let e=d.$ref;if((d=i.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof i.SchemaEnv&&(d=d.schema),void 0===d)throw new n.default(u.opts.uriResolver,u.baseId,e)}let p=null==(e=null==d?void 0:d.properties)?void 0:e[h];if("object"!=typeof p)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);a=a&&(r||s(d)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}(p,t)}if(!a)throw Error(`discriminator: "${h}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(h)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${h}" values must be unique strings`);t[e]=r}}();for(let s in t.if(!1),r)t.elseIf((0,a._)`${f} === ${s}`),t.assign(p,function(r){let s=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},s);return e.mergeEvaluated(i,a.Name),s}(r[s]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:f,tagName:h}),t.endIf()})(),()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:f,tagName:h})),e.ok(p)}}},6308(e,t){var r,a;t.DiscrError=void 0,(a=r||(t.DiscrError=r={})).Tag="tag",a.Mapping="mapping"},11888(e,t,r){let a=r(96944),s=r(28388),i=r(38026),n=r(44652),o=r(79057);t.default=[a.default,s.default,(0,i.default)(),n.default,o.metadataVocabulary,o.contentVocabulary]},25569(e,t,r){let a=r(52805);t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,a._)`{format: ${e}}`},code(e,t){let r,s,i,n,o,l,{gen:d,data:u,$data:c,schema:h,schemaCode:p,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(c?(r=d.scopeValue("formats",{ref:v.formats,code:m.code.formats}),s=d.const("fDef",(0,a._)`${r}[${p}]`),i=d.let("fType"),n=d.let("format"),d.if((0,a._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>d.assign(i,(0,a._)`${s}.type || "string"`).assign(n,(0,a._)`${s}.validate`),()=>d.assign(i,(0,a._)`"string"`).assign(n,s)),e.fail$data((0,a.or)(!1===m.strictSchema?a.nil:(0,a._)`${p} && !${n}`,(o=g.$async?(0,a._)`(${s}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,a._)`${n}(${u})`,l=(0,a._)`(typeof ${n} == "function" ? ${o} : ${n}.test(${u}))`,(0,a._)`${n} && ${n} !== true && ${i} === ${t} && !${l}`)))):function(){var r;let s,i,n=v.formats[h];if(!n){if(!1===m.strictSchema)return v.logger.warn(o());throw Error(o());function o(){return`unknown format "${h}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,c,p]=(s=(r=n)instanceof RegExp?(0,a.regexpCode)(r):m.code.formats?(0,a._)`${m.code.formats}${(0,a.getProperty)(h)}`:void 0,i=d.scopeValue("formats",{key:h,ref:r,code:s}),"object"!=typeof r||r instanceof RegExp?["string",r,i]:[r.type||"string",r.validate,(0,a._)`${i}.validate`]);l===t&&e.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,a._)`await ${p}(${u})`}return"function"==typeof c?(0,a._)`${p}(${u})`:(0,a._)`${p}.test(${u})`}())}())}}},44652(e,t,r){t.default=[r(25569).default]},79057(e,t){t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},21583(e,t,r){let a=r(52805),s=r(46531),i=r(45994);t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,a._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,a._)`!${(0,s.useFunc)(t,i.default)}(${r}, ${o})`):e.fail((0,a._)`${l} !== ${r}`)}}},65235(e,t,r){let a=r(52805),s=r(46531),i=r(45994);t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,a._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:n,data:o,$data:l,schema:d,schemaCode:u,it:c}=e;if(!l&&0===d.length)throw Error("enum must have non-empty array");let h=d.length>=c.opts.loopEnum,p=()=>null!=t?t:t=(0,s.useFunc)(n,i.default);if(h||l)r=n.let("valid"),e.block$data(r,function(){n.assign(r,!1),n.forOf("v",u,e=>n.if((0,a._)`${p()}(${o}, ${e})`,()=>n.assign(r,!0).break()))});else{if(!Array.isArray(d))throw Error("ajv implementation error");let e=n.const("vSchema",u);r=(0,a.or)(...d.map((t,r)=>{var s,i;let n;return s=e,"object"==typeof(n=d[i=r])&&null!==n?(0,a._)`${p()}(${o}, ${s}[${i}])`:(0,a._)`${o} === ${n}`}))}e.pass(r)}}},28388(e,t,r){let a=r(28090),s=r(62559),i=r(32491),n=r(19814),o=r(4230),l=r(91747),d=r(64891),u=r(6009),c=r(21583),h=r(65235);t.default=[a.default,s.default,i.default,n.default,o.default,l.default,d.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,h.default]},64891(e,t,r){let a=r(52805);t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxItems"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`${r}.length ${i} ${s}`)}}},32491(e,t,r){let a=r(52805),s=r(46531),i=r(21709);t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,l="maxLength"===t?a.operators.GT:a.operators.LT,d=!1===o.opts.unicode?(0,a._)`${r}.length`:(0,a._)`${(0,s.useFunc)(e.gen,i.default)}(${r})`;e.fail$data((0,a._)`${d} ${l} ${n}`)}}},28090(e,t,r){let a=r(52805),s=a.operators,i={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}};t.default={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e;e.fail$data((0,a._)`${r} ${i[t].fail} ${s} || isNaN(${r})`)}}},4230(e,t,r){let a=r(52805);t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxProperties"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`Object.keys(${r}).length ${i} ${s}`)}}},62559(e,t,r){let a=r(52805);t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,a._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:s,it:i}=e,n=i.opts.multipleOfPrecision,o=t.let("res"),l=n?(0,a._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,a._)`${o} !== parseInt(${o})`;e.fail$data((0,a._)`(${s} === 0 || (${o} = ${r}/${s}, ${l}))`)}}},19814(e,t,r){let a=r(44165),s=r(46531),i=r(52805);t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,i.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,i._)`{pattern: ${e}}`},code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:l,it:d}=e,u=d.opts.unicodeRegExp?"u":"";if(n){let{regExp:a}=d.opts.code,n="new RegExp"===a.code?(0,i._)`new RegExp`:(0,s.useFunc)(t,a),o=t.let("valid");t.try(()=>t.assign(o,(0,i._)`${n}(${l}, ${u}).test(${r})`),()=>t.assign(o,!1)),e.fail$data((0,i._)`!${o}`)}else{let t=(0,a.usePattern)(e,o);e.fail$data((0,i._)`!${t}.test(${r})`)}}}},91747(e,t,r){let a=r(44165),s=r(52805),i=r(46531);t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,s.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,s._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:l,it:d}=e,{opts:u}=d;if(!l&&0===r.length)return;let c=r.length>=u.loopRequired;if(d.allErrors?function(){if(c||l)e.block$data(s.nil,h);else for(let t of r)(0,a.checkReportMissingProp)(e,t)}():function(){let i=t.let("missing");if(c||l){let r=t.let("valid",!0);e.block$data(r,()=>{var l,d;return l=i,d=r,void(e.setParams({missingProperty:l}),t.forOf(l,n,()=>{t.assign(d,(0,a.propertyInData)(t,o,l,u.ownProperties)),t.if((0,s.not)(d),()=>{e.error(),t.break()})},s.nil))}),e.ok(r)}else t.if((0,a.checkMissingProp)(e,r,i)),(0,a.reportMissingProp)(e,i),t.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:a}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!a.has(e)){let t=d.schemaEnv.baseId+d.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,i.checkStrictMode)(d,r,d.opts.strictRequired)}}function h(){t.forOf("prop",n,r=>{e.setParams({missingProperty:r}),t.if((0,a.noPropertyInData)(t,o,r,u.ownProperties),()=>e.error())})}}}},6009(e,t,r){let a=r(36752),s=r(52805),i=r(46531),n=r(45994);t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,s.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,s._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:o,schema:l,parentSchema:d,schemaCode:u,it:c}=e;if(!o&&!l)return;let h=t.let("valid"),p=d.items?(0,a.getSchemaTypes)(d.items):[];e.block$data(h,function(){let o=t.let("i",(0,s._)`${r}.length`),l=t.let("j");e.setParams({i:o,j:l}),t.assign(h,!0),t.if((0,s._)`${o} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?function(i,n){let o=t.name("item"),l=(0,a.checkDataTypes)(p,o,c.opts.strictNumbers,a.DataType.Wrong),d=t.const("indices",(0,s._)`{}`);t.for((0,s._)`;${i}--;`,()=>{t.let(o,(0,s._)`${r}[${i}]`),t.if(l,(0,s._)`continue`),p.length>1&&t.if((0,s._)`typeof ${o} == "string"`,(0,s._)`${o} += "_"`),t.if((0,s._)`typeof ${d}[${o}] == "number"`,()=>{t.assign(n,(0,s._)`${d}[${o}]`),e.error(),t.assign(h,!1).break()}).code((0,s._)`${d}[${o}] = ${i}`)})}:function(a,o){let l=(0,i.useFunc)(t,n.default),d=t.name("outer");t.label(d).for((0,s._)`;${a}--;`,()=>t.for((0,s._)`${o} = ${a}; ${o}--;`,()=>t.if((0,s._)`${l}(${r}[${a}], ${r}[${o}])`,()=>{e.error(),t.assign(h,!1).break(d)})))})(o,l))},(0,s._)`${u} === false`),e.ok(h)}}},65733(e,t){function r(e,t){return{validate:e,compare:t}}t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,n),time:r(l(!0),d),"date-time":r(h(!0),p),"iso-time":r(l(),u),"iso-date-time":r(h(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return m.test(e)&&y.test(e)},"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:function(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},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:function(e){return g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=_&&e>=v}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:$},double:{type:"number",validate:$},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,n),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":r(/^\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,p),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":r(/^\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,f),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},t.formatNames=Object.keys(t.fullFormats);let a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){var t;let r=a.exec(e);if(!r)return!1;let i=+r[1],n=+r[2],o=+r[3];return n>=1&&n<=12&&o>=1&&o<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:s[n])}function n(e,t){if(e&&t)return e>t?1:e<t?-1:0}let o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(e){return function(t){let r=o.exec(t);if(!r)return!1;let a=+r[1],s=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,d=+(r[6]||0),u=+(r[7]||0);if(d>23||u>59||e&&!n)return!1;if(a<=23&&s<=59&&i<60)return!0;let c=s-u*l,h=a-d*l-(c<0);return(23===h||-1===h)&&(59===c||-1===c)&&i<61}}function d(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),a=new Date("2020-01-01T"+t).valueOf();if(r&&a)return r-a}function u(e,t){if(!(e&&t))return;let r=o.exec(e),a=o.exec(t);if(r&&a)return(e=r[1]+r[2]+r[3])>(t=a[1]+a[2]+a[3])?1:e<t?-1:0}let c=/t|\s/i;function h(e){let t=l(e);return function(e){let r=e.split(c);return 2===r.length&&i(r[0])&&t(r[1])}}function p(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),a=new Date(t).valueOf();if(r&&a)return r-a}function f(e,t){if(!(e&&t))return;let[r,a]=e.split(c),[s,i]=t.split(c),o=n(r,s);if(void 0!==o)return o||d(a,i)}let m=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,v=-0x80000000,_=0x80000000-1;function $(){return!0}let b=/[^\\]\\Z/},74421(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let a=r(65733),s=r(31038),i=r(17898),n=new i.Name("fullFormats"),o=new i.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return d(e,t,a.fullFormats,n),e;let[r,i]="fast"===t.mode?[a.fastFormats,o]:[a.fullFormats,n];return d(e,t.formats||a.formatNames,r,i),t.keywords&&(0,s.default)(e),e};function d(e,t,r,a){var s;for(let n of(null!=(s=e.opts.code).formats||(s.formats=(0,i._)`require("ajv-formats/dist/formats").${a}`),t))e.addFormat(n,r[n])}l.get=(e,t="full")=>{let r=("fast"===t?a.fastFormats:a.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l},31038(e,t,r){t.A=void 0;let a=r(11601),s=r(17898),i=s.operators,n={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}};t.A={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`should be ${n[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,s._)`{comparison: ${n[e].okStr}, limit: ${t}}`},code(e){let t,r,{gen:i,data:o,schemaCode:l,keyword:d,it:u}=e,{opts:c,self:h}=u;if(!c.validateFormats)return;let p=new a.KeywordCxt(u,h.RULES.all.format.definition,"format");function f(e){return(0,s._)`${e}.compare(${o}, ${l}) ${n[d].fail} 0`}p.$data?(t=i.scopeValue("formats",{ref:h.formats,code:c.code.formats}),r=i.const("fmt",(0,s._)`${t}[${p.schemaCode}]`),e.fail$data((0,s.or)((0,s._)`typeof ${r} != "object"`,(0,s._)`${r} instanceof RegExp`,(0,s._)`typeof ${r}.compare != "function"`,f(r)))):function(){let t=p.schema,r=h.formats[t];if(!r||!0===r)return;if("object"!=typeof r||r instanceof RegExp||"function"!=typeof r.compare)throw Error(`"${d}": format "${t}" does not define "compare" function`);let a=i.scopeValue("formats",{key:t,ref:r,code:c.code.formats?(0,s._)`${c.code.formats}${(0,s.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.A),e)},11601(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let a=r(65319),s=r(2431),i=r(11672),n=r(33928),o=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends a.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(n,o):n;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var u=r(96223);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=r(17898);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var h=r(95031);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var p=r(85748);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},83277(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=a;class s extends r{constructor(e){super(),this._items="string"==typeof e?[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 null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){let r=[e[0]],a=0;for(;a<t.length;)l(r,t[a]),r.push(e[++a]);return new s(r)}t._Code=s,t.nil=new s(""),t._=i;let n=new s("+");function o(e,...t){let r=[d(e[0])],i=0;for(;i<t.length;)r.push(n),l(r,t[i]),r.push(n,d(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){var r,s;let i=(r=e[t-1],'""'===(s=e[t+1])?r:'""'===r?s:"string"==typeof r?s instanceof a||'"'!==r[r.length-1]?void 0:"string"!=typeof s?`${r.slice(0,-1)}${s}"`:'"'===s[0]?r.slice(0,-1)+s.slice(1):void 0:"string"!=typeof s||'"'!==s[0]||r instanceof a?void 0:`"${r}${s.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(r),new s(r)}function l(e,t){var r;t instanceof s?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:d(Array.isArray(r)?r.join(","):r))}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new s(d(e))},t.safeStringify=d,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},17898(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let a=r(83277),s=r(76930);var i=r(83277);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var n=r(76930);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),t.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?s.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class d extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof a.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,e,t),this}get names(){return N(this.lhs instanceof a.Name?{}:{...this.lhs.names},this.rhs)}}class u extends d{constructor(e,t,r,a){super(e,r,a),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class c extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class p extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class m extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,a=r.length;for(;a--;){let s=r[a];s.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,s.names),r.splice(a,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>I(e,t.names),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class v extends y{}v.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(O(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){let e=super.names;return N(e,this.condition),this.else&&I(e,this.else.names),e}}_.kind="if";class $ extends y{}$.kind="for";class b extends ${constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return I(super.names,this.iteration.names)}}class w extends ${constructor(e,t,r,a){super(),this.varKind=e,this.name=t,this.from=r,this.to=a}render(e){let t=e.es5?s.varKinds.var:this.varKind,{name:r,from:a,to:i}=this;return`for(${t} ${r}=${a}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=N(super.names,this.from);return N(e,this.to)}}class k extends ${constructor(e,t,r,a){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return I(super.names,this.iterable.names)}}class x extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class S extends m{render(e){return"return "+super.render(e)}}S.kind="return";class E extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,a;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(a=this.finally)||a.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&I(e,this.catch.names),this.finally&&I(e,this.finally.names),e}}class T extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}T.kind="catch";class P extends y{render(e){return"finally"+super.render(e)}}function I(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function N(e,t){return t instanceof a._CodeOrName?I(e,t.names):e}function j(e,t,r){var s;if(e instanceof a.Name)return i(e);if(!((s=e)instanceof a._Code&&s._items.some(e=>e instanceof a.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new a._Code(e._items.reduce((e,t)=>(t instanceof a.Name&&(t=i(t)),t instanceof a._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let a=r[e.str];return void 0===a||1!==t[e.str]?e:(delete t[e.str],a)}}function O(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,a._)`!${R(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,a){let s=this._scope.toName(t);return void 0!==r&&a&&(this._constants[s.str]=r),this._leafNode(new l(e,s,r)),s}const(e,t,r){return this._def(s.varKinds.const,e,t,r)}let(e,t,r){return this._def(s.varKinds.let,e,t,r)}var(e,t,r){return this._def(s.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new d(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==a.nil&&this._leafNode(new f(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,a.addCodeArg)(t,s));return t.push("}"),new a._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(_,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,r,a,i=this.opts.es5?s.varKinds.var:s.varKinds.let){let n=this._scope.toName(e);return this._for(new w(i,n,t,r),()=>a(n))}forOf(e,t,r,i=s.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let e=t instanceof a.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,a._)`${e}.length`,t=>{this.var(n,(0,a._)`${e}[${t}]`),r(n)})}return this._for(new k("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?s.varKinds.var:s.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,a._)`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new k("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode($)}label(e){return this._leafNode(new c(e))}break(e){return this._leafNode(new h(e))}return(e){let t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let a=new E;if(this._blockNode(a),this.code(e),t){let e=this.name("e");this._currNode=a.catch=new T(e),t(e)}return r&&(this._currNode=a.finally=new P,this.code(r)),this._endBlockNode(T,P)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=a.nil,r,s){return this._blockNode(new x(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(x)}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,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}},t.not=O;let z=A(t.operators.AND);t.and=function(...e){return e.reduce(z)};let C=A(t.operators.OR);function A(e){return(t,r)=>t===a.nil?r:r===a.nil?t:(0,a._)`${R(t)} ${e} ${R(r)}`}function R(e){return e instanceof a.Name?e:(0,a._)`(${e})`}t.or=function(...e){return e.reduce(C)}},76930(e,t,r){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r(83277);class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(s=a||(t.UsedValueState=a={}))[s.Started=0]="Started",s[s.Completed=1]="Completed",t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class l extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=l;let d=(0,i._)`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?d:i.nil}}get(){return this._scope}name(e){return new l(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,i=null!=(r=t.key)?r:t.ref,n=this._values[s];if(n){let e=n.get(i);if(e)return e}else n=this._values[s]=new Map;n.set(i,a);let o=this._scope[s]||(this._scope[s]=[]),l=o.length;return o[l]=t.ref,a.setValue(t,{property:s,itemIndex:l}),a}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},o){let l=i.nil;for(let d in e){let u=e[d];if(!u)continue;let c=s[d]=s[d]||new Map;u.forEach(e=>{if(c.has(e))return;c.set(e,a.Started);let s=r(e);if(s){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=(0,i._)`${l}${r} ${e} = ${s};${this.opts._n}`}else if(s=null==o?void 0:o(e))l=(0,i._)`${l}${s}${this.opts._n}`;else throw new n(e);c.set(e,a.Completed)})}return l}}},49409(e,t,r){t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.y=void 0;let a=r(17898),s=r(50458),i=r(63036);function n(e,t){let r=e.const("err",t);e.if((0,a._)`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,(0,a._)`[${r}]`),(0,a._)`${i.default.vErrors}.push(${r})`),e.code((0,a._)`${i.default.errors}++`)}function o(e,t){let{gen:r,validateName:s,schemaEnv:i}=e;i.$async?r.throw((0,a._)`new ${e.ValidationError}(${t})`):(r.assign((0,a._)`${s}.errors`,t),r.return(!1))}t.y={message:({keyword:e})=>(0,a.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,a.str)`"${e}" keyword must be ${t} ($data)`:(0,a.str)`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.y,s,i){let{it:l}=e,{gen:u,compositeRule:c,allErrors:h}=l,p=d(e,r,s);(null!=i?i:c||h)?n(u,p):o(l,(0,a._)`[${p}]`)},t.reportExtraError=function(e,r=t.y,a){let{it:s}=e,{gen:l,compositeRule:u,allErrors:c}=s;n(l,d(e,r,a)),u||c||o(s,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if((0,a._)`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,a._)`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:n,it:o}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,i.default.errors,n=>{e.const(l,(0,a._)`${i.default.vErrors}[${n}]`),e.if((0,a._)`${l}.instancePath === undefined`,()=>e.assign((0,a._)`${l}.instancePath`,(0,a.strConcat)(i.default.instancePath,o.errorPath))),e.assign((0,a._)`${l}.schemaPath`,(0,a.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,a._)`${l}.schema`,r),e.assign((0,a._)`${l}.data`,s))})};let l={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function d(e,t,r){let{createErrors:n}=e.it;return!1===n?(0,a._)`{}`:function(e,t,r={}){let{gen:n,it:o}=e,d=[function({errorPath:e},{instancePath:t}){let r=t?(0,a.str)`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,r)]}(o,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,a.str)`${t}/${e}`;return r&&(n=(0,a.str)`${n}${(0,s.getErrorPath)(r,s.Type.Str)}`),[l.schemaPath,n]}(e,r)];return function(e,{params:t,message:r},s){let{keyword:n,data:o,schemaValue:d,it:u}=e,{opts:c,propertyName:h,topSchemaRef:p,schemaPath:f}=u;s.push([l.keyword,n],[l.params,"function"==typeof t?t(e):t||(0,a._)`{}`]),c.messages&&s.push([l.message,"function"==typeof r?r(e):r]),c.verbose&&s.push([l.schema,d],[l.parentSchema,(0,a._)`${p}${f}`],[i.default.data,o]),h&&s.push([l.propertyName,h])}(e,t,d),n.object(...d)}(e,t,r)}},49392(e,t,r){t.resolveSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let a=r(17898),s=r(95031),i=r(63036),n=r(14856),o=r(50458),l=r(96223);class d{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,n.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){let t,r,o=h.call(this,e);if(o)return o;let d=(0,n.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:u,lines:c}=this.opts.code,{ownProperties:p}=this.opts,f=new a.CodeGen(this.scope,{es5:u,lines:c,ownProperties:p});e.$async&&(t=f.scopeValue("Error",{ref:s.default,code:(0,a._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let y={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[a.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,a.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:d,baseId:e.baseId||d,schemaPath:a.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,a._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,l.validateFunctionCode)(y),f.optimize(this.opts.code.optimize);let t=f.toString();r=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let s=Function(`${i.default.self}`,`${i.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:s}),s.errors=null,s.schema=e.schema,s.schemaEnv=e,e.$async&&(s.$async=!0),!0===this.opts.code.source&&(s.source={validateName:m,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:t}=y;s.evaluated={props:e instanceof a.Name?void 0:e,items:t instanceof a.Name?void 0:t,dynamicProps:e instanceof a.Name,dynamicItems:t instanceof a.Name},s.source&&(s.source.evaluated=(0,a.stringify)(s.evaluated))}return e.validate=s,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function c(e){return(0,n.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(let a of this._compilations){var t,r;if(t=a,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return a}}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||f.call(this,e,t)}function f(e,t){let r=this.opts.uriResolver.parse(t),a=(0,n._getFullPath)(this.opts.uriResolver,r),s=(0,n.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===s)return y.call(this,r,e);let i=(0,n.normalizeId)(a),o=this.refs[i]||this.schemas[i];if("string"==typeof o){let t=f.call(this,e,o);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==o?void 0:o.schema)){if(o.validate||u.call(this,o),i===(0,n.normalizeId)(t)){let{schema:t}=o,{schemaId:r}=this.opts,a=t[r];return a&&(s=(0,n.resolveUrl)(this.opts.uriResolver,s,a)),new d({schema:t,schemaId:r,root:e,baseId:s})}return y.call(this,r,o)}}t.SchemaEnv=d,t.compileSchema=u,t.resolveRef=function(e,t,r){var a;r=(0,n.resolveUrl)(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let i=p.call(this,e,r);if(void 0===i){let s=null==(a=e.localRefs)?void 0:a[r],{schemaId:n}=this.opts;s&&(i=new d({schema:s,schemaId:n,root:e,baseId:t}))}if(void 0!==i)return e.refs[r]=c.call(this,i)},t.resolveSchema=f;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:a}){var s;let i;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,o.unescapeFragment)(a)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(a)&&s&&(t=(0,n.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){let e=(0,n.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=f.call(this,a,e)}let{schemaId:l}=this.opts;if((i=i||new d({schema:r,schemaId:l,root:a,baseId:t})).schema!==i.root.schema)return i}},63036(e,t,r){let a=r(17898);t.default={data:new a.Name("data"),valCxt:new a.Name("valCxt"),instancePath:new a.Name("instancePath"),parentData:new a.Name("parentData"),parentDataProperty:new a.Name("parentDataProperty"),rootData:new a.Name("rootData"),dynamicAnchors:new a.Name("dynamicAnchors"),vErrors:new a.Name("vErrors"),errors:new a.Name("errors"),this:new a.Name("this"),self:new a.Name("self"),scope:new a.Name("scope"),json:new a.Name("json"),jsonPos:new a.Name("jsonPos"),jsonLen:new a.Name("jsonLen"),jsonPart:new a.Name("jsonPart")}},85748(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let a=r(14856);t.default=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,a.resolveUrl)(e,t,r),this.missingSchema=(0,a.normalizeId)((0,a.getFullPath)(e,this.missingRef))}}},14856(e,t,r){t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let a=r(50458),s=r(38792),i=r(1645),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!function e(t){for(let r in t){if(o.has(r))return!0;let a=t[r];if(Array.isArray(a)&&a.some(e)||"object"==typeof a&&e(a))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let s in t)if("$ref"===s||(r++,!n.has(s)&&("object"==typeof t[s]&&(0,a.eachItem)(t[s],t=>r+=e(t)),r===1/0)))return 1/0;return r}(e)<=t)};let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e,t="",r){!1!==r&&(t=c(t));let a=e.parse(t);return d(e,a)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=d;let u=/#\/?$/;function c(e){return e?e.replace(u,""):""}t.normalizeId=c,t.resolveUrl=function(e,t,r){return r=c(r),e.resolve(t,r)};let h=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:a}=this.opts,n=c(e[r]||t),o={"":n},d=l(a,n,!1),u={},p=new Set;return i(e,{allKeys:!0},(e,t,a,s)=>{if(void 0===s)return;let i=d+t,n=o[s];function l(t){let r=this.opts.uriResolver.resolve;if(t=c(n?r(n,t):t),p.has(t))throw m(t);p.add(t);let a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?f(e,a.schema,t):t!==c(i)&&("#"===t[0]?(f(e,u[t],t),u[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!h.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(n=l.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),o[t]=n}),u;function f(e,t,r){if(void 0!==t&&!s(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},90383(e,t){t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},50458(e,t,r){var a,s;t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r(17898),n=r(83277);function o(e,t=e.schema){let{opts:r,self:a}=e;if(!r.strictSchema||"boolean"==typeof t)return;let s=a.RULES.keywords;for(let r in t)s[r]||f(e,`unknown keyword: "${r}"`)}function l(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function d(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,n,o,l)=>{let d=void 0===o?n:o instanceof i.Name?(n instanceof i.Name?e(s,n,o):t(s,n,o),o):n instanceof i.Name?(t(s,o,n),n):r(n,o);return l!==i.Name||d instanceof i.Name?d:a(s,d)}}function c(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&h(e,r,t),r}function h(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(a)}`},t.unescapeFragment=function(e){return d(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(l(e))},t.unescapeJsonPointer=d,t.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),h(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:u({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=c;let p={};function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new n._Code(t.code))})},(s=a||(t.Type=a={}))[s.Num=0]="Num",s[s.Str=1]="Str",t.getErrorPath=function(e,t,r){if(e instanceof i.Name){let s=t===a.Num;return r?s?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:s?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+l(e)},t.checkStrictMode=f},74758(e,t){function r(e,t){return t.rules.some(t=>a(e,t))}function a(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},a){let s=t.RULES.types[a];return s&&!0!==s&&r(e,s)},t.shouldUseGroup=r,t.shouldUseRule=a},15948(e,t,r){t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let a=r(49409),s=r(17898),i=r(63036),n={message:"boolean schema is false"};function o(e,t){let{gen:r,data:s}=e;(0,a.reportError)({gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},n,void 0,t)}t.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:a}=e;!1===r?o(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign((0,s._)`${a}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){let{gen:r,schema:a}=e;!1===a?(r.var(t,!1),o(e)):r.var(t,!0)}},69003(e,t,r){var a,s;t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r(90383),n=r(74758),o=r(49409),l=r(17898),d=r(50458);function u(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(s=a||(t.DataType=a={}))[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong",t.getSchemaTypes=function(e){let t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){var r,s;let{gen:i,data:o,opts:d}=e,u=(r=t,(s=d.coerceTypes)?r.filter(e=>c.has(e)||"array"===s&&"array"===e):[]),h=t.length>0&&!(0===u.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(h){let r=p(t,o,d.strictNumbers,a.Wrong);i.if(r,()=>{u.length?function(e,t,r){let{gen:a,data:s,opts:i}=e,n=a.let("dataType",(0,l._)`typeof ${s}`),o=a.let("coerced",(0,l._)`undefined`);for(let e of("array"===i.coerceTypes&&a.if((0,l._)`${n} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>a.assign(s,(0,l._)`${s}[0]`).assign(n,(0,l._)`typeof ${s}`).if(p(t,s,i.strictNumbers),()=>a.assign(o,s))),a.if((0,l._)`${o} !== undefined`),r))(c.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":a.elseIf((0,l._)`${n} == "number" || ${n} == "boolean"`).assign(o,(0,l._)`"" + ${s}`).elseIf((0,l._)`${s} === null`).assign(o,(0,l._)`""`);return;case"number":a.elseIf((0,l._)`${n} == "boolean" || ${s} === null
|
|
8
|
+
|| (${n} == "string" && ${s} && ${s} == +${s})`).assign(o,(0,l._)`+${s}`);return;case"integer":a.elseIf((0,l._)`${n} === "boolean" || ${s} === null
|
|
9
|
+
|| (${n} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(o,(0,l._)`+${s}`);return;case"boolean":a.elseIf((0,l._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(o,!1).elseIf((0,l._)`${s} === "true" || ${s} === 1`).assign(o,!0);return;case"null":a.elseIf((0,l._)`${s} === "" || ${s} === 0 || ${s} === false`),a.assign(o,null);return;case"array":a.elseIf((0,l._)`${n} === "string" || ${n} === "number"
|
|
10
|
+
|| ${n} === "boolean" || ${s} === null`).assign(o,(0,l._)`[${s}]`)}}(e);a.else(),m(e),a.endIf(),a.if((0,l._)`${o} !== undefined`,()=>{a.assign(s,o),function({gen:e,parentData:t,parentDataProperty:r},a){e.if((0,l._)`${t} !== undefined`,()=>e.assign((0,l._)`${t}[${r}]`,a))}(e,o)})}(e,t,u):m(e)})}return h};let c=new Set(["string","number","integer","boolean","null"]);function h(e,t,r,s=a.Correct){let i,n=s===a.Correct?l.operators.EQ:l.operators.NEQ;switch(e){case"null":return(0,l._)`${t} ${n} null`;case"array":i=(0,l._)`Array.isArray(${t})`;break;case"object":i=(0,l._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o((0,l._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return(0,l._)`typeof ${t} ${n} ${e}`}return s===a.Correct?i:(0,l.not)(i);function o(e=l.nil){return(0,l.and)((0,l._)`typeof ${t} == "number"`,e,r?(0,l._)`isFinite(${t})`:l.nil)}}function p(e,t,r,a){let s;if(1===e.length)return h(e[0],t,r,a);let i=(0,d.toHash)(e);if(i.array&&i.object){let e=(0,l._)`typeof ${t} != "object"`;s=i.null?e:(0,l._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=l.nil;for(let e in i.number&&delete i.integer,i)s=(0,l.and)(s,h(e,t,r,a));return s}t.checkDataType=h,t.checkDataTypes=p;let f={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,l._)`{type: ${e}}`:(0,l._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:a}=e,s=(0,d.schemaRefOrVal)(e,a,"type");return{gen:t,keyword:"type",data:r,schema:a.type,schemaCode:s,schemaValue:s,parentSchema:a,params:{},it:e}}(e);(0,o.reportError)(t,f)}t.reportTypeError=m},96841(e,t,r){t.assignDefaults=void 0;let a=r(17898),s=r(50458);function i(e,t,r){let{gen:i,compositeRule:n,data:o,opts:l}=e;if(void 0===r)return;let d=(0,a._)`${o}${(0,a.getProperty)(t)}`;if(n)return void(0,s.checkStrictMode)(e,`default is ignored for: ${d}`);let u=(0,a._)`${d} === undefined`;"empty"===l.useDefaults&&(u=(0,a._)`${u} || ${d} === null || ${d} === ""`),i.if(u,(0,a._)`${d} = ${(0,a.stringify)(r)}`)}t.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>i(e,r,t.default))}},96223(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let a=r(15948),s=r(69003),i=r(74758),n=r(69003),o=r(96841),l=r(49348),d=r(53322),u=r(17898),c=r(63036),h=r(14856),p=r(50458),f=r(49409);function m({gen:e,validateName:t,schema:r,schemaEnv:a,opts:s},i){var n;s.code.es5?e.func(t,(0,u._)`${c.default.data}, ${c.default.valCxt}`,a.$async,()=>{var t,a;e.code((0,u._)`"use strict"; ${y(r,s)}`),t=e,a=s,t.if(c.default.valCxt,()=>{t.var(c.default.instancePath,(0,u._)`${c.default.valCxt}.${c.default.instancePath}`),t.var(c.default.parentData,(0,u._)`${c.default.valCxt}.${c.default.parentData}`),t.var(c.default.parentDataProperty,(0,u._)`${c.default.valCxt}.${c.default.parentDataProperty}`),t.var(c.default.rootData,(0,u._)`${c.default.valCxt}.${c.default.rootData}`),a.dynamicRef&&t.var(c.default.dynamicAnchors,(0,u._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{t.var(c.default.instancePath,(0,u._)`""`),t.var(c.default.parentData,(0,u._)`undefined`),t.var(c.default.parentDataProperty,(0,u._)`undefined`),t.var(c.default.rootData,c.default.data),a.dynamicRef&&t.var(c.default.dynamicAnchors,(0,u._)`{}`)}),e.code(i)}):e.func(t,(0,u._)`${c.default.data}, ${(n=s,(0,u._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${n.dynamicRef?(0,u._)`, ${c.default.dynamicAnchors}={}`:u.nil}}={}`)}`,a.$async,()=>e.code(y(r,s)).code(i))}function y(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,u._)`/*# sourceURL=${r} */`:u.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function _(e){(0,p.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:a,self:s}=e;t.$ref&&a.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function $(e,t){if(e.opts.jtd)return w(e,[],!1,t);let r=(0,s.getSchemaTypes)(e.schema),a=(0,s.coerceAndCheckDataType)(e,r);w(e,r,!a,t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:a,opts:s}){let i=r.$comment;if(!0===s.$comment)e.code((0,u._)`${c.default.self}.logger.log(${i})`);else if("function"==typeof s.$comment){let r=(0,u.str)`${a}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,u._)`${c.default.self}.opts.$comment(${i}, ${r}, ${s}.schema)`)}}function w(e,t,r,a){var s,o,l,d;let{gen:h,schema:f,data:m,allErrors:y,opts:g,self:v}=e,{RULES:_}=v;if(f.$ref&&(g.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(f,_)))return void h.block(()=>T(e,"$ref",_.all.$ref.definition));function $(s){(0,i.shouldUseGroup)(f,s)&&(s.type?(h.if((0,n.checkDataType)(s.type,m,g.strictNumbers)),k(e,s),1===t.length&&t[0]===s.type&&r&&(h.else(),(0,n.reportTypeError)(e)),h.endIf()):k(e,s),y||h.if((0,u._)`${c.default.errors} === ${a||0}`))}g.jtd||(s=e,o=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{x(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let a of e.dataTypes)x(t,a)?r.push(a):t.includes("integer")&&"number"===a&&r.push("integer");e.dataTypes=r}(e,t)}}(s,o),s.opts.allowUnionTypes||(l=s,(d=o).length>1&&!(2===d.length&&d.includes("null"))&&S(l,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let s=r[a];if("object"==typeof s&&(0,i.shouldUseRule)(e.schema,s)){let{type:r}=s.definition;r.length&&!r.some(e=>{var r,a;return r=t,a=e,r.includes(a)||"number"===a&&r.includes("integer")})&&S(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),h.block(()=>{for(let e of _.rules)$(e);$(_.post)})}function k(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,i.shouldUseRule)(a,r)&&T(e,r.keyword,r.definition,t.type)})}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(_(e),g(e))?function(e){let{schema:t,opts:r,gen:a}=e;m(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),a.let(c.default.vErrors,null),a.let(c.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,u._)`${r}.evaluated`),t.if((0,u._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,u._)`${e.evaluated}.props`,(0,u._)`undefined`)),t.if((0,u._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,u._)`${e.evaluated}.items`,(0,u._)`undefined`))}(e),$(e),function(e){let{gen:t,schemaEnv:r,validateName:a,ValidationError:s,opts:i}=e;r.$async?t.if((0,u._)`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw((0,u._)`new ${s}(${c.default.vErrors})`)):(t.assign((0,u._)`${a}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:a}){r instanceof u.Name&&e.assign((0,u._)`${t}.props`,r),a instanceof u.Name&&e.assign((0,u._)`${t}.items`,a)}(e),t.return((0,u._)`${c.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,a.topBoolOrEmptySchema)(e))};class E{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e){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:t}=this;this.fail((0,u._)`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;let{gen:r,schemaCode:a,schemaType:s,def:i}=this;r.if((0,u.or)((0,u._)`${a} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(s.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:a,it:s}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,u._)`${(0,n.checkDataTypes)(e,t,s.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}(),function(){if(a.validateSchema){let r=e.scopeValue("validate$data",{ref:a.validateSchema});return(0,u._)`!${r}(${t})`}return u.nil}())}subschema(e,t){let r=(0,d.getSubschema)(this.it,e);(0,d.extendSubschemaData)(r,this.it,e),(0,d.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(v(e)&&(_(e),g(e)))return function(e,t){var r;let a,{schema:s,gen:i,opts:n}=e;n.$comment&&s.$comment&&b(e),(a=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,h.resolveUrl)(r.opts.uriResolver,r.baseId,a)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let o=i.const("_errs",c.default.errors);$(e,o),i.var(t,(0,u._)`${o} === ${c.default.errors}`)}(e,t);(0,a.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){let{it:r,gen:a}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=p.mergeEvaluated.props(a,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=p.mergeEvaluated.items(a,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:a}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return a.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function T(e,t,r,a){let s=new E(e,r,t);"code"in r?r.code(s,a):s.$data&&r.validate?(0,l.funcKeywordCode)(s,r):"macro"in r?(0,l.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(s,r)}t.KeywordCxt=E;let P=/^\/(?:[^~]|~0|~1)*$/,I=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:r,dataPathArr:a}){let s,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!P.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,i=c.default.rootData}else{let n=I.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(s=n[2])){if(l>=t)throw Error(o("property/index",l));return a[t-l]}if(l>t)throw Error(o("data",l));if(i=r[t-l],!s)return i}let n=i;for(let e of s.split("/"))e&&(i=(0,u._)`${i}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,n=(0,u._)`${n} && ${i}`);return n;function o(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=N},49348(e,t,r){t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let a=r(17898),s=r(63036),i=r(94450),n=r(49409);function o(e){let{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,(0,a._)`${s.parentData}[${s.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,a.stringify)(r)})}t.macroKeywordCode=function(e,t){let{gen:r,keyword:s,schema:i,parentSchema:n,it:o}=e,d=t.macro.call(o.self,i,n,o),u=l(r,s,d);!1!==o.opts.validateSchema&&o.self.validateSchema(d,!0);let c=r.name("valid");e.subschema({schema:d,schemaPath:a.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;let{gen:d,keyword:u,schema:c,parentSchema:h,$data:p,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,t);let m=l(d,u,!p&&t.compile?t.compile.call(f.self,c,h,f):t.validate),y=d.let("valid");function g(r=t.async?(0,a._)`await `:a.nil){let n=f.opts.passContext?s.default.this:s.default.self,o=!("compile"in t&&!p||!1===t.schema);d.assign(y,(0,a._)`${r}${(0,i.callValidateCode)(e,m,n,o)}`,t.modifying)}function v(e){var r;d.if((0,a.not)(null!=(r=t.valid)?r:y),e)}e.block$data(y,function(){if(!1===t.errors)g(),t.modifying&&o(e),v(()=>e.error());else{let r,i,l=t.async?(r=d.let("ruleErrs",null),d.try(()=>g((0,a._)`await `),e=>d.assign(y,!1).if((0,a._)`${e} instanceof ${f.ValidationError}`,()=>d.assign(r,(0,a._)`${e}.errors`),()=>d.throw(e))),r):(i=(0,a._)`${m}.errors`,d.assign(i,null),g(a.nil),i);t.modifying&&o(e),v(()=>(function(e,t){let{gen:r}=e;r.if((0,a._)`Array.isArray(${t})`,()=>{r.assign(s.default.vErrors,(0,a._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,(0,a._)`${s.default.vErrors}.length`),(0,n.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(r=t.valid)?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:a},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw Error("ajv implementation error");let n=s.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${n.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${a}": `+r.errorsText(s.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},53322(e,t,r){t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let a=r(17898),s=r(50458);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let i=e.schema[t];return void 0===r?{schema:i,schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}${(0,a.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===n||void 0===o||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:l}){if(void 0!==n&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:d}=t;if(void 0!==r){let{errorPath:n,dataPathArr:o,opts:l}=t;u(d.let("data",(0,a._)`${t.data}${(0,a.getProperty)(r)}`,!0)),e.errorPath=(0,a.str)`${n}${(0,s.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,a._)`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==n&&(u(n instanceof a.Name?n:d.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),o&&(e.dataTypes=o)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:a,createErrors:s,allErrors:i}){void 0!==a&&(e.compositeRule=a),void 0!==s&&(e.createErrors=s),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},65319(e,t,r){r(96223),r(17898);let a=r(95031),s=r(85748),i=r(90383),n=r(49392),o=r(17898),l=r(14856),d=r(69003),u=r(50458),c=r(93770),h=r(7903),p=(e,t)=>new RegExp(e,t);p.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class v{constructor(e={}){var t,r,a,s,n,l,d,u,c,f,v,$,E,T,P,I,N,j,O,z,C,A,R,Z,M,q;let D,V,F,L,U;this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(D=(t=e).strict,F=!0===(V=null==(r=t.code)?void 0:r.optimize)||void 0===V?1:V||0,L=null!=(s=null==(a=t.code)?void 0:a.regExp)?s:p,U=null!=(n=t.uriResolver)?n:h.default,{strictSchema:null==(d=null!=(l=t.strictSchema)?l:D)||d,strictNumbers:null==(c=null!=(u=t.strictNumbers)?u:D)||c,strictTypes:null!=(v=null!=(f=t.strictTypes)?f:D)?v:"log",strictTuples:null!=(E=null!=($=t.strictTuples)?$:D)?E:"log",strictRequired:null!=(P=null!=(T=t.strictRequired)?T:D)&&P,code:t.code?{...t.code,optimize:F,regExp:L}:{optimize:F,regExp:L},loopRequired:null!=(I=t.loopRequired)?I:200,loopEnum:null!=(N=t.loopEnum)?N:200,meta:null==(j=t.meta)||j,messages:null==(O=t.messages)||O,inlineRefs:null==(z=t.inlineRefs)||z,schemaId:null!=(C=t.schemaId)?C:"$id",addUsedSchema:null==(A=t.addUsedSchema)||A,validateSchema:null==(R=t.validateSchema)||R,validateFormats:null==(Z=t.validateFormats)||Z,unicodeRegExp:null==(M=t.unicodeRegExp)||M,int32range:null==(q=t.int32range)||q,uriResolver:U})};let{es5:K,lines:Y}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:m,es5:K,lines:Y}),this.logger=function(e){if(!1===e)return S;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);let H=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),_.call(this,y,e,"NOT SUPPORTED"),_.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=x.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&k.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),b.call(this),e.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,a=c;"id"===r&&((a={...c}).id=a.$id,delete a.$id),t&&e&&this.addMetaSchema(a,a[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let a=r(t);return"$async"in r||(this.errors=r.errors),a}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return a.call(this,e,t);async function a(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await a.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return o.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function o({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await d.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function d(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,a=this.opts.validateSchema){let s;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,a);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(s=e[t])&&"string"!=typeof s)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,a,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(r,e);if(!a&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return a}getSchema(e){let t;for(;"string"==typeof(t=$.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,a=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.resolveSchema.call(this,a,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=$.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(T.call(this,r,t),!t)return(0,u.eachItem)(r,e=>P.call(this,e)),this;N.call(this,t);let a={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===a.type.length?e=>P.call(this,e,a):e=>a.type.forEach(t=>P.call(this,e,a,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let a of(e=JSON.parse(JSON.stringify(e)),t)){let t=a.split("/").slice(1),s=e;for(let e of t)s=s[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:a}=t.definition,i=s[e];a&&i&&(s[e]=O(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let a=e[r];(!t||t.test(r))&&("string"==typeof a?delete e[r]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[r]))}}_addSchema(e,t,r,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if("object"==typeof e)i=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let d=this._cache.get(e);if(void 0!==d)return d;r=(0,l.normalizeId)(i||r);let u=l.getSchemaRefs.call(this,e,r);return d=new n.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:u}),this._cache.set(d.schema,d),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=d),a&&this.validateSchema(e,!0),d}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):n.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{n.compileSchema.call(this,e)}finally{this.opts=t}}}function _(e,t,r,a="error"){for(let s in e)s in t&&this.logger[a](`${r}: option ${s}. ${e[s]}`)}function $(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function b(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function w(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function k(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function x(){let e={...this.opts};for(let t of f)delete e[t];return e}v.ValidationError=a.default,v.MissingRefError=s.default,t.default=v;let S={log(){},warn(){},error(){}},E=/^[a-z_$][a-z0-9_$:-]*$/i;function T(e,t){let{RULES:r}=this;if((0,u.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!E.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function P(e,t,r){var a;let s=null==t?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,n=s?i.post:i.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},i.rules.push(n)),i.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?I.call(this,n,o,t.before):n.rules.push(o),i.all[e]=o,null==(a=t.implements)||a.forEach(e=>this.addKeyword(e))}function I(e,t,r){let a=e.rules.findIndex(e=>e.keyword===r);a>=0?e.rules.splice(a,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function N(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}let j={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,j]}}},72725(e,t,r){let a=r(38792);a.code='require("ajv/dist/runtime/equal").default',t.default=a},26308(e,t){function r(e){let t,r=e.length,a=0,s=0;for(;s<r;)a++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<r&&(64512&(t=e.charCodeAt(s)))==56320&&s++;return a}t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},7903(e,t,r){let a=r(47073);a.code='require("ajv/dist/runtime/uri").default',t.default=a},95031(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}},93426(e,t,r){t.validateAdditionalItems=void 0;let a=r(17898),s=r(50458);function i(e,t){let{gen:r,schema:i,data:n,keyword:o,it:l}=e;l.items=!0;let d=r.const("len",(0,a._)`${n}.length`);if(!1===i)e.setParams({len:t.length}),e.pass((0,a._)`${d} <= ${t.length}`);else if("object"==typeof i&&!(0,s.alwaysValidSchema)(l,i)){let i=r.var("valid",(0,a._)`${d} <= ${t.length}`);r.if((0,a.not)(i),()=>{var n;return n=i,void r.forRange("i",t.length,d,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:s.Type.Num},n),l.allErrors||r.if((0,a.not)(n),()=>r.break())})}),e.ok(i)}}t.validateAdditionalItems=i,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;Array.isArray(a)?i(e,a):(0,s.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},92697(e,t,r){let a=r(94450),s=r(17898),i=r(63036),n=r(50458);t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,s._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:o,data:l,errsCount:d,it:u}=e;if(!d)throw Error("ajv implementation error");let{allErrors:c,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,n.alwaysValidSchema)(u,r))return;let p=(0,a.allSchemaProperties)(o.properties),f=(0,a.allSchemaProperties)(o.patternProperties);function m(e){t.code((0,s._)`delete ${l}[${e}]`)}function y(a){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)return void m(a);if(!1===r){e.setParams({additionalProperty:a}),e.error(),c||t.break();return}if("object"==typeof r&&!(0,n.alwaysValidSchema)(u,r)){let r=t.name("valid");"failing"===h.removeAdditional?(g(a,r,!1),t.if((0,s.not)(r),()=>{e.reset(),m(a)})):(g(a,r),c||t.if((0,s.not)(r),()=>t.break()))}}function g(t,r,a){let s={keyword:"additionalProperties",dataProp:t,dataPropType:n.Type.Str};!1===a&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,r)}t.forIn("key",l,r=>{p.length||f.length?t.if(function(r){let i;if(p.length>8){let e=(0,n.schemaRefOrVal)(u,o.properties,"properties");i=(0,a.isOwnProperty)(t,e,r)}else i=p.length?(0,s.or)(...p.map(e=>(0,s._)`${r} === ${e}`)):s.nil;return f.length&&(i=(0,s.or)(i,...f.map(t=>(0,s._)`${(0,a.usePattern)(e,t)}.test(${r})`))),(0,s.not)(i)}(r),()=>y(r)):y(r)}),e.ok((0,s._)`${d} === ${i.default.errors}`)}}},79355(e,t,r){let a=r(50458);t.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((t,r)=>{if((0,a.alwaysValidSchema)(s,t))return;let n=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(n)})}}},19430(e,t,r){t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(94450).validateUnion,error:{message:"must match a schema in anyOf"}}},35724(e,t,r){let a=r(17898),s=r(50458);t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,a.str)`must contain at least ${e} valid item(s)`:(0,a.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,a._)`{minContains: ${e}}`:(0,a._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:i,schema:n,parentSchema:o,data:l,it:d}=e,{minContains:u,maxContains:c}=o;d.opts.next?(t=void 0===u?1:u,r=c):t=1;let h=i.const("len",(0,a._)`${l}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,s.checkStrictMode)(d,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==r&&t>r){(0,s.checkStrictMode)(d,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,s.alwaysValidSchema)(d,n)){let s=(0,a._)`${h} >= ${t}`;void 0!==r&&(s=(0,a._)`${s} && ${h} <= ${r}`),e.pass(s);return}d.items=!0;let p=i.name("valid");function f(){let e=i.name("_valid"),s=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=s,void(i.code((0,a._)`${e}++`),void 0===r?i.if((0,a._)`${e} >= ${t}`,()=>i.assign(p,!0).break()):(i.if((0,a._)`${e} > ${r}`,()=>i.assign(p,!1).break()),1===t?i.assign(p,!0):i.if((0,a._)`${e} >= ${t}`,()=>i.assign(p,!0))))}))}function m(t,r){i.forRange("i",0,h,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:s.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(p,()=>i.if(p,()=>i.break())):0===t?(i.let(p,!0),void 0!==r&&i.if((0,a._)`${l}.length > 0`,f)):(i.let(p,!1),f()),e.result(p,()=>e.reset())}}},99868(e,t,r){t.z3=void 0;let a=r(17898),s=r(50458),i=r(94450);t.z3={message:({params:{property:e,depsCount:t,deps:r}})=>(0,a.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>(0,a._)`{property: ${e},
|
|
11
|
+
missingProperty: ${s},
|
|
12
|
+
depsCount: ${t},
|
|
13
|
+
deps: ${r}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.z3,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let a in e)"__proto__"!==a&&((Array.isArray(e[a])?t:r)[a]=e[a]);return[t,r]}(e);(function(e,t=e.schema){let{gen:r,data:s,it:n}=e;if(0===Object.keys(t).length)return;let o=r.let("missing");for(let l in t){let d=t[l];if(0===d.length)continue;let u=(0,i.propertyInData)(r,s,l,n.opts.ownProperties);e.setParams({property:l,depsCount:d.length,deps:d.join(", ")}),n.allErrors?r.if(u,()=>{for(let t of d)(0,i.checkReportMissingProp)(e,t)}):(r.if((0,a._)`${u} && (${(0,i.checkMissingProp)(e,d,o)})`),(0,i.reportMissingProp)(e,o),r.else())}})(e,t),function(e,t=e.schema){let{gen:r,data:a,keyword:n,it:o}=e,l=r.name("valid");for(let d in t)(0,s.alwaysValidSchema)(o,t[d])||(r.if((0,i.propertyInData)(r,a,d,o.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:d},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}(e,r)}};t.default=n},70510(e,t,r){let a=r(17898),s=r(50458);function i(e,t){let r=e.schema[t];return void 0!==r&&!(0,s.alwaysValidSchema)(e,r)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,a.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,a._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let l=i(o,"then"),d=i(o,"else");if(!l&&!d)return;let u=r.let("valid",!0),c=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c),e.mergeEvaluated(t),e.reset(),l&&d){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(c,h("then",t),h("else",t))}else l?r.if(c,h("then")):r.if((0,a.not)(c),h("else"));function h(t,s){return()=>{let i=e.subschema({keyword:t},c);r.assign(u,c),e.mergeValidEvaluated(i,u),s?r.assign(s,(0,a._)`${t}`):e.setParams({ifClause:t})}}e.pass(u,()=>e.error(!0))}}},18225(e,t,r){let a=r(93426),s=r(61349),i=r(44153),n=r(19753),o=r(35724),l=r(99868),d=r(67486),u=r(92697),c=r(19660),h=r(98422),p=r(65532),f=r(19430),m=r(98768),y=r(79355),g=r(70510),v=r(45255);t.default=function(e=!1){let t=[p.default,f.default,m.default,y.default,g.default,v.default,d.default,u.default,l.default,c.default,h.default];return e?t.push(s.default,n.default):t.push(a.default,i.default),t.push(o.default),t}},44153(e,t,r){t.validateTuple=void 0;let a=r(17898),s=r(50458),i=r(94450);function n(e,t,r=e.schema){let{gen:i,parentSchema:o,data:l,keyword:d,it:u}=e;(function(e){let{opts:a,errSchemaPath:i}=u,n=r.length,o=n===e.minItems&&(n===e.maxItems||!1===e[t]);if(a.strictTuples&&!o){let e=`"${d}" is ${n}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,s.checkStrictMode)(u,e,a.strictTuples)}})(o),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=s.mergeEvaluated.items(i,r.length,u.items));let c=i.name("valid"),h=i.const("len",(0,a._)`${l}.length`);r.forEach((t,r)=>{(0,s.alwaysValidSchema)(u,t)||(i.if((0,a._)`${h} > ${r}`,()=>e.subschema({keyword:d,schemaProp:r,dataProp:r},c)),e.ok(c))})}t.validateTuple=n,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return n(e,"additionalItems",t);r.items=!0,(0,s.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}}},19753(e,t,r){let a=r(17898),s=r(50458),i=r(94450),n=r(93426);t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:a}=e,{prefixItems:o}=r;a.items=!0,(0,s.alwaysValidSchema)(a,t)||(o?(0,n.validateAdditionalItems)(e,o):e.ok((0,i.validateArray)(e)))}}},65532(e,t,r){let a=r(50458);t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:s}=e;if((0,a.alwaysValidSchema)(s,r))return void e.fail();let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}},98768(e,t,r){let a=r(17898),s=r(50458);t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,a._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=t.let("valid",!1),l=t.let("passing",null),d=t.name("_valid");e.setParams({passing:l}),t.block(function(){r.forEach((r,i)=>{let u;(0,s.alwaysValidSchema)(n,r)?t.var(d,!0):u=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},d),i>0&&t.if((0,a._)`${d} && ${o}`).assign(o,!1).assign(l,(0,a._)`[${l}, ${i}]`).else(),t.if(d,()=>{t.assign(o,!0),t.assign(l,i),u&&e.mergeEvaluated(u,a.Name)})})}),e.result(o,()=>e.reset(),()=>e.error(!0))}}},98422(e,t,r){let a=r(94450),s=r(17898),i=r(50458),n=r(50458);t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:l,it:d}=e,{opts:u}=d,c=(0,a.allSchemaProperties)(r),h=c.filter(e=>(0,i.alwaysValidSchema)(d,r[e]));if(0===c.length||h.length===c.length&&(!d.opts.unevaluated||!0===d.props))return;let p=u.strictSchema&&!u.allowMatchingProperties&&l.properties,f=t.name("valid");!0===d.props||d.props instanceof s.Name||(d.props=(0,n.evaluatedPropsToName)(t,d.props));let{props:m}=d;for(let e of c)p&&function(e){for(let t in p)new RegExp(e).test(t)&&(0,i.checkStrictMode)(d,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),d.allErrors?y(e):(t.var(f,!0),y(e),t.if(f));function y(r){t.forIn("key",o,i=>{t.if((0,s._)`${(0,a.usePattern)(e,r)}.test(${i})`,()=>{let a=h.includes(r);a||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:n.Type.Str},f),d.opts.unevaluated&&!0!==m?t.assign((0,s._)`${m}[${i}]`,!0):a||d.allErrors||t.if((0,s.not)(f),()=>t.break())})})}}}},61349(e,t,r){let a=r(44153);t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,a.validateTuple)(e,"items")}},19660(e,t,r){let a=r(96223),s=r(94450),i=r(50458),n=r(92697);t.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:l,it:d}=e;"all"===d.opts.removeAdditional&&void 0===o.additionalProperties&&n.default.code(new a.KeywordCxt(d,n.default,"additionalProperties"));let u=(0,s.allSchemaProperties)(r);for(let e of u)d.definedProperties.add(e);d.opts.unevaluated&&u.length&&!0!==d.props&&(d.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),d.props));let c=u.filter(e=>!(0,i.alwaysValidSchema)(d,r[e]));if(0===c.length)return;let h=t.name("valid");for(let a of c){var p;(p=a,d.opts.useDefaults&&!d.compositeRule&&void 0!==r[p].default)?f(a):(t.if((0,s.propertyInData)(t,l,a,d.opts.ownProperties)),f(a),d.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(a),e.ok(h)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}}},67486(e,t,r){let a=r(17898),s=r(50458);t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,a._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,s.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,a.not)(o),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(o)}}},45255(e,t,r){let a=r(50458);t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,a.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},94450(e,t,r){t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let a=r(17898),s=r(50458),i=r(63036),n=r(50458);function o(e,t,r){return(0,a._)`${e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,a._)`Object.prototype.hasOwnProperty`})}.call(${t}, ${r})`}function l(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} === undefined`;return s?(0,a.or)(i,(0,a.not)(o(e,t,r))):i}t.checkReportMissingProp=function(e,t){let{gen:r,data:s,it:i}=e;r.if(l(r,s,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,a._)`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,i){return(0,a.or)(...s.map(s=>(0,a.and)(l(e,t,s,r.ownProperties),(0,a._)`${i} = ${s}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.isOwnProperty=o;t.propertyInData=function(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} !== undefined`;return s?(0,a._)`${i} && ${o(e,t,r)}`:i},t.noPropertyInData=l,t.allSchemaProperties=function(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:l},d,u,c){let h=c?(0,a._)`${e}, ${t}, ${s}${n}`:t,p=[[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,o)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&p.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let f=(0,a._)`${h}, ${r.object(...p)}`;return u!==a.nil?(0,a._)`${d}.call(${u}, ${f})`:(0,a._)`${d}(${f})`};let d=(0,a._)`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){let s=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,s);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,a._)`${"new RegExp"===i.code?d:(0,n.useFunc)(e,i)}(${r}, ${s})`})},t.validateArray=function(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(o,!0),l(()=>t.break()),o;function l(n){let l=t.const("len",(0,a._)`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:s.Type.Num},o),t.if((0,a.not)(o),n)})}},t.validateUnion=function(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,s.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,s)=>{let n=e.subschema({keyword:i,schemaProp:s,compositeRule:!0},l);t.assign(o,(0,a._)`${o} || ${l}`),e.mergeValidEvaluated(n,l)||t.if((0,a.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}},73946(e,t){t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},3839(e,t,r){let a=r(73946),s=r(26138);t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",a.default,s.default]},26138(e,t,r){let a=r(85748),s=r(94450),i=r(17898),n=r(63036),o=r(49392),l=r(50458);function d(e,t,r,a){let{gen:o,it:d}=e,{allErrors:u,schemaEnv:c,opts:h}=d,p=h.passContext?n.default.this:i.nil;function f(e){let t=(0,i._)`${e}.errors`;o.assign(n.default.vErrors,(0,i._)`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`),o.assign(n.default.errors,(0,i._)`${n.default.vErrors}.length`)}function m(e){var t;if(!d.opts.unevaluated)return;let a=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==d.props)if(a&&!a.dynamicProps)void 0!==a.props&&(d.props=l.mergeEvaluated.props(o,a.props,d.props));else{let t=o.var("props",(0,i._)`${e}.evaluated.props`);d.props=l.mergeEvaluated.props(o,t,d.props,i.Name)}if(!0!==d.items)if(a&&!a.dynamicItems)void 0!==a.items&&(d.items=l.mergeEvaluated.items(o,a.items,d.items));else{let t=o.var("items",(0,i._)`${e}.evaluated.items`);d.items=l.mergeEvaluated.items(o,t,d.items,i.Name)}}a?function(){if(!c.$async)throw Error("async schema referenced by sync schema");let r=o.let("valid");o.try(()=>{o.code((0,i._)`await ${(0,s.callValidateCode)(e,t,p)}`),m(t),u||o.assign(r,!0)},e=>{o.if((0,i._)`!(${e} instanceof ${d.ValidationError})`,()=>o.throw(e)),f(e),u||o.assign(r,!1)}),e.ok(r)}():e.result((0,s.callValidateCode)(e,t,p),()=>m(t),()=>f(t))}t.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let s,n,l,u,{gen:c,schema:h,it:p}=e,{baseId:f,schemaEnv:m,validateName:y,opts:g,self:v}=p,{root:_}=m;if(("#"===h||"#/"===h)&&f===_.baseId){if(m===_)return d(e,y,m,m.$async);let t=c.scopeValue("root",{ref:_});return d(e,(0,i._)`${t}.validate`,_,_.$async)}let $=o.resolveRef.call(v,_,f,h);if(void 0===$)throw new a.default(p.opts.uriResolver,f,h);return $ instanceof o.SchemaEnv?(s=function(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,i._)`${r.scopeValue("wrapper",{ref:t})}.validate`}(e,t=$),void d(e,s,t,t.$async)):(r=$,n=c.scopeValue("schema",!0===g.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),l=c.name("valid"),u=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:h},l),void(e.mergeEvaluated(u),e.ok(l)))}}},11672(e,t,r){let a=r(17898),s=r(88925),i=r(49392),n=r(85748),o=r(50458);t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,a._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:l,parentSchema:d,it:u}=e,{oneOf:c}=d;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=l.propertyName;if("string"!=typeof h)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!c)throw Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),f=t.const("tag",(0,a._)`${r}${(0,a.getProperty)(h)}`);t.if((0,a._)`typeof ${f} == "string"`,()=>(function(){let r=function(){var e;let t={},r=s(d),a=!0;for(let t=0;t<c.length;t++){let d=c[t];if((null==d?void 0:d.$ref)&&!(0,o.schemaHasRulesButRef)(d,u.self.RULES)){let e=d.$ref;if((d=i.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof i.SchemaEnv&&(d=d.schema),void 0===d)throw new n.default(u.opts.uriResolver,u.baseId,e)}let p=null==(e=null==d?void 0:d.properties)?void 0:e[h];if("object"!=typeof p)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);a=a&&(r||s(d)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}(p,t)}if(!a)throw Error(`discriminator: "${h}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(h)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${h}" values must be unique strings`);t[e]=r}}();for(let s in t.if(!1),r)t.elseIf((0,a._)`${f} === ${s}`),t.assign(p,function(r){let s=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},s);return e.mergeEvaluated(i,a.Name),s}(r[s]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:f,tagName:h}),t.endIf()})(),()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:f,tagName:h})),e.ok(p)}}},88925(e,t){var r,a;t.DiscrError=void 0,(a=r||(t.DiscrError=r={})).Tag="tag",a.Mapping="mapping"},2431(e,t,r){let a=r(3839),s=r(17851),i=r(18225),n=r(26699),o=r(34882);t.default=[a.default,s.default,(0,i.default)(),n.default,o.metadataVocabulary,o.contentVocabulary]},37072(e,t,r){let a=r(17898);t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,a._)`{format: ${e}}`},code(e,t){let r,s,i,n,o,l,{gen:d,data:u,$data:c,schema:h,schemaCode:p,it:f}=e,{opts:m,errSchemaPath:y,schemaEnv:g,self:v}=f;m.validateFormats&&(c?(r=d.scopeValue("formats",{ref:v.formats,code:m.code.formats}),s=d.const("fDef",(0,a._)`${r}[${p}]`),i=d.let("fType"),n=d.let("format"),d.if((0,a._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>d.assign(i,(0,a._)`${s}.type || "string"`).assign(n,(0,a._)`${s}.validate`),()=>d.assign(i,(0,a._)`"string"`).assign(n,s)),e.fail$data((0,a.or)(!1===m.strictSchema?a.nil:(0,a._)`${p} && !${n}`,(o=g.$async?(0,a._)`(${s}.async ? await ${n}(${u}) : ${n}(${u}))`:(0,a._)`${n}(${u})`,l=(0,a._)`(typeof ${n} == "function" ? ${o} : ${n}.test(${u}))`,(0,a._)`${n} && ${n} !== true && ${i} === ${t} && !${l}`)))):function(){var r;let s,i,n=v.formats[h];if(!n){if(!1===m.strictSchema)return v.logger.warn(o());throw Error(o());function o(){return`unknown format "${h}" ignored in schema at path "${y}"`}}if(!0===n)return;let[l,c,p]=(s=(r=n)instanceof RegExp?(0,a.regexpCode)(r):m.code.formats?(0,a._)`${m.code.formats}${(0,a.getProperty)(h)}`:void 0,i=d.scopeValue("formats",{key:h,ref:r,code:s}),"object"!=typeof r||r instanceof RegExp?["string",r,i]:[r.type||"string",r.validate,(0,a._)`${i}.validate`]);l===t&&e.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!g.$async)throw Error("async format in sync schema");return(0,a._)`await ${p}(${u})`}return"function"==typeof c?(0,a._)`${p}(${u})`:(0,a._)`${p}.test(${u})`}())}())}}},26699(e,t,r){t.default=[r(37072).default]},34882(e,t){t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},79520(e,t,r){let a=r(17898),s=r(50458),i=r(72725);t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,a._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,a._)`!${(0,s.useFunc)(t,i.default)}(${r}, ${o})`):e.fail((0,a._)`${l} !== ${r}`)}}},36742(e,t,r){let a=r(17898),s=r(50458),i=r(72725);t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,a._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:n,data:o,$data:l,schema:d,schemaCode:u,it:c}=e;if(!l&&0===d.length)throw Error("enum must have non-empty array");let h=d.length>=c.opts.loopEnum,p=()=>null!=t?t:t=(0,s.useFunc)(n,i.default);if(h||l)r=n.let("valid"),e.block$data(r,function(){n.assign(r,!1),n.forOf("v",u,e=>n.if((0,a._)`${p()}(${o}, ${e})`,()=>n.assign(r,!0).break()))});else{if(!Array.isArray(d))throw Error("ajv implementation error");let e=n.const("vSchema",u);r=(0,a.or)(...d.map((t,r)=>{var s,i;let n;return s=e,"object"==typeof(n=d[i=r])&&null!==n?(0,a._)`${p()}(${o}, ${s}[${i}])`:(0,a._)`${o} === ${n}`}))}e.pass(r)}}},17851(e,t,r){let a=r(72333),s=r(21230),i=r(3936),n=r(81005),o=r(71589),l=r(29594),d=r(38558),u=r(44058),c=r(79520),h=r(36742);t.default=[a.default,s.default,i.default,n.default,o.default,l.default,d.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,h.default]},38558(e,t,r){let a=r(17898);t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxItems"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`${r}.length ${i} ${s}`)}}},3936(e,t,r){let a=r(17898),s=r(50458),i=r(26308);t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,l="maxLength"===t?a.operators.GT:a.operators.LT,d=!1===o.opts.unicode?(0,a._)`${r}.length`:(0,a._)`${(0,s.useFunc)(e.gen,i.default)}(${r})`;e.fail$data((0,a._)`${d} ${l} ${n}`)}}},72333(e,t,r){let a=r(17898),s=a.operators,i={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}};t.default={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e;e.fail$data((0,a._)`${r} ${i[t].fail} ${s} || isNaN(${r})`)}}},71589(e,t,r){let a=r(17898);t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxProperties"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`Object.keys(${r}).length ${i} ${s}`)}}},21230(e,t,r){let a=r(17898);t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,a._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:s,it:i}=e,n=i.opts.multipleOfPrecision,o=t.let("res"),l=n?(0,a._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,a._)`${o} !== parseInt(${o})`;e.fail$data((0,a._)`(${s} === 0 || (${o} = ${r}/${s}, ${l}))`)}}},81005(e,t,r){let a=r(94450),s=r(17898);t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,s.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,s._)`{pattern: ${e}}`},code(e){let{data:t,$data:r,schema:i,schemaCode:n,it:o}=e,l=o.opts.unicodeRegExp?"u":"",d=r?(0,s._)`(new RegExp(${n}, ${l}))`:(0,a.usePattern)(e,i);e.fail$data((0,s._)`!${d}.test(${t})`)}}},29594(e,t,r){let a=r(94450),s=r(17898),i=r(50458);t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,s.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,s._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:l,it:d}=e,{opts:u}=d;if(!l&&0===r.length)return;let c=r.length>=u.loopRequired;if(d.allErrors?function(){if(c||l)e.block$data(s.nil,h);else for(let t of r)(0,a.checkReportMissingProp)(e,t)}():function(){let i=t.let("missing");if(c||l){let r=t.let("valid",!0);e.block$data(r,()=>{var l,d;return l=i,d=r,void(e.setParams({missingProperty:l}),t.forOf(l,n,()=>{t.assign(d,(0,a.propertyInData)(t,o,l,u.ownProperties)),t.if((0,s.not)(d),()=>{e.error(),t.break()})},s.nil))}),e.ok(r)}else t.if((0,a.checkMissingProp)(e,r,i)),(0,a.reportMissingProp)(e,i),t.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:a}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!a.has(e)){let t=d.schemaEnv.baseId+d.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,i.checkStrictMode)(d,r,d.opts.strictRequired)}}function h(){t.forOf("prop",n,r=>{e.setParams({missingProperty:r}),t.if((0,a.noPropertyInData)(t,o,r,u.ownProperties),()=>e.error())})}}}},44058(e,t,r){let a=r(69003),s=r(17898),i=r(50458),n=r(72725);t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,s.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,s._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:o,schema:l,parentSchema:d,schemaCode:u,it:c}=e;if(!o&&!l)return;let h=t.let("valid"),p=d.items?(0,a.getSchemaTypes)(d.items):[];e.block$data(h,function(){let o=t.let("i",(0,s._)`${r}.length`),l=t.let("j");e.setParams({i:o,j:l}),t.assign(h,!0),t.if((0,s._)`${o} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?function(i,n){let o=t.name("item"),l=(0,a.checkDataTypes)(p,o,c.opts.strictNumbers,a.DataType.Wrong),d=t.const("indices",(0,s._)`{}`);t.for((0,s._)`;${i}--;`,()=>{t.let(o,(0,s._)`${r}[${i}]`),t.if(l,(0,s._)`continue`),p.length>1&&t.if((0,s._)`typeof ${o} == "string"`,(0,s._)`${o} += "_"`),t.if((0,s._)`typeof ${d}[${o}] == "number"`,()=>{t.assign(n,(0,s._)`${d}[${o}]`),e.error(),t.assign(h,!1).break()}).code((0,s._)`${d}[${o}] = ${i}`)})}:function(a,o){let l=(0,i.useFunc)(t,n.default),d=t.name("outer");t.label(d).for((0,s._)`;${a}--;`,()=>t.for((0,s._)`${o} = ${a}; ${o}--;`,()=>t.if((0,s._)`${l}(${r}[${a}], ${r}[${o}])`,()=>{e.error(),t.assign(h,!1).break(d)})))})(o,l))},(0,s._)`${u} === false`),e.ok(h)}}},81298(e,t,r){let{normalizeIPv6:a,removeDotSegments:s,recomposeAuthority:i,normalizePercentEncoding:n,normalizePathEncoding:o,escapePreservingEscapes:l,reescapeHostDelimiters:d,isIPv4:u,nonSimpleDomain:c}=r(97767),{SCHEMES:h,getSchemeHandler:p}=r(28798);function f(e,t,r,a){let i={};return a||(e=_(m(e,r),r),t=_(m(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=s(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=s(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=s(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=s(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function m(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},a=Object.assign({},t),o=[],d=p(a.scheme||r.scheme);d&&d.serialize&&d.serialize(r,a),void 0!==r.path&&(a.skipEscape?r.path=n(r.path):(r.path=l(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==a.reference&&r.scheme&&o.push(r.scheme,":");let u=i(r);if(void 0!==u&&("suffix"!==a.reference&&o.push("//"),o.push(u),r.path&&"/"!==r.path[0]&&o.push("/")),void 0!==r.path){let e=r.path;a.absolutePath||d&&d.absolutePath||(e=s(e)),void 0===u&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}let y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,g=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;function v(e,t){let r=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,n=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let l=e.match(g);null!==l&&-1!==l[1].indexOf("\\")&&(s.error="URI authority must not contain a literal backslash.",i=!0);let h=e.match(y);if(h){s.scheme=h[1],s.userinfo=h[3],s.host=h[4],s.port=parseInt(h[5],10),s.path=h[6]||"",s.query=h[7],s.fragment=h[8],isNaN(s.port)&&(s.port=h[5]);let t=void 0!==h[2]&&s.path&&"/"!==s.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof s.port&&(s.port<0||s.port>65535)?"URI port is malformed.":void 0;if(void 0!==t&&(s.error=s.error||t,i=!0),s.host)if(!1===u(s.host)){let e=a(s.host);s.host=e.host.toLowerCase(),n=e.isIPV6}else n=!0;void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");let l=p(r.scheme||s.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&s.host&&(r.domainHost||l&&l.domainHost)&&!1===n&&c(s.host))try{s.host=new URL("http://"+s.host).hostname}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}if((!l||l&&!l.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=d(unescape(s.host),n))),s.path&&(s.path=o(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||"URI malformed"}l&&l.parse&&l.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:i}}function _(e,t){return v(e,t).parsed}function $(e,t){let{parsed:r,malformedAuthorityOrPort:a}=v(e,t);return{normalized:a?e:m(r,t),malformedAuthorityOrPort:a}}function b(e,t){if("string"==typeof e){let{normalized:r,malformedAuthorityOrPort:a}=$(e,t);return a?void 0:r}if("object"==typeof e)return m(e,t)}let w={SCHEMES:h,normalize:function(e,t){return"string"==typeof e?e=$(e,t).normalized:"object"==typeof e&&(e=_(m(e,t),t)),e},resolve:function(e,t,r){let a=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=f(_(e,a),_(t,a),a,!0);return a.skipEscape=!0,m(s,a)},resolveComponent:f,equal:function(e,t,r){let a=b(e,r),s=b(t,r);return void 0!==a&&void 0!==s&&a.toLowerCase()===s.toLowerCase()},serialize:m,parse:_};e.exports=w,e.exports.default=w,e.exports.fastUri=w},28798(e,t,r){let{isUUID:a}=r(97767),s=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function n(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let d={scheme:"http",domainHost:!0,parse:o,serialize:l},u={scheme:"https",domainHost:d.domainHost,parse:o,serialize:l},c={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(n(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},h={scheme:"wss",domainHost:c.domainHost,parse:c.parse,serialize:c.serialize},p={http:d,https:u,ws:c,wss:h,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(s);if(r){let a=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=f(`${a}:${t.nid||e.nid}`);e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",a=e.nid.toLowerCase(),s=f(`${r}:${t.nid||a}`);s&&(e=s.serialize(e,t));let i=e,n=e.nss;return i.path=`${a||t.nid}:${n}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&a(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function f(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),e.exports={wsIsSecure:n,SCHEMES:p,isValidSchemeName:function(e){return -1!==i.indexOf(e)},getSchemeHandler:f}},97767(e){let t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=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),a=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function n(e){let t="",r=0,a=0;for(a=0;a<e.length;a++)if(48!==(r=e[a].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a];break}for(a+=1;a<e.length;a++){if(!((r=e[a].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a]}return t}let o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function d(e,t,r){if(e.length){let a=n(e);if(""===a)return r.error=!0,!1;t.push(a),e.length=0}return!0}function u(e){if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},a=[],s=[],i=!1,o=!1,u=d;for(let n=0;n<e.length;n++){let d=e[n];if("["!==d&&"]"!==d)if(":"===d){if(!0===i&&(o=!0),!u(s,a,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(i=!0),a.push(":");continue}else if("%"===d){if(!u(s,a,r))break;u=l}else{s.push(d);continue}}return s.length&&(u===l?r.zone=s.join(""):o?a.push(s.join("")):a.push(n(s))),r.address=a.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}let c={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},h=/[@/?#:]/g,p=/[@/?#]/g;function f(e,t){let r=t?p:h;return r.lastIndex=0,e.replace(r,e=>c[e])}e.exports={nonSimpleDomain:o,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let a=unescape(e.host);if(!r(a)){let e=u(a);a=!0===e.isIPV6?`[${e.escapedHost}]`:f(a,!1)}t.push(a)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},reescapeHostDelimiters:f,normalizePercentEncoding:function(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let i=0;i<e.length;i++){if("%"===e[i]&&i+2<e.length){let n=e.slice(i+1,i+3);if(a(n)){let e=n.toUpperCase(),a=String.fromCharCode(parseInt(e,16));t&&s(a)?r+=a:r+="%"+e,i+=2;continue}}r+=e[i]}return r},normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let i=e.slice(r+1,r+3);if(a(i)){let e=i.toUpperCase(),a=String.fromCharCode(parseInt(e,16));"."!==a&&s(a)?t+=a:t+="%"+e,r+=2;continue}}i(e[r])?t+=e[r]:t+=escape(e[r])}return t},escapePreservingEscapes:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let s=e.slice(r+1,r+3);if(a(s)){t+="%"+s.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},removeDotSegments:function(e){let t=e,r=[],a=-1,s=0;for(;s=t.length;){if(1===s)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===s){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===s&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(a=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,a)),t=t.slice(a)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:u,stringArrayToHexStripped:n}},47073(e,t,r){let{normalizeIPv6:a,removeDotSegments:s,recomposeAuthority:i,normalizeComponentEncoding:n,isIPv4:o,nonSimpleDomain:l}=r(69012),{SCHEMES:d,getSchemeHandler:u}=r(90921);function c(e,t,r,a){let i={};return a||(e=f(h(e,r),r),t=f(h(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=s(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=s(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=s(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=s(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function h(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},a=Object.assign({},t),n=[],o=u(a.scheme||r.scheme);o&&o.serialize&&o.serialize(r,a),void 0!==r.path&&(a.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==a.reference&&r.scheme&&n.push(r.scheme,":");let l=i(r);if(void 0!==l&&("suffix"!==a.reference&&n.push("//"),n.push(l),r.path&&"/"!==r.path[0]&&n.push("/")),void 0!==r.path){let e=r.path;a.absolutePath||o&&o.absolutePath||(e=s(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),n.push(e)}return void 0!==r.query&&n.push("?",r.query),void 0!==r.fragment&&n.push("#",r.fragment),n.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(e,t){let r=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let n=e.match(p);if(n){if(s.scheme=n[1],s.userinfo=n[3],s.host=n[4],s.port=parseInt(n[5],10),s.path=n[6]||"",s.query=n[7],s.fragment=n[8],isNaN(s.port)&&(s.port=n[5]),s.host)if(!1===o(s.host)){let e=a(s.host);s.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");let t=u(r.scheme||s.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&s.host&&(r.domainHost||t&&t.domainHost)&&!1===i&&l(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),t&&t.parse&&t.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return s}let m={SCHEMES:d,normalize:function(e,t){return"string"==typeof e?e=h(f(e,t),t):"object"==typeof e&&(e=f(h(e,t),t)),e},resolve:function(e,t,r){let a=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=c(f(e,a),f(t,a),a,!0);return a.skipEscape=!0,h(s,a)},resolveComponent:c,equal:function(e,t,r){return"string"==typeof e?e=h(n(f(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=h(n(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=h(n(f(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=h(n(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:h,parse:f};e.exports=m,e.exports.default=m,e.exports.fastUri=m},90921(e,t,r){let{isUUID:a}=r(69012),s=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function n(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let d={scheme:"http",domainHost:!0,parse:o,serialize:l},u={scheme:"https",domainHost:d.domainHost,parse:o,serialize:l},c={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(n(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},h={scheme:"wss",domainHost:c.domainHost,parse:c.parse,serialize:c.serialize},p={http:d,https:u,ws:c,wss:h,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(s);if(r){let a=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=f(`${a}:${t.nid||e.nid}`);e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",a=e.nid.toLowerCase(),s=f(`${r}:${t.nid||a}`);s&&(e=s.serialize(e,t));let i=e,n=e.nss;return i.path=`${a||t.nid}:${n}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&a(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function f(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),e.exports={wsIsSecure:n,SCHEMES:p,isValidSchemeName:function(e){return -1!==i.indexOf(e)},getSchemeHandler:f}},69012(e){let t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,r=/^(?:(?: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,a=/[^!"$&'()*+,\-.;=_`a-z{}~]/u,s=e=>r.test(e);function i(e){let t="",r=0,a=0;for(a=0;a<e.length;a++)if(48!==(r=e[a].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a];break}for(a+=1;a<e.length;a++){if(!((r=e[a].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a]}return t}function n(e){return e.length=0,!0}function o(e,t,r){if(e.length){let a=i(e);if(""===a)return r.error=!0,!1;t.push(a),e.length=0}return!0}function l(e){if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},a=[],s=[],l=!1,d=!1,u=o;for(let i=0;i<e.length;i++){let o=e[i];if("["!==o&&"]"!==o)if(":"===o){if(!0===l&&(d=!0),!u(s,a,r))break;if(++t>7){r.error=!0;break}i>0&&":"===e[i-1]&&(l=!0),a.push(":");continue}else if("%"===o){if(!u(s,a,r))break;u=n}else{s.push(o);continue}}return s.length&&(u===n?r.zone=s.join(""):d?a.push(s.join("")):a.push(i(s))),r.address=a.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}e.exports={nonSimpleDomain:e=>a.test(e),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!s(r)){let t=l(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],a=-1,s=0;for(;s=t.length;){if(1===s)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===s){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===s&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(a=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,a)),t=t.slice(a)}return r.join("")},isIPv4:s,isUUID:e=>t.test(e),normalizeIPv6:l,stringArrayToHexStripped:i}},42820(e,t,r){let a,s;r.d(t,{_:()=>tO}),(ek=eE||(eE={})).assertEqual=e=>{},ek.assertIs=function(e){},ek.assertNever=function(e){throw Error()},ek.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},ek.getValidEnumValues=e=>{let t=ek.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let a of t)r[a]=e[a];return ek.objectValues(r)},ek.objectValues=e=>ek.objectKeys(e).map(function(t){return e[t]}),ek.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},ek.find=(e,t)=>{for(let r of e)if(t(r))return r},ek.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,ek.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},ek.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(eT||(eT={})).mergeShapes=(e,t)=>({...e,...t});let i=eE.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),n=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":if(Array.isArray(e))return i.array;if(null===e)return i.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return i.promise;if("u">typeof Map&&e instanceof Map)return i.map;if("u">typeof Set&&e instanceof Set)return i.set;if("u">typeof Date&&e instanceof Date)return i.date;return i.object;default:return i.unknown}},o=eE.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"]);class l extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(let s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){let r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof l))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,eE.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t=Object.create(null),r=[];for(let a of this.issues)if(a.path.length>0){let r=a.path[0];t[r]=t[r]||[],t[r].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e);let d=(e,t)=>{let r;switch(e.code){case o.invalid_type:r=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,eE.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:r=`Unrecognized key(s) in object: ${eE.joinValues(e.keys,", ")}`;break;case o.invalid_union:r="Invalid input";break;case o.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${eE.joinValues(e.options)}`;break;case o.invalid_enum_value:r=`Invalid enum value. Expected ${eE.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:r="Invalid function arguments";break;case o.invalid_return_type:r="Invalid function return type";break;case o.invalid_date:r="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:eE.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:r="Invalid input";break;case o.invalid_intersection_types:r="Intersection results could not be merged";break;case o.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:r="Number must be finite";break;default:r=t.defaultError,eE.assertNever(e)}return{message:r}};(ex=eP||(eP={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},ex.toString=e=>"string"==typeof e?e:e?.message;let u=e=>{let{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],n={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";for(let e of a.filter(e=>!!e).slice().reverse())o=e(n,{data:t,defaultError:o}).message;return{...s,path:i,message:o}};function c(e,t){let r=u({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,d,void 0].filter(e=>!!e)});e.common.issues.push(r)}class h{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if("aborted"===a.status)return p;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,a=await e.value;r.push({key:t,value:a})}return h.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:t,value:s}=a;if("aborted"===t.status||"aborted"===s.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==s.value||a.alwaysSet)&&(r[t.value]=s.value)}return{status:e.value,value:r}}}let p=Object.freeze({status:"aborted"}),f=e=>({status:"dirty",value:e}),m=e=>({status:"valid",value:e}),y=e=>"u">typeof Promise&&e instanceof Promise;class g{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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}}let v=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new l(e.common.issues);return this._error=t,this._error}}};function _(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??a??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??r??s.defaultError}},description:s}}class ${get description(){return this._def.description}_getType(e){return n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(y(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},a=this._parseSync({data:e,path:r.path,parent:r});return v(r,a)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return"valid"===r.status?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},a=this._parse({data:e,path:r.path,parent:r});return v(r,await (y(a)?a:Promise.resolve(a)))}refine(e,t){return this._refinement((r,a)=>{let s=e(r),i=()=>a.addIssue({code:o.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new ep({schema:this,typeName:eI.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:e=>this["~validate"](e)}}optional(){return ef.create(this,this._def)}nullable(){return em.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return G.create(this)}promise(){return eh.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return et.create(this,e,this._def)}transform(e){return new ep({..._(this._def),schema:this,typeName:eI.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ey({..._(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:eI.ZodDefault})}brand(){return new e_({typeName:eI.ZodBranded,type:this,..._(this._def)})}catch(e){return new eg({..._(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:eI.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return e$.create(this,e)}readonly(){return eb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let b=/^c[^\s-]{8,}$/i,w=/^[0-9a-z]+$/,k=/^[0-9A-HJKMNP-TV-Z]{26}$/i,x=/^[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,S=/^[a-z0-9_-]{21}$/i,E=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,T=/^[-+]?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)?)??$/,P=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,I=/^(?:(?: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])$/,N=/^(?:(?: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])$/,j=/^(([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]))$/,O=/^(([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])$/,z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,C=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,A="((\\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])))",R=RegExp(`^${A}$`);function Z(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}class M extends ${_parse(e){var t,r,s,n;let l;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==i.string){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.string,received:t.parsedType}),p}let d=new h;for(let i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(c(l=this._getOrReturnCtx(e,l),{code:o.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),d.dirty());else if("max"===i.kind)e.data.length>i.value&&(c(l=this._getOrReturnCtx(e,l),{code:o.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),d.dirty());else if("length"===i.kind){let t=e.data.length>i.value,r=e.data.length<i.value;(t||r)&&(l=this._getOrReturnCtx(e,l),t?c(l,{code:o.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):r&&c(l,{code:o.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),d.dirty())}else if("email"===i.kind)P.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"email",code:o.invalid_string,message:i.message}),d.dirty());else if("emoji"===i.kind)a||(a=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),a.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"emoji",code:o.invalid_string,message:i.message}),d.dirty());else if("uuid"===i.kind)x.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"uuid",code:o.invalid_string,message:i.message}),d.dirty());else if("nanoid"===i.kind)S.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"nanoid",code:o.invalid_string,message:i.message}),d.dirty());else if("cuid"===i.kind)b.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"cuid",code:o.invalid_string,message:i.message}),d.dirty());else if("cuid2"===i.kind)w.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"cuid2",code:o.invalid_string,message:i.message}),d.dirty());else if("ulid"===i.kind)k.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"ulid",code:o.invalid_string,message:i.message}),d.dirty());else if("url"===i.kind)try{new URL(e.data)}catch{c(l=this._getOrReturnCtx(e,l),{validation:"url",code:o.invalid_string,message:i.message}),d.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"regex",code:o.invalid_string,message:i.message}),d.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),d.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:{startsWith:i.value},message:i.message}),d.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:{endsWith:i.value},message:i.message}),d.dirty()):"datetime"===i.kind?(function(e){let t=`${A}T${Z(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(i).test(e.data)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:"datetime",message:i.message}),d.dirty()):"date"===i.kind?R.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:"date",message:i.message}),d.dirty()):"time"===i.kind?RegExp(`^${Z(i)}$`).test(e.data)||(c(l=this._getOrReturnCtx(e,l),{code:o.invalid_string,validation:"time",message:i.message}),d.dirty()):"duration"===i.kind?T.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"duration",code:o.invalid_string,message:i.message}),d.dirty()):"ip"===i.kind?(t=e.data,!(("v4"===(r=i.version)||!r)&&I.test(t)||("v6"===r||!r)&&j.test(t))&&1&&(c(l=this._getOrReturnCtx(e,l),{validation:"ip",code:o.invalid_string,message:i.message}),d.dirty())):"jwt"===i.kind?!function(e,t){if(!E.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));if("object"!=typeof s||null===s||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)return!1;return!0}catch{return!1}}(e.data,i.alg)&&(c(l=this._getOrReturnCtx(e,l),{validation:"jwt",code:o.invalid_string,message:i.message}),d.dirty()):"cidr"===i.kind?(s=e.data,!(("v4"===(n=i.version)||!n)&&N.test(s)||("v6"===n||!n)&&O.test(s))&&1&&(c(l=this._getOrReturnCtx(e,l),{validation:"cidr",code:o.invalid_string,message:i.message}),d.dirty())):"base64"===i.kind?z.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"base64",code:o.invalid_string,message:i.message}),d.dirty()):"base64url"===i.kind?C.test(e.data)||(c(l=this._getOrReturnCtx(e,l),{validation:"base64url",code:o.invalid_string,message:i.message}),d.dirty()):eE.assertNever(i);return{status:d.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:o.invalid_string,...eP.errToObj(r)})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...eP.errToObj(e)})}url(e){return this._addCheck({kind:"url",...eP.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...eP.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...eP.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...eP.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...eP.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...eP.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...eP.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...eP.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...eP.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...eP.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...eP.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...eP.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...eP.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...eP.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...eP.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...eP.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...eP.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...eP.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...eP.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...eP.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...eP.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...eP.errToObj(t)})}nonempty(e){return this.min(1,eP.errToObj(e))}trim(){return new M({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}M.create=e=>new M({checks:[],typeName:eI.ZodString,coerce:e?.coerce??!1,..._(e)});class q extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==i.number){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.number,received:t.parsedType}),p}let r=new h;for(let a of this._def.checks)"int"===a.kind?eE.isInteger(e.data)||(c(t=this._getOrReturnCtx(e,t),{code:o.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(e.data,a.value)&&(c(t=this._getOrReturnCtx(e,t),{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(c(t=this._getOrReturnCtx(e,t),{code:o.not_finite,message:a.message}),r.dirty()):eE.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(a)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:eP.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:eP.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:eP.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:eP.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&eE.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}q.create=e=>new q({checks:[],typeName:eI.ZodNumber,coerce:e?.coerce||!1,..._(e)});class D extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==i.bigint)return this._getInvalidInput(e);let r=new h;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(c(t=this._getOrReturnCtx(e,t),{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):eE.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,a){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(a)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}D.create=e=>new D({checks:[],typeName:eI.ZodBigInt,coerce:e?.coerce??!1,..._(e)});class V extends ${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==i.boolean){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.boolean,received:t.parsedType}),p}return m(e.data)}}V.create=e=>new V({typeName:eI.ZodBoolean,coerce:e?.coerce||!1,..._(e)});class F extends ${_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==i.date){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.date,received:t.parsedType}),p}if(Number.isNaN(e.data.getTime()))return c(this._getOrReturnCtx(e),{code:o.invalid_date}),p;let r=new h;for(let a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(c(t=this._getOrReturnCtx(e,t),{code:o.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):eE.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:eP.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:eP.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}F.create=e=>new F({checks:[],coerce:e?.coerce||!1,typeName:eI.ZodDate,..._(e)});class L extends ${_parse(e){if(this._getType(e)!==i.symbol){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.symbol,received:t.parsedType}),p}return m(e.data)}}L.create=e=>new L({typeName:eI.ZodSymbol,..._(e)});class U extends ${_parse(e){if(this._getType(e)!==i.undefined){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.undefined,received:t.parsedType}),p}return m(e.data)}}U.create=e=>new U({typeName:eI.ZodUndefined,..._(e)});class K extends ${_parse(e){if(this._getType(e)!==i.null){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.null,received:t.parsedType}),p}return m(e.data)}}K.create=e=>new K({typeName:eI.ZodNull,..._(e)});class Y extends ${constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}}Y.create=e=>new Y({typeName:eI.ZodAny,..._(e)});class H extends ${constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}}H.create=e=>new H({typeName:eI.ZodUnknown,..._(e)});class J extends ${_parse(e){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.never,received:t.parsedType}),p}}J.create=e=>new J({typeName:eI.ZodNever,..._(e)});class B extends ${_parse(e){if(this._getType(e)!==i.undefined){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.void,received:t.parsedType}),p}return m(e.data)}}B.create=e=>new B({typeName:eI.ZodVoid,..._(e)});class G extends ${_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==i.array)return c(t,{code:o.invalid_type,expected:i.array,received:t.parsedType}),p;if(null!==a.exactLength){let e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(c(t,{code:e?o.too_big:o.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(c(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(c(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new g(t,e,t.path,r)))).then(e=>h.mergeArray(r,e));let s=[...t.data].map((e,r)=>a.type._parseSync(new g(t,e,t.path,r)));return h.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new G({...this._def,minLength:{value:e,message:eP.toString(t)}})}max(e,t){return new G({...this._def,maxLength:{value:e,message:eP.toString(t)}})}length(e,t){return new G({...this._def,exactLength:{value:e,message:eP.toString(t)}})}nonempty(e){return this.min(1,e)}}G.create=(e,t)=>new G({type:e,minLength:null,maxLength:null,exactLength:null,typeName:eI.ZodArray,..._(t)});class W extends ${constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=eE.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==i.object){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.object,received:t.parsedType}),p}let{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),n=[];if(!(this._def.catchall instanceof J&&"strip"===this._def.unknownKeys))for(let e in r.data)s.includes(e)||n.push(e);let l=[];for(let e of s){let t=a[e],s=r.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new g(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof J){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of n)l.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)n.length>0&&(c(r,{code:o.unrecognized_keys,keys:n}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of n){let a=r.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new g(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of l){let r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>h.mergeObjectSync(t,e)):h.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return eP.errToObj,new W({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let a=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:eP.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new W({...this._def,unknownKeys:"strip"})}passthrough(){return new W({...this._def,unknownKeys:"passthrough"})}extend(e){return new W({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new W({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:eI.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new W({...this._def,catchall:e})}pick(e){let t={};for(let r of eE.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}omit(e){let t={};for(let r of eE.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new W({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof W){let r={};for(let a in t.shape){let s=t.shape[a];r[a]=ef.create(e(s))}return new W({...t._def,shape:()=>r})}if(t instanceof G)return new G({...t._def,type:e(t.element)});if(t instanceof ef)return ef.create(e(t.unwrap()));if(t instanceof em)return em.create(e(t.unwrap()));if(t instanceof er)return er.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of eE.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new W({...this._def,shape:()=>t})}required(e){let t={};for(let r of eE.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ef;)e=e._def.innerType;t[r]=e}return new W({...this._def,shape:()=>t})}keyof(){return ed(eE.objectKeys(this.shape))}}W.create=(e,t)=>new W({shape:()=>e,unknownKeys:"strip",catchall:J.create(),typeName:eI.ZodObject,..._(t)}),W.strictCreate=(e,t)=>new W({shape:()=>e,unknownKeys:"strict",catchall:J.create(),typeName:eI.ZodObject,..._(t)}),W.lazycreate=(e,t)=>new W({shape:e,unknownKeys:"strip",catchall:J.create(),typeName:eI.ZodObject,..._(t)});class Q extends ${_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new l(e.ctx.common.issues));return c(t,{code:o.invalid_union,unionErrors:r}),p});{let e,a=[];for(let s of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let s=a.map(e=>new l(e));return c(t,{code:o.invalid_union,unionErrors:s}),p}}get options(){return this._def.options}}Q.create=(e,t)=>new Q({options:e,typeName:eI.ZodUnion,..._(t)});let X=e=>{if(e instanceof eo)return X(e.schema);if(e instanceof ep)return X(e.innerType());if(e instanceof el)return[e.value];if(e instanceof eu)return e.options;if(e instanceof ec)return eE.objectValues(e.enum);else if(e instanceof ey)return X(e._def.innerType);else if(e instanceof U)return[void 0];else if(e instanceof K)return[null];else if(e instanceof ef)return[void 0,...X(e.unwrap())];else if(e instanceof em)return[null,...X(e.unwrap())];else if(e instanceof e_)return X(e.unwrap());else if(e instanceof eb)return X(e.unwrap());else if(e instanceof eg)return X(e._def.innerType);else return[]};class ee extends ${_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return c(t,{code:o.invalid_type,expected:i.object,received:t.parsedType}),p;let r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let r of t){let t=X(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of t){if(a.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new ee({typeName:eI.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,..._(r)})}}class et extends ${_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=(e,a)=>{if("aborted"===e.status||"aborted"===a.status)return p;let s=function e(t,r){let a=n(t),s=n(r);if(t===r)return{valid:!0,data:t};if(a===i.object&&s===i.object){let a=eE.objectKeys(r),s=eE.objectKeys(t).filter(e=>-1!==a.indexOf(e)),i={...t,...r};for(let a of s){let s=e(t[a],r[a]);if(!s.valid)return{valid:!1};i[a]=s.data}return{valid:!0,data:i}}if(a===i.array&&s===i.array){if(t.length!==r.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}if(a===i.date&&s===i.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,a.value);return s.valid?(("dirty"===e.status||"dirty"===a.status)&&t.dirty(),{status:t.value,value:s.data}):(c(r,{code:o.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}et.create=(e,t,r)=>new et({left:e,right:t,typeName:eI.ZodIntersection,..._(r)});class er extends ${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==i.array)return c(r,{code:o.invalid_type,expected:i.array,received:r.parsedType}),p;if(r.data.length<this._def.items.length)return c(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&r.data.length>this._def.items.length&&(c(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((e,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new g(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>h.mergeArray(t,e)):h.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new er({...this._def,rest:e})}}er.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new er({items:e,typeName:eI.ZodTuple,rest:null,..._(t)})};class ea extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==i.object)return c(r,{code:o.invalid_type,expected:i.object,received:r.parsedType}),p;let a=[],s=this._def.keyType,n=this._def.valueType;for(let e in r.data)a.push({key:s._parse(new g(r,e,r.path,e)),value:n._parse(new g(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?h.mergeObjectAsync(t,a):h.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new ea(t instanceof $?{keyType:e,valueType:t,typeName:eI.ZodRecord,..._(r)}:{keyType:M.create(),valueType:e,typeName:eI.ZodRecord,..._(t)})}}class es extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==i.map)return c(r,{code:o.invalid_type,expected:i.map,received:r.parsedType}),p;let a=this._def.keyType,s=this._def.valueType,n=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new g(r,e,r.path,[i,"key"])),value:s._parse(new g(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of n){let a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return p;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of n){let a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return p;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}es.create=(e,t,r)=>new es({valueType:t,keyType:e,typeName:eI.ZodMap,..._(r)});class ei extends ${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==i.set)return c(r,{code:o.invalid_type,expected:i.set,received:r.parsedType}),p;let a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(c(r,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(c(r,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let s=this._def.valueType;function n(e){let r=new Set;for(let a of e){if("aborted"===a.status)return p;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}let l=[...r.data.values()].map((e,t)=>s._parse(new g(r,e,r.path,t)));return r.common.async?Promise.all(l).then(e=>n(e)):n(l)}min(e,t){return new ei({...this._def,minSize:{value:e,message:eP.toString(t)}})}max(e,t){return new ei({...this._def,maxSize:{value:e,message:eP.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ei.create=(e,t)=>new ei({valueType:e,minSize:null,maxSize:null,typeName:eI.ZodSet,..._(t)});class en extends ${constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return c(t,{code:o.invalid_type,expected:i.function,received:t.parsedType}),p;function r(e,r){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d,d].filter(e=>!!e),issueData:{code:o.invalid_arguments,argumentsError:r}})}function a(e,r){return u({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d,d].filter(e=>!!e),issueData:{code:o.invalid_return_type,returnTypeError:r}})}let s={errorMap:t.common.contextualErrorMap},n=t.data;if(this._def.returns instanceof eh){let e=this;return m(async function(...t){let i=new l([]),o=await e._def.args.parseAsync(t,s).catch(e=>{throw i.addIssue(r(t,e)),i}),d=await Reflect.apply(n,this,o);return await e._def.returns._def.type.parseAsync(d,s).catch(e=>{throw i.addIssue(a(d,e)),i})})}{let e=this;return m(function(...t){let i=e._def.args.safeParse(t,s);if(!i.success)throw new l([r(t,i.error)]);let o=Reflect.apply(n,this,i.data),d=e._def.returns.safeParse(o,s);if(!d.success)throw new l([a(o,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new en({...this._def,args:er.create(e).rest(H.create())})}returns(e){return new en({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new en({args:e||er.create([]).rest(H.create()),returns:t||H.create(),typeName:eI.ZodFunction,..._(r)})}}class eo extends ${get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}eo.create=(e,t)=>new eo({getter:e,typeName:eI.ZodLazy,..._(t)});class el extends ${_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ed(e,t){return new eu({values:e,typeName:eI.ZodEnum,..._(t)})}el.create=(e,t)=>new el({value:e,typeName:eI.ZodLiteral,..._(t)});class eu extends ${_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:eE.joinValues(r),received:t.parsedType,code:o.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:o.invalid_enum_value,options:r}),p}return m(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return eu.create(e,{...this._def,...t})}exclude(e,t=this._def){return eu.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}eu.create=ed;class ec extends ${_parse(e){let t=eE.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==i.string&&r.parsedType!==i.number){let e=eE.objectValues(t);return c(r,{expected:eE.joinValues(e),received:r.parsedType,code:o.invalid_type}),p}if(this._cache||(this._cache=new Set(eE.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=eE.objectValues(t);return c(r,{received:r.data,code:o.invalid_enum_value,options:e}),p}return m(e.data)}get enum(){return this._def.values}}ec.create=(e,t)=>new ec({values:e,typeName:eI.ZodNativeEnum,..._(t)});class eh extends ${unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==i.promise&&!1===t.common.async?(c(t,{code:o.invalid_type,expected:i.promise,received:t.parsedType}),p):m((t.parsedType===i.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eh.create=(e,t)=>new eh({type:e,typeName:eI.ZodPromise,..._(t)});class ep extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===eI.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{c(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){let e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return p;let a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?p:"dirty"===a.status||"dirty"===t.value?f(a.value):a});{if("aborted"===t.value)return p;let a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?p:"dirty"===a.status||"dirty"===t.value?f(a.value):a}}if("refinement"===a.type){let e=e=>{let t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?p:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?p:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}}if("transform"===a.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?p:Promise.resolve(a.transform(e.value,s)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return p;let i=a.transform(e.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}eE.assertNever(a)}}ep.create=(e,t,r)=>new ep({schema:e,typeName:eI.ZodEffects,effect:t,..._(r)}),ep.createWithPreprocess=(e,t,r)=>new ep({schema:t,effect:{type:"preprocess",transform:e},typeName:eI.ZodEffects,..._(r)});class ef extends ${_parse(e){return this._getType(e)===i.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ef.create=(e,t)=>new ef({innerType:e,typeName:eI.ZodOptional,..._(t)});class em extends ${_parse(e){return this._getType(e)===i.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}em.create=(e,t)=>new em({innerType:e,typeName:eI.ZodNullable,..._(t)});class ey extends ${_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===i.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:eI.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,..._(t)});class eg extends ${_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return y(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new l(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eg.create=(e,t)=>new eg({innerType:e,typeName:eI.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,..._(t)});class ev extends ${_parse(e){if(this._getType(e)!==i.nan){let t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:i.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}ev.create=e=>new ev({typeName:eI.ZodNaN,..._(e)}),Symbol("zod_brand");class e_ extends ${_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class e$ extends ${_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),f(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new e$({in:e,out:t,typeName:eI.ZodPipeline})}}class eb extends ${_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return y(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:eI.ZodReadonly,..._(t)}),W.lazycreate,(eS=eI||(eI={})).ZodString="ZodString",eS.ZodNumber="ZodNumber",eS.ZodNaN="ZodNaN",eS.ZodBigInt="ZodBigInt",eS.ZodBoolean="ZodBoolean",eS.ZodDate="ZodDate",eS.ZodSymbol="ZodSymbol",eS.ZodUndefined="ZodUndefined",eS.ZodNull="ZodNull",eS.ZodAny="ZodAny",eS.ZodUnknown="ZodUnknown",eS.ZodNever="ZodNever",eS.ZodVoid="ZodVoid",eS.ZodArray="ZodArray",eS.ZodObject="ZodObject",eS.ZodUnion="ZodUnion",eS.ZodDiscriminatedUnion="ZodDiscriminatedUnion",eS.ZodIntersection="ZodIntersection",eS.ZodTuple="ZodTuple",eS.ZodRecord="ZodRecord",eS.ZodMap="ZodMap",eS.ZodSet="ZodSet",eS.ZodFunction="ZodFunction",eS.ZodLazy="ZodLazy",eS.ZodLiteral="ZodLiteral",eS.ZodEnum="ZodEnum",eS.ZodEffects="ZodEffects",eS.ZodNativeEnum="ZodNativeEnum",eS.ZodOptional="ZodOptional",eS.ZodNullable="ZodNullable",eS.ZodDefault="ZodDefault",eS.ZodCatch="ZodCatch",eS.ZodPromise="ZodPromise",eS.ZodBranded="ZodBranded",eS.ZodPipeline="ZodPipeline",eS.ZodReadonly="ZodReadonly",M.create,q.create,ev.create,D.create,V.create,F.create,L.create,U.create,K.create,Y.create,H.create,J.create,B.create,G.create;let ew=W.create;W.strictCreate,Q.create,ee.create,et.create,er.create,ea.create,es.create,ei.create,en.create,eo.create,el.create,eu.create,ec.create,eh.create,ep.create,ef.create,em.create,ep.createWithPreprocess,e$.create;var ek,ex,eS,eE,eT,eP,eI,eN,ej=r(76773),eO=r(84964),ez=r(30174),eC=r(52992),eA=r(879);let eR=ej.xI("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");eO.W4.init(e,t),e.def=t,e.type=t.type,e.parse=(t,r)=>eA.qg(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>eA.xL(e,t,r),e.parseAsync=async(t,r)=>eA.EJ(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>eA.bp(e,t,r),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,r)=>ez.o8(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.apply=t=>t(e)}),eZ=ej.xI("ZodMiniObject",(e,t)=>{eO.L8.init(e,t),eR.init(e,t),ez.gJ(e,"shape",()=>t.shape)});function eM(e,t){return new eZ({type:"object",shape:e??{},...ez.A2(t)})}function eq(e){return!!e._zod}function eD(e){let t=Object.values(e);if(0===t.length)return eM({});let r=t.every(eq),a=t.every(e=>!eq(e));if(r)return eM(e);if(a)return ew(e);throw Error("Mixed Zod versions detected in object shape.")}function eV(e,t){return eq(e)?eA.xL(e,t):e.safeParse(t)}async function eF(e,t){return eq(e)?await eA.bp(e,t):await e.safeParseAsync(t)}function eL(e){let t;if(e&&(t=eq(e)?e._zod?.def?.shape:e.shape)){if("function"==typeof t)try{return t()}catch{return}return t}}function eU(e){if(e){if("object"==typeof e&&!e._def&&!e._zod){let t=Object.values(e);if(t.length>0&&t.every(e=>"object"==typeof e&&null!==e&&(void 0!==e._def||void 0!==e._zod||"function"==typeof e.parse)))return eD(e)}if(eq(e)){let t=e._zod?.def;if(t&&("object"===t.type||void 0!==t.shape))return e}else if(void 0!==e.shape)return e}}function eK(e){if(e&&"object"==typeof e){if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0)return e.issues.map(e=>{var t;return e.path?.length?`${e.message} at ${0===(t=e.path).length?"object root":t.reduce((e,t,r)=>0===r?String(t):"number"==typeof t?`${e}[${t}]`:`${e}.${t}`,"")}`:e.message}).join("\n");if("message"in e&&"string"==typeof e.message)return e.message;try{return JSON.stringify(e)}catch{}}return String(e)}function eY(e){if(eq(e)){let t=e._zod?.def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let r=e.value;if(void 0!==r)return r}eC.q0,eC.mI;var eH=r(13298);function eJ(e){return"completed"===e||"failed"===e||"cancelled"===e}var eB=r(76882);let eG=Symbol("Let zodToJsonSchema decide on which parser to use"),eW={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},eQ=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function eX(e){if("openAi"!==e.target)return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?eQ(t,e.currentPath):t.join("/")}}function e0(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function e1(e,t,r,a,s){e[t]=r,e0(e,t,a,s)}function e9(e,t){return tp(e.type._def,t)}let e4=/^[cC][^\s-]{8,}$/,e2=/^[0-9a-z]+$/,e5=/^[0-9A-HJKMNP-TV-Z]{26}$/,e3=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,e8=()=>(void 0===s&&(s=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),s),e6=/^(?:(?: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])$/,e7=/^(([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])$/,te=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tr=/^[a-zA-Z0-9_-]{21}$/,ta=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function ts(e,t){let r={type:"string"};if(e.checks)for(let a of e.checks)switch(a.kind){case"min":e1(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t);break;case"max":e1(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":to(r,"email",a.message,t);break;case"format:idn-email":to(r,"idn-email",a.message,t);break;case"pattern:zod":tl(r,e3,a.message,t)}break;case"url":to(r,"uri",a.message,t);break;case"uuid":to(r,"uuid",a.message,t);break;case"regex":tl(r,a.regex,a.message,t);break;case"cuid":tl(r,e4,a.message,t);break;case"cuid2":tl(r,e2,a.message,t);break;case"startsWith":tl(r,RegExp(`^${ti(a.value,t)}`),a.message,t);break;case"endsWith":tl(r,RegExp(`${ti(a.value,t)}$`),a.message,t);break;case"datetime":to(r,"date-time",a.message,t);break;case"date":to(r,"date",a.message,t);break;case"time":to(r,"time",a.message,t);break;case"duration":to(r,"duration",a.message,t);break;case"length":e1(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t),e1(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"includes":tl(r,RegExp(ti(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&to(r,"ipv4",a.message,t),"v4"!==a.version&&to(r,"ipv6",a.message,t);break;case"base64url":tl(r,tt,a.message,t);break;case"jwt":tl(r,ta,a.message,t);break;case"cidr":"v6"!==a.version&&tl(r,e6,a.message,t),"v4"!==a.version&&tl(r,e7,a.message,t);break;case"emoji":tl(r,e8(),a.message,t);break;case"ulid":tl(r,e5,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":to(r,"binary",a.message,t);break;case"contentEncoding:base64":e1(r,"contentEncoding","base64",a.message,t);break;case"pattern:zod":tl(r,te,a.message,t)}break;case"nanoid":tl(r,tr,a.message,t)}return r}function ti(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)tn.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}let tn=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function to(e,t,r,a){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):e1(e,"format",t,r,a)}function tl(e,t,r,a){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:td(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):e1(e,"pattern",td(t,a),r,a)}function td(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=r.i?e.source.toLowerCase():e.source,s="",i=!1,n=!1,o=!1;for(let e=0;e<a.length;e++){if(i){s+=a[e],i=!1;continue}if(r.i){if(n){if(a[e].match(/[a-z]/)){o?(s+=a[e],s+=`${a[e-2]}-${a[e]}`.toUpperCase(),o=!1):"-"===a[e+1]&&a[e+2]?.match(/[a-z]/)?(s+=a[e],o=!0):s+=`${a[e]}${a[e].toUpperCase()}`;continue}}else if(a[e].match(/[a-z]/)){s+=`[${a[e]}${a[e].toUpperCase()}]`;continue}}if(r.m){if("^"===a[e]){s+=`(^|(?<=[\r
|
|
14
|
+
]))`;continue}else if("$"===a[e]){s+=`($|(?=[\r
|
|
15
|
+
]))`;continue}}if(r.s&&"."===a[e]){s+=n?`${a[e]}\r
|
|
16
|
+
`:`[${a[e]}\r
|
|
17
|
+
]`;continue}s+=a[e],"\\"===a[e]?i=!0:n&&"]"===a[e]?n=!1:n||"["!==a[e]||(n=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function tu(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===eI.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,a)=>({...r,[a]:tp(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??eX(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:tp(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===eI.ZodString&&e.keyType._def.checks?.length){let{type:a,...s}=ts(e.keyType._def,t);return{...r,propertyNames:s}}if(e.keyType?._def.typeName===eI.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===eI.ZodBranded&&e.keyType._def.type._def.typeName===eI.ZodString&&e.keyType._def.type._def.checks?.length){let{type:a,...s}=e9(e.keyType._def,t);return{...r,propertyNames:s}}return r}let tc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},th=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>tp(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function tp(e,t,r=!1){let a=t.seen.get(e);if(t.override){let s=t.override?.(e,t,a,r);if(s!==eG)return s}if(a&&!r){let e=tf(a,t);if(void 0!==e)return e}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let i=((e,t,r)=>{switch(t){case eI.ZodString:return ts(e,r);case eI.ZodNumber:let a={type:"number"};if(!e.checks)return a;for(let t of e.checks)switch(t.kind){case"int":a.type="integer",e0(a,"type",t.message,r);break;case"min":"jsonSchema7"===r.target?t.inclusive?e1(a,"minimum",t.value,t.message,r):e1(a,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(a.exclusiveMinimum=!0),e1(a,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?e1(a,"maximum",t.value,t.message,r):e1(a,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(a.exclusiveMaximum=!0),e1(a,"maximum",t.value,t.message,r));break;case"multipleOf":e1(a,"multipleOf",t.value,t.message,r)}return a;case eI.ZodObject:return function(e,t){let r="openAi"===t.target,a={type:"object",properties:{}},s=[],i=e.shape();for(let e in i){let n=i[e];if(void 0===n||void 0===n._def)continue;let o=function(e){try{return e.isOptional()}catch{return!0}}(n);o&&r&&("ZodOptional"===n._def.typeName&&(n=n._def.innerType),n.isNullable()||(n=n.nullable()),o=!1);let l=tp(n._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==l&&(a.properties[e]=l,o||s.push(e))}s.length&&(a.required=s);let n=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return tp(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==n&&(a.additionalProperties=n),a}(e,r);case eI.ZodBigInt:let s={type:"integer",format:"int64"};if(!e.checks)return s;for(let t of e.checks)switch(t.kind){case"min":"jsonSchema7"===r.target?t.inclusive?e1(s,"minimum",t.value,t.message,r):e1(s,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(s.exclusiveMinimum=!0),e1(s,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?e1(s,"maximum",t.value,t.message,r):e1(s,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(s.exclusiveMaximum=!0),e1(s,"maximum",t.value,t.message,r));break;case"multipleOf":e1(s,"multipleOf",t.value,t.message,r)}return s;case eI.ZodBoolean:return{type:"boolean"};case eI.ZodDate:return function e(t,r,a){let s=a??r.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((a,s)=>e(t,r,a))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var i=t,n=r;let o={type:"integer",format:"unix-time"};if("openApi3"===n.target)return o;for(let e of i.checks)switch(e.kind){case"min":e1(o,"minimum",e.value,e.message,n);break;case"max":e1(o,"maximum",e.value,e.message,n)}return o}}(e,r);case eI.ZodUndefined:return{not:eX(r)};case eI.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case eI.ZodArray:let i;return i={type:"array"},e.type?._def&&e.type?._def?.typeName!==eI.ZodAny&&(i.items=tp(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})),e.minLength&&e1(i,"minItems",e.minLength.value,e.minLength.message,r),e.maxLength&&e1(i,"maxItems",e.maxLength.value,e.maxLength.message,r),e.exactLength&&(e1(i,"minItems",e.exactLength.value,e.exactLength.message,r),e1(i,"maxItems",e.exactLength.value,e.exactLength.message,r)),i;case eI.ZodUnion:case eI.ZodDiscriminatedUnion:if("openApi3"===r.target)return th(e,r);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in tc&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let r=tc[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=n.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return th(e,r);case eI.ZodIntersection:let o,l,d;return o=[tp(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),tp(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(e=>!!e),l="jsonSchema2019-09"===r.target?{unevaluatedProperties:!1}:void 0,d=[],o.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)d.push(...e.allOf),void 0===e.unevaluatedProperties&&(l=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...a}=e;t=a}else l=void 0;d.push(t)}}),d.length?{allOf:d,...l}:void 0;case eI.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>tp(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:tp(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>tp(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case eI.ZodRecord:return tu(e,r);case eI.ZodLiteral:let u;return"bigint"!=(u=typeof e.value)&&"number"!==u&&"boolean"!==u&&"string"!==u?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===r.target?{type:"bigint"===u?"integer":u,enum:[e.value]}:{type:"bigint"===u?"integer":u,const:e.value};case eI.ZodEnum:return{type:"string",enum:Array.from(e.values)};case eI.ZodNativeEnum:let c,h,p;return c=e.values,{type:1===(p=Array.from(new Set((h=Object.keys(e.values).filter(e=>"number"!=typeof c[c[e]]).map(e=>c[e])).map(e=>typeof e)))).length?"string"===p[0]?"string":"number":["string","number"],enum:h};case eI.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===r.target?{type:tc[e.innerType._def.typeName],nullable:!0}:{type:[tc[e.innerType._def.typeName],"null"]};if("openApi3"===r.target){let t=tp(e.innerType._def,{...r,currentPath:[...r.currentPath]});return t&&"$ref"in t?{allOf:[t],nullable:!0}:t&&{...t,nullable:!0}}let f=tp(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return f&&{anyOf:[f,{type:"null"}]};case eI.ZodOptional:if(r.currentPath.toString()===r.propertyPath?.toString())return tp(e.innerType._def,r);let m=tp(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return m?{anyOf:[{not:eX(r)},m]}:eX(r);case eI.ZodMap:if("record"===r.mapStrategy)return tu(e,r);return{type:"array",maxItems:125,items:{type:"array",items:[tp(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||eX(r),tp(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||eX(r)],minItems:2,maxItems:2}};case eI.ZodSet:let y;return y={type:"array",uniqueItems:!0,items:tp(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})},e.minSize&&e1(y,"minItems",e.minSize.value,e.minSize.message,r),e.maxSize&&e1(y,"maxItems",e.maxSize.value,e.maxSize.message,r),y;case eI.ZodLazy:return()=>e.getter()._def;case eI.ZodPromise:return tp(e.type._def,r);case eI.ZodNaN:case eI.ZodNever:return"openAi"===r.target?void 0:{not:eX({...r,currentPath:[...r.currentPath,"not"]})};case eI.ZodEffects:return"input"===r.effectStrategy?tp(e.schema._def,r):eX(r);case eI.ZodAny:case eI.ZodUnknown:return eX(r);case eI.ZodDefault:return{...tp(e.innerType._def,r),default:e.defaultValue()};case eI.ZodBranded:return e9(e,r);case eI.ZodReadonly:case eI.ZodCatch:return tp(e.innerType._def,r);case eI.ZodPipeline:if("input"===r.pipeStrategy)return tp(e.in._def,r);if("output"===r.pipeStrategy)return tp(e.out._def,r);let g=tp(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),v=tp(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",g?"1":"0"]});return{allOf:[g,v].filter(e=>void 0!==e)};case eI.ZodFunction:case eI.ZodVoid:case eI.ZodSymbol:default:return}})(e,e.typeName,t),n="function"==typeof i?tp(i(),t):i;if(n&&tm(e,t,n),t.postProcess){let r=t.postProcess(n,e,t);return s.jsonSchema=n,r}return s.jsonSchema=n,n}let tf=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:eQ(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),eX(t);return"seen"===t.$refStrategy?eX(t):void 0}},tm=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);function ty(e,t){if(eq(e)){var r;return eB.bl(e,{target:(r=t?.target)&&"jsonSchema7"!==r&&"draft-7"!==r&&("jsonSchema2019-09"===r||"draft-2020-12"===r)?"draft-2020-12":"draft-7",io:t?.pipeStrategy??"input"})}return((e,t)=>{let r,a,s=(a=void 0!==(r="string"==typeof t?{...eW,name:t}:{...eW,...t}).name?[...r.basePath,r.definitionPath,r.name]:r.basePath,{...r,flags:{hasReferencedOpenAiAnyType:!1},currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(r.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:void 0}]))}),i="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:tp(r._def,{...s,currentPath:[...s.basePath,s.definitionPath,t]},!0)??eX(s)}),{}):void 0,n="string"==typeof t?t:t?.nameStrategy==="title"?void 0:t?.name,o=tp(e._def,void 0===n?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1)??eX(s),l="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==l&&(o.title=l),s.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[s.openAiAnyTypeName]||(i[s.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===s.$refStrategy?"1":[...s.basePath,s.definitionPath,s.openAiAnyTypeName].join("/")}}));let d=void 0===n?i?{...o,[s.definitionPath]:i}:o:{$ref:[..."relative"===s.$refStrategy?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...i,[n]:o}};return"jsonSchema7"===s.target?d.$schema="http://json-schema.org/draft-07/schema#":("jsonSchema2019-09"===s.target||"openAi"===s.target)&&(d.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===s.target&&("anyOf"in d||"oneOf"in d||"allOf"in d||"type"in d&&Array.isArray(d.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),d})(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function tg(e){let t=eL(e),r=t?.method;if(!r)throw Error("Schema is missing a method literal");let a=eY(r);if("string"!=typeof a)throw Error("Schema method literal must be a string");return a}function tv(e,t){let r=eV(e,t);if(!r.success)throw r.error;return r.data}class t_{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(eH.Sq,e=>{this._oncancel(e)}),this.setNotificationHandler(eH._r,e=>{this._onprogress(e)}),this.setRequestHandler(eH.tC,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(eH.Ql,async(e,t)=>{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new eH.Nh(eH.O4.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(eH.oQ,async(e,t)=>{let r=async()=>{let a=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(a,t.sessionId);){if("response"===e.type||"error"===e.type){let t=e.message,r=t.id,a=this._requestResolvers.get(r);if(a)this._requestResolvers.delete(r),a("response"===e.type?t:new eH.Nh(t.error.code,t.error.message,t.error.data));else{let t="response"===e.type?"Response":"Error";this._onerror(Error(`${t} handler missing for request ${r}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let s=await this._taskStore.getTask(a,t.sessionId);if(!s)throw new eH.Nh(eH.O4.InvalidParams,`Task not found: ${a}`);if(!eJ(s.status))return await this._waitForTaskUpdate(a,t.signal),await r();if(eJ(s.status)){let e=await this._taskStore.getTaskResult(a,t.sessionId);return this._clearTaskQueue(a),{...e,_meta:{...e._meta,[eH.EV]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(eH.zR,async(e,t)=>{try{let{tasks:r,nextCursor:a}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(e){throw new eH.Nh(eH.O4.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(eH.gd,async(e,t)=>{try{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new eH.Nh(eH.O4.InvalidParams,`Task not found: ${e.params.taskId}`);if(eJ(r.status))throw new eH.Nh(eH.O4.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,"cancelled","Client cancelled task execution.",t.sessionId),this._clearTaskQueue(e.params.taskId);let a=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!a)throw new eH.Nh(eH.O4.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...a}}catch(e){if(e instanceof eH.Nh)throw e;throw new eH.Nh(eH.O4.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;let t=this._requestHandlerAbortControllers.get(e.params.requestId);t?.abort(e.params.reason)}_setupTimeout(e,t,r,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),eH.Nh.fromError(eH.O4.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw 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 t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let a=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{a?.(e,t),(0,eH.ig)(e)||(0,eH.LW)(e)?this._onresponse(e):(0,eH.vo)(e)?this._onrequest(e,t):(0,eH.lg)(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);for(let e of(this._timeoutInfo.clear(),this._requestHandlerAbortControllers.values()))e.abort();this._requestHandlerAbortControllers.clear();let t=eH.Nh.fromError(eH.O4.ConnectionClosed,"Connection closed");for(let r of(this._transport=void 0,this.onclose?.(),e.values()))r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;void 0!==t&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,a=this._transport,s=e.params?._meta?.[eH.EV]?.taskId;if(void 0===r){let t={jsonrpc:"2.0",id:e.id,error:{code:eH.O4.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:t,timestamp:Date.now()},a?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):a?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let n=(0,eH.bZ)(e.params)?e.params.task:void 0,o=this._taskStore?this.requestTaskStore(e,a?.sessionId):void 0,l={signal:i.signal,sessionId:a?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(i.signal.aborted)return;let r={relatedRequestId:e.id};s&&(r.relatedTask={taskId:s}),await this.notification(t,r)},sendRequest:async(t,r,a)=>{if(i.signal.aborted)throw new eH.Nh(eH.O4.ConnectionClosed,"Request was cancelled");let n={...a,relatedRequestId:e.id};s&&!n.relatedTask&&(n.relatedTask={taskId:s});let l=n.relatedTask?.taskId??s;return l&&o&&await o.updateTaskStatus(l,"input_required"),await this.request(t,r,n)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:s,taskStore:o,taskRequestedTtl:n?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{n&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,l)).then(async t=>{if(i.signal.aborted)return;let r={result:t,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:r,timestamp:Date.now()},a?.sessionId):await a?.send(r)},async t=>{if(i.signal.aborted)return;let r={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:eH.O4.InternalError,message:t.message??"Internal error",...void 0!==t.data&&{data:t.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:r,timestamp:Date.now()},a?.sessionId):await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,a=Number(t),s=this._progressHandlers.get(a);if(!s)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let i=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(e){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),i(e);return}s(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){this._requestResolvers.delete(t),r((0,eH.ig)(e)?e:new eH.Nh(e.error.code,e.error.message,e.error.data));return}let a=this._responseHandlers.get(t);if(void 0===a)return void this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));this._responseHandlers.delete(t),this._cleanupTimeout(t);let s=!1;if((0,eH.ig)(e)&&e.result&&"object"==typeof e.result){let r=e.result;if(r.task&&"object"==typeof r.task){let e=r.task;"string"==typeof e.taskId&&(s=!0,this._taskProgressTokens.set(e.taskId,t))}}s||this._progressHandlers.delete(t),a((0,eH.ig)(e)?e:eH.Nh.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async *requestStream(e,t,r){let a,{task:s}=r??{};if(!s){try{let a=await this.request(e,t,r);yield{type:"result",result:a}}catch(e){yield{type:"error",error:e instanceof eH.Nh?e:new eH.Nh(eH.O4.InternalError,String(e))}}return}try{let s=await this.request(e,eH.Mg,r);if(s.task)a=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new eH.Nh(eH.O4.InternalError,"Task creation did not return a task");for(;;){let e=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:e},eJ(e.status)){if("completed"===e.status){let e=await this.getTaskResult({taskId:a},t,r);yield{type:"result",result:e}}else"failed"===e.status?yield{type:"error",error:new eH.Nh(eH.O4.InternalError,`Task ${a} failed`)}:"cancelled"===e.status&&(yield{type:"error",error:new eH.Nh(eH.O4.InternalError,`Task ${a} was cancelled`)});return}if("input_required"===e.status){let e=await this.getTaskResult({taskId:a},t,r);yield{type:"result",result:e};return}let s=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,s)),r?.signal?.throwIfAborted()}}catch(e){yield{type:"error",error:e instanceof eH.Nh?e:new eH.Nh(eH.O4.InternalError,String(e))}}}request(e,t,r){let{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i,task:n,relatedTask:o}=r??{};return new Promise((l,d)=>{let u=e=>{d(e)};if(!this._transport)return void u(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),n&&this.assertTaskCapability(e.method)}catch(e){u(e);return}r?.signal?.throwIfAborted();let c=this._requestMessageId++,h={...e,jsonrpc:"2.0",id:c};r?.onprogress&&(this._progressHandlers.set(c,r.onprogress),h.params={...e.params,_meta:{...e.params?._meta||{},progressToken:c}}),n&&(h.params={...h.params,task:n}),o&&(h.params={...h.params,_meta:{...h.params?._meta||{},[eH.EV]:o}});let p=e=>{this._responseHandlers.delete(c),this._progressHandlers.delete(c),this._cleanupTimeout(c),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:c,reason:String(e)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),d(e instanceof eH.Nh?e:new eH.Nh(eH.O4.RequestTimeout,String(e)))};this._responseHandlers.set(c,e=>{if(!r?.signal?.aborted){if(e instanceof Error)return d(e);try{let r=eV(t,e.result);r.success?l(r.data):d(r.error)}catch(e){d(e)}}}),r?.signal?.addEventListener("abort",()=>{p(r?.signal?.reason)});let f=r?.timeout??6e4;this._setupTimeout(c,f,r?.maxTotalTimeout,()=>p(eH.Nh.fromError(eH.O4.RequestTimeout,"Request timed out",{timeout:f})),r?.resetTimeoutOnProgress??!1);let m=o?.taskId;if(m){let e=e=>{let t=this._responseHandlers.get(c);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${c}`))};this._requestResolvers.set(c,e),this._enqueueTaskMessage(m,{type:"request",message:h,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(c),d(e)})}else this._transport.send(h,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(c),d(e)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},eH.Sc,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},eH.a5,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},eH.gH,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[eH.EV]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.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 r={...e,jsonrpc:"2.0"};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[eH.EV]:t.relatedTask}}}),this._transport?.send(r,t).catch(e=>this._onerror(e))});return}let a={...e,jsonrpc:"2.0"};t?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[eH.EV]:t.relatedTask}}}),await this._transport.send(a,t)}setRequestHandler(e,t){let r=tg(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,a)=>Promise.resolve(t(tv(e,r),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=tg(e);this._notificationHandlers.set(r,r=>Promise.resolve(t(tv(e,r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);void 0!==t&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,a)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){for(let r of(await this._taskMessageQueue.dequeueAll(e,t)))if("request"===r.type&&(0,eH.vo)(r.message)){let t=r.message.id,a=this._requestResolvers.get(t);a?(a(new eH.Nh(eH.O4.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(t)):this._onerror(Error(`Resolver missing for request ${t} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(r=t.pollInterval)}catch{}return new Promise((e,a)=>{if(t.aborted)return void a(new eH.Nh(eH.O4.InvalidRequest,"Request cancelled"));let s=setTimeout(e,r);t.addEventListener("abort",()=>{clearTimeout(s),a(new eH.Nh(eH.O4.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async a=>{if(!e)throw Error("No request provided");return await r.createTask(a,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let a=await r.getTask(e,t);if(!a)throw new eH.Nh(eH.O4.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(e,a,s)=>{await r.storeTaskResult(e,a,s,t);let i=await r.getTask(e,t);if(i){let t=eH.ki.parse({method:"notifications/tasks/status",params:i});await this.notification(t),eJ(i.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>r.getTaskResult(e,t),updateTaskStatus:async(e,a,s)=>{let i=await r.getTask(e,t);if(!i)throw new eH.Nh(eH.O4.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(eJ(i.status))throw new eH.Nh(eH.O4.InvalidParams,`Cannot update task "${e}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(e,a,s,t);let n=await r.getTask(e,t);if(n){let t=eH.ki.parse({method:"notifications/tasks/status",params:n});await this.notification(t),eJ(n.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>r.listTasks(e,t)}}}function t$(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var tb=r(46594),tw=r(74421);class tk{constructor(e){let t;this._ajv=e??(tw(t=new tb({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0})),t)}getValidator(e){let t="$id"in e&&"string"==typeof e.$id?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class tx{constructor(e){this._server=e}requestStream(e,t,r){return this._server.requestStream(e,t,r)}createMessageStream(e,t){let r=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!r?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let t=e.messages[e.messages.length-1],r=Array.isArray(t.content)?t.content:[t.content],a=r.some(e=>"tool_result"===e.type),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],n=i.some(e=>"tool_use"===e.type);if(a){if(r.some(e=>"tool_result"!==e.type))throw Error("The last message must contain only tool_result content if any is present");if(!n)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(n){let e=new Set(i.filter(e=>"tool_use"===e.type).map(e=>e.id)),t=new Set(r.filter(e=>"tool_result"===e.type).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},eH.K1,t)}elicitInputStream(e,t){let r=this._server.getClientCapabilities(),a=e.mode??"form";switch(a){case"url":if(!r?.elicitation?.url)throw Error("Client does not support url elicitation.");break;case"form":if(!r?.elicitation?.form)throw Error("Client does not support form elicitation.")}let s="form"===a&&void 0===e.mode?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},eH.n_,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._server.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}class tS extends t_{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(eH.FP.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return!!r&&this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r)},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new tk,this.setRequestHandler(eH.rk,e=>this._oninitialize(e)),this.setNotificationHandler(eH.ZC,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(eH.b_,async(e,t)=>{let r=t.sessionId||t.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=e.params,s=eH.FP.safeParse(a);return s.success&&this._loggingLevels.set(r,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new tx(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){let r={...e};for(let e in t){let a=t[e];if(void 0===a)continue;let s=r[e];t$(s)&&t$(a)?r[e]={...s,...a}:r[e]=a}return r}(this._capabilities,e)}setRequestHandler(e,t){let r=eL(e),a=r?.method;if(!a)throw Error("Schema is missing a method literal");let s=eY(a);if("string"!=typeof s)throw Error("Schema method literal must be a string");if("tools/call"===s){let r=async(e,r)=>{let a=eV(eH.FT,e);if(!a.success){let e=a.error instanceof Error?a.error.message:String(a.error);throw new eH.Nh(eH.O4.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:s}=a.data,i=await Promise.resolve(t(e,r));if(s.task){let e=eV(eH.Mg,i);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new eH.Nh(eH.O4.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let n=eV(eH.TF,i);if(!n.success){let e=n.error instanceof Error?n.error.message:String(n.error);throw new eH.Nh(eH.O4.InvalidParams,`Invalid tools/call result: ${e}`)}return n.data};return super.setRequestHandler(e,r)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`)}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`)}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw 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 Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw 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 Error(`Server does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){var t=this._clientCapabilities?.tasks?.requests,r="Client";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`)}}assertTaskHandlerCapability(e){if(this._capabilities){var t=this._capabilities.tasks?.requests,r="Server";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);if("tools/call"===e&&!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`)}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:eH.Iu.includes(t)?t:eH.aE,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"},eH.wR)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let t=e.messages[e.messages.length-1],r=Array.isArray(t.content)?t.content:[t.content],a=r.some(e=>"tool_result"===e.type),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],n=i.some(e=>"tool_use"===e.type);if(a){if(r.some(e=>"tool_result"!==e.type))throw Error("The last message must contain only tool_result content if any is present");if(!n)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(n){let e=new Set(i.filter(e=>"tool_use"===e.type).map(e=>e.id)),t=new Set(r.filter(e=>"tool_result"===e.type).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw 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},eH.TI,t):this.request({method:"sampling/createMessage",params:e},eH.K1,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");return this.request({method:"elicitation/create",params:e},eH.n_,t);case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let r="form"===e.mode?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:r},eH.n_,t);if("accept"===a.action&&a.content&&r.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(r.requestedSchema)(a.content);if(!e.valid)throw new eH.Nh(eH.O4.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){if(e instanceof eH.Nh)throw e;throw new eH.Nh(eH.O4.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},eH.Cs,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}let tE=Symbol.for("mcp.completable");function tT(e){return!!e&&"object"==typeof e&&tE in e}(eN||(eN={})).Completable="McpCompletable";let tP=/^[A-Za-z0-9._-]{1,128}$/;function tI(e){let t=function(e){let t=[];if(0===e.length)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!tP.test(e)){let r=e.split("").filter(e=>!/[A-Za-z0-9._-]/.test(e)).filter((e,t,r)=>r.indexOf(e)===t);return t.push(`Tool name contains invalid characters: ${r.map(e=>`"${e}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}(e);var r=t.warnings;if(r.length>0){for(let t of(console.warn(`Tool name validation warning for "${e}":`),r))console.warn(` - ${t}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}return t.isValid}class tN{constructor(e){this._mcpServer=e}registerToolTask(e,t,r){let a={taskSupport:"required",...t.execution};if("forbidden"===a.taskSupport)throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,a,t._meta,r)}}var tj=r(62499);class tO{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new tS(e,t)}get experimental(){return this._experimental||(this._experimental={tasks:new tN(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(tM(eH.gW)),this.server.assertCanSetRequestHandler(tM(eH.FT)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(eH.gW,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r,a={name:e,title:t.title,description:t.description,inputSchema:(r=eU(t.inputSchema))?ty(r,{strictUnions:!0,pipeStrategy:"input"}):tz,annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let e=eU(t.outputSchema);e&&(a.outputSchema=ty(e,{strictUnions:!0,pipeStrategy:"output"}))}return a})})),this.server.setRequestHandler(eH.FT,async(e,t)=>{try{let r=this._registeredTools[e.params.name];if(!r)throw new eH.Nh(eH.O4.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new eH.Nh(eH.O4.InvalidParams,`Tool ${e.params.name} disabled`);let a=!!e.params.task,s=r.execution?.taskSupport,i="createTask"in r.handler;if(("required"===s||"optional"===s)&&!i)throw new eH.Nh(eH.O4.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if("required"===s&&!a)throw new eH.Nh(eH.O4.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if("optional"===s&&!a&&i)return await this.handleAutomaticTaskPolling(r,e,t);let n=await this.validateToolInput(r,e.params.arguments,e.params.name),o=await this.executeToolHandler(r,n,t);if(a)return o;return await this.validateToolOutput(r,o,e.params.name),o}catch(e){if(e instanceof eH.Nh&&e.code===eH.O4.UrlElicitationRequired)throw e;return this.createToolError(e instanceof Error?e.message:String(e))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let a=eU(e.inputSchema)??e.inputSchema,s=await eF(a,t);if(!s.success){let e=eK("error"in s?s.error:"Unknown error");throw new eH.Nh(eH.O4.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${e}`)}return s.data}async validateToolOutput(e,t,r){if(!e.outputSchema||!("content"in t)||t.isError)return;if(!t.structuredContent)throw new eH.Nh(eH.O4.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let a=eU(e.outputSchema),s=await eF(a,t.structuredContent);if(!s.success){let e=eK("error"in s?s.error:"Unknown error");throw new eH.Nh(eH.O4.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${e}`)}}async executeToolHandler(e,t,r){let a=e.handler;if("createTask"in a){if(!r.taskStore)throw Error("No task store provided.");let s={...r,taskStore:r.taskStore};return e.inputSchema?await Promise.resolve(a.createTask(t,s)):await Promise.resolve(a.createTask(s))}return e.inputSchema?await Promise.resolve(a(t,r)):await Promise.resolve(a(r))}async handleAutomaticTaskPolling(e,t,r){if(!r.taskStore)throw Error("No task store provided for task-capable tool.");let a=await this.validateToolInput(e,t.params.arguments,t.params.name),s=e.handler,i={...r,taskStore:r.taskStore},n=a?await Promise.resolve(s.createTask(a,i)):await Promise.resolve(s.createTask(i)),o=n.task.taskId,l=n.task,d=l.pollInterval??5e3;for(;"completed"!==l.status&&"failed"!==l.status&&"cancelled"!==l.status;){await new Promise(e=>setTimeout(e,d));let e=await r.taskStore.getTask(o);if(!e)throw new eH.Nh(eH.O4.InternalError,`Task ${o} not found during polling`);l=e}return await r.taskStore.getTaskResult(o)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(tM(eH.iK)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(eH.iK,async e=>{switch(e.params.ref.type){case"ref/prompt":return(0,eH.uv)(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return(0,eH.X6)(e),this.handleResourceCompletion(e,e.params.ref);default:throw new eH.Nh(eH.O4.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r,a=this._registeredPrompts[t.name];if(!a)throw new eH.Nh(eH.O4.InvalidParams,`Prompt ${t.name} not found`);if(!a.enabled)throw new eH.Nh(eH.O4.InvalidParams,`Prompt ${t.name} disabled`);if(!a.argsSchema)return tD;let s=eL(a.argsSchema),i=s?.[e.params.argument.name];if(!tT(i))return tD;let n=(r=i[tE],r?.complete);return n?tq(await n(e.params.argument.value,e.params.context)):tD}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(e=>e.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return tD;throw new eH.Nh(eH.O4.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let a=r.resourceTemplate.completeCallback(e.params.argument.name);return a?tq(await a(e.params.argument.value,e.params.context)):tD}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(tM(eH.OI)),this.server.assertCanSetRequestHandler(tM(eH.s)),this.server.assertCanSetRequestHandler(tM(eH.R6)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(eH.OI,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([e,t])=>t.enabled).map(([e,t])=>({uri:e,name:t.name,...t.metadata})),a=[];for(let e of Object.values(this._registeredResourceTemplates))if(e.resourceTemplate.listCallback)for(let r of(await e.resourceTemplate.listCallback(t)).resources)a.push({...e.metadata,...r});return{resources:[...r,...a]}}),this.server.setRequestHandler(eH.s,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler(eH.R6,async(e,t)=>{let r=new URL(e.params.uri),a=this._registeredResources[r.toString()];if(a){if(!a.enabled)throw new eH.Nh(eH.O4.InvalidParams,`Resource ${r} disabled`);return a.readCallback(r,t)}for(let e of Object.values(this._registeredResourceTemplates)){let a=e.resourceTemplate.uriTemplate.match(r.toString());if(a)return e.readCallback(r,a,t)}throw new eH.Nh(eH.O4.InvalidParams,`Resource ${r} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(tM(eH.Qq)),this.server.assertCanSetRequestHandler(tM(eH.$p)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(eH.Qq,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>{let r;return{name:e,title:t.title,description:t.description,arguments:t.argsSchema?(r=eL(t.argsSchema))?Object.entries(r).map(([e,t])=>({name:e,description:t.description,required:!(eq(t)?t._zod?.def?.type==="optional":"function"==typeof t.isOptional?t.isOptional():t._def?.typeName==="ZodOptional")})):[]:void 0}})})),this.server.setRequestHandler(eH.$p,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new eH.Nh(eH.O4.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new eH.Nh(eH.O4.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let a=eU(r.argsSchema),s=await eF(a,e.params.arguments);if(!s.success){let t=eK("error"in s?s.error:"Unknown error");throw new eH.Nh(eH.O4.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${t}`)}let i=s.data,n=r.callback;return await Promise.resolve(n(i,t))}{let e=r.callback;return await Promise.resolve(e(t))}}),this._promptHandlersInitialized=!0)}resource(e,t,...r){let a;"object"==typeof r[0]&&(a=r.shift());let s=r[0];if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let r=this._createRegisteredResource(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let r=this._createRegisteredResourceTemplate(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}}registerResource(e,t,r,a){if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let s=this._createRegisteredResource(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,t,r,a,s){let i={name:e,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:e=>{void 0!==e.uri&&e.uri!==r&&(delete this._registeredResources[r],e.uri&&(this._registeredResources[e.uri]=i)),void 0!==e.name&&(i.name=e.name),void 0!==e.title&&(i.title=e.title),void 0!==e.metadata&&(i.metadata=e.metadata),void 0!==e.callback&&(i.readCallback=e.callback),void 0!==e.enabled&&(i.enabled=e.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,a,s){let i={resourceTemplate:r,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredResourceTemplates[e],t.name&&(this._registeredResourceTemplates[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.template&&(i.resourceTemplate=t.template),void 0!==t.metadata&&(i.metadata=t.metadata),void 0!==t.callback&&(i.readCallback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let n=r.uriTemplate.variableNames;return Array.isArray(n)&&n.some(e=>!!r.completeCallback(e))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,a,s){let i={title:t,description:r,argsSchema:void 0===a?void 0:eD(a),callback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredPrompts[e],t.name&&(this._registeredPrompts[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.description&&(i.description=t.description),void 0!==t.argsSchema&&(i.argsSchema=eD(t.argsSchema)),void 0!==t.callback&&(i.callback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=i,a&&Object.values(a).some(e=>tT(e instanceof tj.Ii?e._def?.innerType:e))&&this.setCompletionRequestHandler(),i}_createRegisteredTool(e,t,r,a,s,i,n,o,l){tI(e);let d={title:t,description:r,inputSchema:tZ(a),outputSchema:tZ(s),annotations:i,execution:n,_meta:o,handler:l,enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&("string"==typeof t.name&&tI(t.name),delete this._registeredTools[e],t.name&&(this._registeredTools[t.name]=d)),void 0!==t.title&&(d.title=t.title),void 0!==t.description&&(d.description=t.description),void 0!==t.paramsSchema&&(d.inputSchema=eD(t.paramsSchema)),void 0!==t.outputSchema&&(d.outputSchema=eD(t.outputSchema)),void 0!==t.callback&&(d.handler=t.callback),void 0!==t.annotations&&(d.annotations=t.annotations),void 0!==t._meta&&(d._meta=t._meta),void 0!==t.enabled&&(d.enabled=t.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}tool(e,...t){let r,a,s,i;if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);if("string"==typeof t[0]&&(r=t.shift()),t.length>1){let r=t[0];if(tR(r))a=t.shift(),t.length>1&&"object"==typeof t[0]&&null!==t[0]&&!tR(t[0])&&(i=t.shift());else if("object"==typeof r&&null!==r){if(Object.values(r).some(e=>"object"==typeof e&&null!==e))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);i=t.shift()}}let n=t[0];return this._createRegisteredTool(e,void 0,r,a,s,i,{taskSupport:"forbidden"},void 0,n)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:a,description:s,inputSchema:i,outputSchema:n,annotations:o,_meta:l}=t;return this._createRegisteredTool(e,a,s,i,n,o,{taskSupport:"forbidden"},l,r)}prompt(e,...t){let r,a;if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);"string"==typeof t[0]&&(r=t.shift()),t.length>1&&(a=t.shift());let s=t[0],i=this._createRegisteredPrompt(e,void 0,r,a,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:a,description:s,argsSchema:i}=t,n=this._createRegisteredPrompt(e,a,s,i,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),n}isConnected(){return void 0!==this.server.transport}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}let tz={type:"object",properties:{}};function tC(e){return null!==e&&"object"==typeof e&&"parse"in e&&"function"==typeof e.parse&&"safeParse"in e&&"function"==typeof e.safeParse}function tA(e){return"_def"in e||"_zod"in e||tC(e)}function tR(e){return!("object"!=typeof e||null===e||tA(e))&&(0===Object.keys(e).length||Object.values(e).some(tC))}function tZ(e){if(e){if(tR(e))return eD(e);if(!tA(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function tM(e){let t=eL(e),r=t?.method;if(!r)throw Error("Schema is missing a method literal");let a=eY(r);if("string"==typeof a)return a;throw Error("Schema method literal must be a string")}function tq(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}let tD={completion:{values:[],hasMore:!1}}},66029(e,t,r){r.d(t,{S:()=>n});var a=r(1708),s=r(13298);class i{constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){var e;if(!this._buffer)return null;let t=this._buffer.indexOf("\n");if(-1===t)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),e=r,s.OR.parse(JSON.parse(e))}clear(){this._buffer=void 0}}class n{constructor(e=a.stdin,t=a.stdout,r){this._stdin=e,this._stdout=t,this._started=!1,this._ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}},this._onerror=e=>{this.onerror?.(e)},this._readBuffer=new i({maxBufferSize:r?.maxBufferSize})}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let r=JSON.stringify(e)+"\n";this._stdout.write(r)?t():this._stdout.once("drain",t)})}}},13298(e,t,r){r.d(t,{$p:()=>eD,Cs:()=>tD,EV:()=>d,FP:()=>e3,FT:()=>e2,Iu:()=>l,K1:()=>tu,LW:()=>j,Mg:()=>ei,Nh:()=>tF,O4:()=>s,OI:()=>ek,OR:()=>O,Ql:()=>el,Qq:()=>eZ,R6:()=>eP,Sc:()=>ed,Sq:()=>A,TF:()=>e9,TI:()=>tc,X6:()=>tR,ZC:()=>B,_r:()=>X,a5:()=>eh,aE:()=>o,bZ:()=>v,b_:()=>e6,gH:()=>ef,gW:()=>e0,gd:()=>ep,iK:()=>tC,ig:()=>I,ki:()=>eo,lg:()=>T,n_:()=>tN,oQ:()=>eu,rk:()=>Y,s:()=>eS,tC:()=>G,uv:()=>tA,vo:()=>S,wR:()=>z,zR:()=>ec});var a,s,i=r(62499),n=r(8304);let o="2025-11-25",l=[o,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],d="io.modelcontextprotocol/related-task",u=i.Ie(e=>null!==e&&("object"==typeof e||"function"==typeof e)),c=i.KC([i.Yj(),i.ai().int()]),h=i.Yj();i._H({ttl:i.ai().optional(),pollInterval:i.ai().optional()});let p=i.Ik({ttl:i.ai().optional()}),f=i.Ik({taskId:i.Yj()}),m=i._H({progressToken:c.optional(),[d]:f.optional()}),y=i.Ik({_meta:m.optional()}),g=y.extend({task:p.optional()}),v=e=>g.safeParse(e).success,_=i.Ik({method:i.Yj(),params:y.loose().optional()}),$=i.Ik({_meta:m.optional()}),b=i.Ik({method:i.Yj(),params:$.loose().optional()}),w=i._H({_meta:m.optional()}),k=i.KC([i.Yj(),i.ai().int()]),x=i.Ik({jsonrpc:i.eu("2.0"),id:k,..._.shape}).strict(),S=e=>x.safeParse(e).success,E=i.Ik({jsonrpc:i.eu("2.0"),...b.shape}).strict(),T=e=>E.safeParse(e).success,P=i.Ik({jsonrpc:i.eu("2.0"),id:k,result:w}).strict(),I=e=>P.safeParse(e).success;(a=s||(s={}))[a.ConnectionClosed=-32e3]="ConnectionClosed",a[a.RequestTimeout=-32001]="RequestTimeout",a[a.ParseError=-32700]="ParseError",a[a.InvalidRequest=-32600]="InvalidRequest",a[a.MethodNotFound=-32601]="MethodNotFound",a[a.InvalidParams=-32602]="InvalidParams",a[a.InternalError=-32603]="InternalError",a[a.UrlElicitationRequired=-32042]="UrlElicitationRequired";let N=i.Ik({jsonrpc:i.eu("2.0"),id:k.optional(),error:i.Ik({code:i.ai().int(),message:i.Yj(),data:i.L5().optional()})}).strict(),j=e=>N.safeParse(e).success,O=i.KC([x,E,P,N]);i.KC([P,N]);let z=w.strict(),C=$.extend({requestId:k.optional(),reason:i.Yj().optional()}),A=b.extend({method:i.eu("notifications/cancelled"),params:C}),R=i.Ik({src:i.Yj(),mimeType:i.Yj().optional(),sizes:i.YO(i.Yj()).optional(),theme:i.k5(["light","dark"]).optional()}),Z=i.Ik({icons:i.YO(R).optional()}),M=i.Ik({name:i.Yj(),title:i.Yj().optional()}),q=M.extend({...M.shape,...Z.shape,version:i.Yj(),websiteUrl:i.Yj().optional(),description:i.Yj().optional()}),D=i.E$(i.Ik({applyDefaults:i.zM().optional()}),i.g1(i.Yj(),i.L5())),V=i.vk(e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,i.E$(i.Ik({form:D.optional(),url:u.optional()}),i.g1(i.Yj(),i.L5()).optional())),F=i._H({list:u.optional(),cancel:u.optional(),requests:i._H({sampling:i._H({createMessage:u.optional()}).optional(),elicitation:i._H({create:u.optional()}).optional()}).optional()}),L=i._H({list:u.optional(),cancel:u.optional(),requests:i._H({tools:i._H({call:u.optional()}).optional()}).optional()}),U=i.Ik({experimental:i.g1(i.Yj(),u).optional(),sampling:i.Ik({context:u.optional(),tools:u.optional()}).optional(),elicitation:V.optional(),roots:i.Ik({listChanged:i.zM().optional()}).optional(),tasks:F.optional(),extensions:i.g1(i.Yj(),u).optional()}),K=y.extend({protocolVersion:i.Yj(),capabilities:U,clientInfo:q}),Y=_.extend({method:i.eu("initialize"),params:K}),H=i.Ik({experimental:i.g1(i.Yj(),u).optional(),logging:u.optional(),completions:u.optional(),prompts:i.Ik({listChanged:i.zM().optional()}).optional(),resources:i.Ik({subscribe:i.zM().optional(),listChanged:i.zM().optional()}).optional(),tools:i.Ik({listChanged:i.zM().optional()}).optional(),tasks:L.optional(),extensions:i.g1(i.Yj(),u).optional()}),J=w.extend({protocolVersion:i.Yj(),capabilities:H,serverInfo:q,instructions:i.Yj().optional()}),B=b.extend({method:i.eu("notifications/initialized"),params:$.optional()}),G=_.extend({method:i.eu("ping"),params:y.optional()}),W=i.Ik({progress:i.ai(),total:i.lq(i.ai()),message:i.lq(i.Yj())}),Q=i.Ik({...$.shape,...W.shape,progressToken:c}),X=b.extend({method:i.eu("notifications/progress"),params:Q}),ee=y.extend({cursor:h.optional()}),et=_.extend({params:ee.optional()}),er=w.extend({nextCursor:h.optional()}),ea=i.k5(["working","input_required","completed","failed","cancelled"]),es=i.Ik({taskId:i.Yj(),status:ea,ttl:i.KC([i.ai(),i.ch()]),createdAt:i.Yj(),lastUpdatedAt:i.Yj(),pollInterval:i.lq(i.ai()),statusMessage:i.lq(i.Yj())}),ei=w.extend({task:es}),en=$.merge(es),eo=b.extend({method:i.eu("notifications/tasks/status"),params:en}),el=_.extend({method:i.eu("tasks/get"),params:y.extend({taskId:i.Yj()})}),ed=w.merge(es),eu=_.extend({method:i.eu("tasks/result"),params:y.extend({taskId:i.Yj()})});w.loose();let ec=et.extend({method:i.eu("tasks/list")}),eh=er.extend({tasks:i.YO(es)}),ep=_.extend({method:i.eu("tasks/cancel"),params:y.extend({taskId:i.Yj()})}),ef=w.merge(es),em=i.Ik({uri:i.Yj(),mimeType:i.lq(i.Yj()),_meta:i.g1(i.Yj(),i.L5()).optional()}),ey=em.extend({text:i.Yj()}),eg=i.Yj().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),ev=em.extend({blob:eg}),e_=i.k5(["user","assistant"]),e$=i.Ik({audience:i.YO(e_).optional(),priority:i.ai().min(0).max(1).optional(),lastModified:n.w$({offset:!0}).optional()}),eb=i.Ik({...M.shape,...Z.shape,uri:i.Yj(),description:i.lq(i.Yj()),mimeType:i.lq(i.Yj()),size:i.lq(i.ai()),annotations:e$.optional(),_meta:i.lq(i._H({}))}),ew=i.Ik({...M.shape,...Z.shape,uriTemplate:i.Yj(),description:i.lq(i.Yj()),mimeType:i.lq(i.Yj()),annotations:e$.optional(),_meta:i.lq(i._H({}))}),ek=et.extend({method:i.eu("resources/list")}),ex=er.extend({resources:i.YO(eb)}),eS=et.extend({method:i.eu("resources/templates/list")}),eE=er.extend({resourceTemplates:i.YO(ew)}),eT=y.extend({uri:i.Yj()}),eP=_.extend({method:i.eu("resources/read"),params:eT}),eI=w.extend({contents:i.YO(i.KC([ey,ev]))}),eN=b.extend({method:i.eu("notifications/resources/list_changed"),params:$.optional()}),ej=_.extend({method:i.eu("resources/subscribe"),params:eT}),eO=_.extend({method:i.eu("resources/unsubscribe"),params:eT}),ez=$.extend({uri:i.Yj()}),eC=b.extend({method:i.eu("notifications/resources/updated"),params:ez}),eA=i.Ik({name:i.Yj(),description:i.lq(i.Yj()),required:i.lq(i.zM())}),eR=i.Ik({...M.shape,...Z.shape,description:i.lq(i.Yj()),arguments:i.lq(i.YO(eA)),_meta:i.lq(i._H({}))}),eZ=et.extend({method:i.eu("prompts/list")}),eM=er.extend({prompts:i.YO(eR)}),eq=y.extend({name:i.Yj(),arguments:i.g1(i.Yj(),i.Yj()).optional()}),eD=_.extend({method:i.eu("prompts/get"),params:eq}),eV=i.Ik({type:i.eu("text"),text:i.Yj(),annotations:e$.optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),eF=i.Ik({type:i.eu("image"),data:eg,mimeType:i.Yj(),annotations:e$.optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),eL=i.Ik({type:i.eu("audio"),data:eg,mimeType:i.Yj(),annotations:e$.optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),eU=i.Ik({type:i.eu("tool_use"),name:i.Yj(),id:i.Yj(),input:i.g1(i.Yj(),i.L5()),_meta:i.g1(i.Yj(),i.L5()).optional()}),eK=i.Ik({type:i.eu("resource"),resource:i.KC([ey,ev]),annotations:e$.optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),eY=eb.extend({type:i.eu("resource_link")}),eH=i.KC([eV,eF,eL,eY,eK]),eJ=i.Ik({role:e_,content:eH}),eB=w.extend({description:i.Yj().optional(),messages:i.YO(eJ)}),eG=b.extend({method:i.eu("notifications/prompts/list_changed"),params:$.optional()}),eW=i.Ik({title:i.Yj().optional(),readOnlyHint:i.zM().optional(),destructiveHint:i.zM().optional(),idempotentHint:i.zM().optional(),openWorldHint:i.zM().optional()}),eQ=i.Ik({taskSupport:i.k5(["required","optional","forbidden"]).optional()}),eX=i.Ik({...M.shape,...Z.shape,description:i.Yj().optional(),inputSchema:i.Ik({type:i.eu("object"),properties:i.g1(i.Yj(),u).optional(),required:i.YO(i.Yj()).optional()}).catchall(i.L5()),outputSchema:i.Ik({type:i.eu("object"),properties:i.g1(i.Yj(),u).optional(),required:i.YO(i.Yj()).optional()}).catchall(i.L5()).optional(),annotations:eW.optional(),execution:eQ.optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),e0=et.extend({method:i.eu("tools/list")}),e1=er.extend({tools:i.YO(eX)}),e9=w.extend({content:i.YO(eH).default([]),structuredContent:i.g1(i.Yj(),i.L5()).optional(),isError:i.zM().optional()});e9.or(w.extend({toolResult:i.L5()}));let e4=g.extend({name:i.Yj(),arguments:i.g1(i.Yj(),i.L5()).optional()}),e2=_.extend({method:i.eu("tools/call"),params:e4}),e5=b.extend({method:i.eu("notifications/tools/list_changed"),params:$.optional()});i.Ik({autoRefresh:i.zM().default(!0),debounceMs:i.ai().int().nonnegative().default(300)});let e3=i.k5(["debug","info","notice","warning","error","critical","alert","emergency"]),e8=y.extend({level:e3}),e6=_.extend({method:i.eu("logging/setLevel"),params:e8}),e7=$.extend({level:e3,logger:i.Yj().optional(),data:i.L5()}),te=b.extend({method:i.eu("notifications/message"),params:e7}),tt=i.Ik({name:i.Yj().optional()}),tr=i.Ik({hints:i.YO(tt).optional(),costPriority:i.ai().min(0).max(1).optional(),speedPriority:i.ai().min(0).max(1).optional(),intelligencePriority:i.ai().min(0).max(1).optional()}),ta=i.Ik({mode:i.k5(["auto","required","none"]).optional()}),ts=i.Ik({type:i.eu("tool_result"),toolUseId:i.Yj().describe("The unique identifier for the corresponding tool call."),content:i.YO(eH).default([]),structuredContent:i.Ik({}).loose().optional(),isError:i.zM().optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),ti=i.gM("type",[eV,eF,eL]),tn=i.gM("type",[eV,eF,eL,eU,ts]),to=i.Ik({role:e_,content:i.KC([tn,i.YO(tn)]),_meta:i.g1(i.Yj(),i.L5()).optional()}),tl=g.extend({messages:i.YO(to),modelPreferences:tr.optional(),systemPrompt:i.Yj().optional(),includeContext:i.k5(["none","thisServer","allServers"]).optional(),temperature:i.ai().optional(),maxTokens:i.ai().int(),stopSequences:i.YO(i.Yj()).optional(),metadata:u.optional(),tools:i.YO(eX).optional(),toolChoice:ta.optional()}),td=_.extend({method:i.eu("sampling/createMessage"),params:tl}),tu=w.extend({model:i.Yj(),stopReason:i.lq(i.k5(["endTurn","stopSequence","maxTokens"]).or(i.Yj())),role:e_,content:ti}),tc=w.extend({model:i.Yj(),stopReason:i.lq(i.k5(["endTurn","stopSequence","maxTokens","toolUse"]).or(i.Yj())),role:e_,content:i.KC([tn,i.YO(tn)])}),th=i.Ik({type:i.eu("boolean"),title:i.Yj().optional(),description:i.Yj().optional(),default:i.zM().optional()}),tp=i.Ik({type:i.eu("string"),title:i.Yj().optional(),description:i.Yj().optional(),minLength:i.ai().optional(),maxLength:i.ai().optional(),format:i.k5(["email","uri","date","date-time"]).optional(),default:i.Yj().optional()}),tf=i.Ik({type:i.k5(["number","integer"]),title:i.Yj().optional(),description:i.Yj().optional(),minimum:i.ai().optional(),maximum:i.ai().optional(),default:i.ai().optional()}),tm=i.Ik({type:i.eu("string"),title:i.Yj().optional(),description:i.Yj().optional(),enum:i.YO(i.Yj()),default:i.Yj().optional()}),ty=i.Ik({type:i.eu("string"),title:i.Yj().optional(),description:i.Yj().optional(),oneOf:i.YO(i.Ik({const:i.Yj(),title:i.Yj()})),default:i.Yj().optional()}),tg=i.Ik({type:i.eu("string"),title:i.Yj().optional(),description:i.Yj().optional(),enum:i.YO(i.Yj()),enumNames:i.YO(i.Yj()).optional(),default:i.Yj().optional()}),tv=i.KC([tm,ty]),t_=i.Ik({type:i.eu("array"),title:i.Yj().optional(),description:i.Yj().optional(),minItems:i.ai().optional(),maxItems:i.ai().optional(),items:i.Ik({type:i.eu("string"),enum:i.YO(i.Yj())}),default:i.YO(i.Yj()).optional()}),t$=i.Ik({type:i.eu("array"),title:i.Yj().optional(),description:i.Yj().optional(),minItems:i.ai().optional(),maxItems:i.ai().optional(),items:i.Ik({anyOf:i.YO(i.Ik({const:i.Yj(),title:i.Yj()}))}),default:i.YO(i.Yj()).optional()}),tb=i.KC([t_,t$]),tw=i.KC([tg,tv,tb]),tk=i.KC([tw,th,tp,tf]),tx=g.extend({mode:i.eu("form").optional(),message:i.Yj(),requestedSchema:i.Ik({type:i.eu("object"),properties:i.g1(i.Yj(),tk),required:i.YO(i.Yj()).optional()})}),tS=g.extend({mode:i.eu("url"),message:i.Yj(),elicitationId:i.Yj(),url:i.Yj().url()}),tE=i.KC([tx,tS]),tT=_.extend({method:i.eu("elicitation/create"),params:tE}),tP=$.extend({elicitationId:i.Yj()}),tI=b.extend({method:i.eu("notifications/elicitation/complete"),params:tP}),tN=w.extend({action:i.k5(["accept","decline","cancel"]),content:i.vk(e=>null===e?void 0:e,i.g1(i.Yj(),i.KC([i.Yj(),i.ai(),i.zM(),i.YO(i.Yj())])).optional())}),tj=i.Ik({type:i.eu("ref/resource"),uri:i.Yj()}),tO=i.Ik({type:i.eu("ref/prompt"),name:i.Yj()}),tz=y.extend({ref:i.KC([tO,tj]),argument:i.Ik({name:i.Yj(),value:i.Yj()}),context:i.Ik({arguments:i.g1(i.Yj(),i.Yj()).optional()}).optional()}),tC=_.extend({method:i.eu("completion/complete"),params:tz});function tA(e){if("ref/prompt"!==e.params.ref.type)throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function tR(e){if("ref/resource"!==e.params.ref.type)throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}let tZ=w.extend({completion:i._H({values:i.YO(i.Yj()).max(100),total:i.lq(i.ai().int()),hasMore:i.lq(i.zM())})}),tM=i.Ik({uri:i.Yj().startsWith("file://"),name:i.Yj().optional(),_meta:i.g1(i.Yj(),i.L5()).optional()}),tq=_.extend({method:i.eu("roots/list"),params:y.optional()}),tD=w.extend({roots:i.YO(tM)}),tV=b.extend({method:i.eu("notifications/roots/list_changed"),params:$.optional()});i.KC([G,Y,tC,e6,eD,eZ,ek,eS,eP,ej,eO,e2,e0,el,eu,ec,ep]),i.KC([A,X,B,tV,eo]),i.KC([z,tu,tc,tN,tD,ed,eh,ei]),i.KC([G,td,tT,tq,el,eu,ec,ep]),i.KC([A,X,te,eC,eN,e5,eG,eo,tI]),i.KC([z,J,tZ,eB,eM,ex,eE,eI,e9,e1,ed,eh,ei]);class tF extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){return e===s.UrlElicitationRequired&&r&&r.elicitations?new tL(r.elicitations,t):new tF(e,t,r)}}class tL extends tF{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(s.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}},8304(e,t,r){r.d(t,{kB:()=>h,p0:()=>f,p6:()=>u,w$:()=>l});var a=r(76773),s=r(84964),i=r(52992),n=r(62499);let o=a.xI("ZodISODateTime",(e,t)=>{s.Ko.init(e,t),n.EB.init(e,t)});function l(e){return i.G1(o,e)}let d=a.xI("ZodISODate",(e,t)=>{s.v1.init(e,t),n.EB.init(e,t)});function u(e){return i.db(d,e)}let c=a.xI("ZodISOTime",(e,t)=>{s.Ax.init(e,t),n.EB.init(e,t)});function h(e){return i.Kn(c,e)}let p=a.xI("ZodISODuration",(e,t)=>{s.$N.init(e,t),n.EB.init(e,t)});function f(e){return i.f2(p,e)}},62499(e,t,r){r.d(t,{ch:()=>es,L5:()=>en,g1:()=>e$,ai:()=>X,Ik:()=>ec,YO:()=>ed,_H:()=>eh,EB:()=>O,Ie:()=>eV,gM:()=>ey,k5:()=>ew,E$:()=>ev,lq:()=>eP,vk:()=>eF,zM:()=>er,Ii:()=>eT,Yj:()=>j,eu:()=>ex,KC:()=>ef});var a=r(76773),s=r(84964),i=r(30174),n=r(32413),o=r(52992),l=r(76882),d=r(58560),u=r(8304),c=r(879),h=r(717);let p=a.xI("ZodError",(e,t)=>{h.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>h.Wk(e,t)},flatten:{value:t=>h.JM(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,i.k8,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,i.k8,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),f=c.Tj(p),m=c.Rb(p),y=c.Od(p),g=c.wG(p),v=c.Mv(p),_=c.e2(p),$=c.GW(p),b=c.or(p),w=c.rh(p),k=c.VS(p),x=c.v_(p),S=c.R3(p),E=new WeakMap;function T(e,t,r){let a=Object.getPrototypeOf(e),s=E.get(a);if(s||(s=new Set,E.set(a,s)),!s.has(t))for(let e in s.add(t),r){let t=r[e];Object.defineProperty(a,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let P=a.xI("ZodType",(e,t)=>(s.W4.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:(0,d.uE)(e,"input"),output:(0,d.uE)(e,"output")}}),e.toJSONSchema=(0,d.OA)(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>f(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>y(e,t,r),e.parseAsync=async(t,r)=>m(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>g(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>v(e,t,r),e.decode=(t,r)=>_(e,t,r),e.encodeAsync=async(t,r)=>$(e,t,r),e.decodeAsync=async(t,r)=>b(e,t,r),e.safeEncode=(t,r)=>w(e,t,r),e.safeDecode=(t,r)=>k(e,t,r),e.safeEncodeAsync=async(t,r)=>x(e,t,r),e.safeDecodeAsync=async(t,r)=>S(e,t,r),T(e,"ZodType",{check(...e){let t=this.def;return this.clone(i.zM(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return i.o8(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return o.fU(eD,e,t)}(e,t))},superRefine(e,t){var r,a;return this.check((r=e,a=t,o.MB(r,a)))},overwrite(e){return this.check(o.bS(e))},optional(){return eP(this)},exactOptional(){var e;return e=this,new eI({type:"optional",innerType:e})},nullable(){return ej(this)},nullish(){return eP(ej(this))},nonoptional(e){var t,r;return t=this,r=e,new eC({type:"nonoptional",innerType:t,...i.A2(r)})},array(){return ed(this)},or(e){return ef([this,e])},and(e){return ev(this,e)},transform(e){return eZ(this,eE(e))},default(e){var t,r;return t=this,r=e,new eO({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():i.yG(r)}})},prefault(e){var t,r;return t=this,r=e,new ez({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():i.yG(r)}})},catch(e){var t,r;return t=this,new eA({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return eZ(this,e)},readonly(){var e;return e=this,new eq({type:"readonly",innerType:e})},describe(e){let t=this.clone();return n.fd.add(t,{description:e}),t},meta(...e){if(0===e.length)return n.fd.get(this);let t=this.clone();return n.fd.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>n.fd.get(e)?.description,configurable:!0}),e)),I=a.xI("_ZodString",(e,t)=>{s.$v.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.SW(e,t,r,a);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,T(e,"_ZodString",{regex(...e){return this.check(o.Fk(...e))},includes(...e){return this.check(o.dR(...e))},startsWith(...e){return this.check(o.$S(...e))},endsWith(...e){return this.check(o.ER(...e))},min(...e){return this.check(o.m9(...e))},max(...e){return this.check(o.Eb(...e))},length(...e){return this.check(o.YA(...e))},nonempty(...e){return this.check(o.m9(1,...e))},lowercase(e){return this.check(o.hH(e))},uppercase(e){return this.check(o.qF(e))},trim(){return this.check(o.WN())},normalize(...e){return this.check(o.lo(...e))},toLowerCase(){return this.check(o.Il())},toUpperCase(){return this.check(o.xY())},slugify(){return this.check(o.TL())}})}),N=a.xI("ZodString",(e,t)=>{s.$v.init(e,t),I.init(e,t),e.email=t=>e.check(o.Mu(z,t)),e.url=t=>e.check(o.Fn(R,t)),e.jwt=t=>e.check(o.rk(W,t)),e.emoji=t=>e.check(o.aC(Z,t)),e.guid=t=>e.check(o.tB(C,t)),e.uuid=t=>e.check(o.Be(A,t)),e.uuidv4=t=>e.check(o.nA(A,t)),e.uuidv6=t=>e.check(o.pY(A,t)),e.uuidv7=t=>e.check(o.wA(A,t)),e.nanoid=t=>e.check(o.Dl(M,t)),e.guid=t=>e.check(o.tB(C,t)),e.cuid=t=>e.check(o.fs(q,t)),e.cuid2=t=>e.check(o.Bj(D,t)),e.ulid=t=>e.check(o.Ct(V,t)),e.base64=t=>e.check(o.rt(J,t)),e.base64url=t=>e.check(o.cU(B,t)),e.xid=t=>e.check(o.Pw(F,t)),e.ksuid=t=>e.check(o._z(L,t)),e.ipv4=t=>e.check(o.Ny(U,t)),e.ipv6=t=>e.check(o.$O(K,t)),e.cidrv4=t=>e.check(o.Uy(Y,t)),e.cidrv6=t=>e.check(o.gP(H,t)),e.e164=t=>e.check(o.KB(G,t)),e.datetime=t=>e.check(u.w$(t)),e.date=t=>e.check(u.p6(t)),e.time=t=>e.check(u.kB(t)),e.duration=t=>e.check(u.p0(t))});function j(e){return o.Rl(N,e)}let O=a.xI("ZodStringFormat",(e,t)=>{s.EY.init(e,t),I.init(e,t)}),z=a.xI("ZodEmail",(e,t)=>{s.qG.init(e,t),O.init(e,t)}),C=a.xI("ZodGUID",(e,t)=>{s.Zc.init(e,t),O.init(e,t)}),A=a.xI("ZodUUID",(e,t)=>{s.Zn.init(e,t),O.init(e,t)}),R=a.xI("ZodURL",(e,t)=>{s.VY.init(e,t),O.init(e,t)}),Z=a.xI("ZodEmoji",(e,t)=>{s.cG.init(e,t),O.init(e,t)}),M=a.xI("ZodNanoID",(e,t)=>{s.Py.init(e,t),O.init(e,t)}),q=a.xI("ZodCUID",(e,t)=>{s.bl.init(e,t),O.init(e,t)}),D=a.xI("ZodCUID2",(e,t)=>{s.Zu.init(e,t),O.init(e,t)}),V=a.xI("ZodULID",(e,t)=>{s.g5.init(e,t),O.init(e,t)}),F=a.xI("ZodXID",(e,t)=>{s.TF.init(e,t),O.init(e,t)}),L=a.xI("ZodKSUID",(e,t)=>{s.GY.init(e,t),O.init(e,t)}),U=a.xI("ZodIPv4",(e,t)=>{s.Lc.init(e,t),O.init(e,t)}),K=a.xI("ZodIPv6",(e,t)=>{s.Zy.init(e,t),O.init(e,t)}),Y=a.xI("ZodCIDRv4",(e,t)=>{s.CI.init(e,t),O.init(e,t)}),H=a.xI("ZodCIDRv6",(e,t)=>{s.Cn.init(e,t),O.init(e,t)}),J=a.xI("ZodBase64",(e,t)=>{s.Dq.init(e,t),O.init(e,t)}),B=a.xI("ZodBase64URL",(e,t)=>{s.CQ.init(e,t),O.init(e,t)}),G=a.xI("ZodE164",(e,t)=>{s.Oy.init(e,t),O.init(e,t)}),W=a.xI("ZodJWT",(e,t)=>{s.h8.init(e,t),O.init(e,t)}),Q=a.xI("ZodNumber",(e,t)=>{s.vz.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.Wg(e,t,r,a),T(e,"ZodNumber",{gt(e,t){return this.check(o.Tx(e,t))},gte(e,t){return this.check(o.qm(e,t))},min(e,t){return this.check(o.qm(e,t))},lt(e,t){return this.check(o.Au(e,t))},lte(e,t){return this.check(o.Zm(e,t))},max(e,t){return this.check(o.Zm(e,t))},int(e){var t;return this.check((t=e,o.LK(ee,t)))},safe(e){var t;return this.check((t=e,o.LK(ee,t)))},positive(e){return this.check(o.Tx(0,e))},nonnegative(e){return this.check(o.qm(0,e))},negative(e){return this.check(o.Au(0,e))},nonpositive(e){return this.check(o.Zm(0,e))},multipleOf(e,t){return this.check(o.Hi(e,t))},step(e,t){return this.check(o.Hi(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function X(e){return o.F7(Q,e)}let ee=a.xI("ZodNumberFormat",(e,t)=>{s.I.init(e,t),Q.init(e,t)}),et=a.xI("ZodBoolean",(e,t)=>{s.sF.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.dO(e,t,r,a)});function er(e){return o._L(et,e)}let ea=a.xI("ZodNull",(e,t)=>{s.x8.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.In(e,t,r,a)});function es(e){return o.jw(ea,e)}let ei=a.xI("ZodUnknown",(e,t)=>{s.GP.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.NV(e,t,r,a)});function en(){return o.em(ei)}let eo=a.xI("ZodNever",(e,t)=>{s.Um.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.RH(e,t,r,a)}),el=a.xI("ZodArray",(e,t)=>{s.$p.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.cY(e,t,r,a),e.element=t.element,T(e,"ZodArray",{min(e,t){return this.check(o.m9(e,t))},nonempty(e){return this.check(o.m9(1,e))},max(e,t){return this.check(o.Eb(e,t))},length(e,t){return this.check(o.YA(e,t))},unwrap(){return this.element}})});function ed(e,t){return o.dZ(el,e,t)}let eu=a.xI("ZodObject",(e,t)=>{s.w.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.Ec(e,t,r,a),i.gJ(e,"shape",()=>t.shape),T(e,"ZodObject",{keyof(){return ew(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:en()})},loose(){return this.clone({...this._zod.def,catchall:en()})},strict(){return this.clone({...this._zod.def,catchall:o.G8(eo,void 0)})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return i.X$(this,e)},safeExtend(e){return i.W0(this,e)},merge(e){return i.h1(this,e)},pick(e){return i.Up(this,e)},omit(e){return i.cJ(this,e)},partial(...e){return i.OH(eT,this,e[0])},required(...e){return i.mw(eC,this,e[0])}})});function ec(e,t){return new eu({type:"object",shape:e??{},...i.A2(t)})}function eh(e,t){return new eu({type:"object",shape:e,catchall:en(),...i.A2(t)})}let ep=a.xI("ZodUnion",(e,t)=>{s.cu.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.iC(e,t,r,a),e.options=t.options});function ef(e,t){return new ep({type:"union",options:e,...i.A2(t)})}let em=a.xI("ZodDiscriminatedUnion",(e,t)=>{ep.init(e,t),s.P0.init(e,t)});function ey(e,t,r){return new em({type:"union",options:t,discriminator:e,...i.A2(r)})}let eg=a.xI("ZodIntersection",(e,t)=>{s.LJ.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.i_(e,t,r,a)});function ev(e,t){return new eg({type:"intersection",left:e,right:t})}let e_=a.xI("ZodRecord",(e,t)=>{s.h.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.GC(e,t,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function e$(e,t,r){return new e_(t&&t._zod?{type:"record",keyType:e,valueType:t,...i.A2(r)}:{type:"record",keyType:j(),valueType:e,...i.A2(t)})}let eb=a.xI("ZodEnum",(e,t)=>{s.VO.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.C0(e,t,r,a),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,a)=>{let s={};for(let a of e)if(r.has(a))s[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new eb({...t,checks:[],...i.A2(a),entries:s})},e.exclude=(e,a)=>{let s={...t.entries};for(let t of e)if(r.has(t))delete s[t];else throw Error(`Key ${t} not found in enum`);return new eb({...t,checks:[],...i.A2(a),entries:s})}});function ew(e,t){return new eb({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...i.A2(t)})}let ek=a.xI("ZodLiteral",(e,t)=>{s.nu.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.Yv(e,t,r,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ex(e,t){return new ek({type:"literal",values:Array.isArray(e)?e:[e],...i.A2(t)})}let eS=a.xI("ZodTransform",(e,t)=>{s.Wc.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.xi(e,t,r,a),e._zod.parse=(r,s)=>{if("backward"===s.direction)throw new a.cV(e.constructor.name);r.addIssue=a=>{"string"==typeof a?r.issues.push(i.sn(a,r.value,t)):(a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(i.sn(a)))};let n=t.transform(r.value,r);return n instanceof Promise?n.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function eE(e){return new eS({type:"transform",transform:e})}let eT=a.xI("ZodOptional",(e,t)=>{s.ig.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.$k(e,t,r,a),e.unwrap=()=>e._zod.def.innerType});function eP(e){return new eT({type:"optional",innerType:e})}let eI=a.xI("ZodExactOptional",(e,t)=>{s.RL.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.$k(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),eN=a.xI("ZodNullable",(e,t)=>{s.qc.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.yq(e,t,r,a),e.unwrap=()=>e._zod.def.innerType});function ej(e){return new eN({type:"nullable",innerType:e})}let eO=a.xI("ZodDefault",(e,t)=>{s.rv.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.mh(e,t,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ez=a.xI("ZodPrefault",(e,t)=>{s.VF.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.A(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),eC=a.xI("ZodNonOptional",(e,t)=>{s.N$.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.cR(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),eA=a.xI("ZodCatch",(e,t)=>{s.t$.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.Q9(e,t,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),eR=a.xI("ZodPipe",(e,t)=>{s._m.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.fs(e,t,r,a),e.in=t.in,e.out=t.out});function eZ(e,t){return new eR({type:"pipe",in:e,out:t})}let eM=a.xI("ZodPreprocess",(e,t)=>{eR.init(e,t),s.KX.init(e,t)}),eq=a.xI("ZodReadonly",(e,t)=>{s.Sb.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.$X(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),eD=a.xI("ZodCustom",(e,t)=>{s.b0.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,r,a)=>l.A6(e,t,r,a)});function eV(e,t){return o.FO(eD,e??(()=>!0),t)}function eF(e,t){return new eM({type:"pipe",in:eE(e),out:t})}o.q0,o.mI},52992(e,t,r){r.d(t,{$O:()=>w,$S:()=>W,Au:()=>q,Be:()=>d,Bj:()=>g,Ct:()=>v,Dl:()=>m,ER:()=>Q,Eb:()=>U,F7:()=>z,FO:()=>en,Fk:()=>H,Fn:()=>p,G1:()=>I,G8:()=>M,Hi:()=>L,Il:()=>er,KB:()=>T,Kn:()=>j,LK:()=>C,MB:()=>el,Mu:()=>o,Ny:()=>b,Pw:()=>_,Rl:()=>n,TL:()=>es,Tx:()=>V,Uy:()=>k,WN:()=>et,YA:()=>Y,Zm:()=>D,_L:()=>A,_z:()=>$,aC:()=>f,bS:()=>X,cU:()=>E,dR:()=>G,dZ:()=>ei,db:()=>N,em:()=>Z,f2:()=>O,fU:()=>eo,fs:()=>y,gP:()=>x,hH:()=>J,jw:()=>R,lo:()=>ee,m9:()=>K,mI:()=>eu,nA:()=>u,pY:()=>c,q0:()=>ed,qF:()=>B,qm:()=>F,rk:()=>P,rt:()=>S,tB:()=>l,wA:()=>h,xY:()=>ea});var a=r(84607),s=r(32413),i=r(30174);function n(e,t){return new e({type:"string",...i.A2(t)})}function o(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...i.A2(t)})}function l(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...i.A2(t)})}function d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...i.A2(t)})}function u(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...i.A2(t)})}function c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...i.A2(t)})}function h(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...i.A2(t)})}function p(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...i.A2(t)})}function f(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...i.A2(t)})}function m(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...i.A2(t)})}function y(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...i.A2(t)})}function g(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...i.A2(t)})}function v(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...i.A2(t)})}function _(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...i.A2(t)})}function $(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...i.A2(t)})}function b(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...i.A2(t)})}function w(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...i.A2(t)})}function k(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...i.A2(t)})}function x(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...i.A2(t)})}function S(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...i.A2(t)})}function E(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...i.A2(t)})}function T(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...i.A2(t)})}function P(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...i.A2(t)})}function I(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...i.A2(t)})}function N(e,t){return new e({type:"string",format:"date",check:"string_format",...i.A2(t)})}function j(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...i.A2(t)})}function O(e,t){return new e({type:"string",format:"duration",check:"string_format",...i.A2(t)})}function z(e,t){return new e({type:"number",checks:[],...i.A2(t)})}function C(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...i.A2(t)})}function A(e,t){return new e({type:"boolean",...i.A2(t)})}function R(e,t){return new e({type:"null",...i.A2(t)})}function Z(e){return new e({type:"unknown"})}function M(e,t){return new e({type:"never",...i.A2(t)})}function q(e,t){return new a.sm({check:"less_than",...i.A2(t),value:e,inclusive:!1})}function D(e,t){return new a.sm({check:"less_than",...i.A2(t),value:e,inclusive:!0})}function V(e,t){return new a.J_({check:"greater_than",...i.A2(t),value:e,inclusive:!1})}function F(e,t){return new a.J_({check:"greater_than",...i.A2(t),value:e,inclusive:!0})}function L(e,t){return new a.Jk({check:"multiple_of",...i.A2(t),value:e})}function U(e,t){return new a.Yk({check:"max_length",...i.A2(t),maximum:e})}function K(e,t){return new a.Kk({check:"min_length",...i.A2(t),minimum:e})}function Y(e,t){return new a.RM({check:"length_equals",...i.A2(t),length:e})}function H(e,t){return new a.DG({check:"string_format",format:"regex",...i.A2(t),pattern:e})}function J(e){return new a.NI({check:"string_format",format:"lowercase",...i.A2(e)})}function B(e){return new a.kH({check:"string_format",format:"uppercase",...i.A2(e)})}function G(e,t){return new a.Tt({check:"string_format",format:"includes",...i.A2(t),includes:e})}function W(e,t){return new a.J({check:"string_format",format:"starts_with",...i.A2(t),prefix:e})}function Q(e,t){return new a.E6({check:"string_format",format:"ends_with",...i.A2(t),suffix:e})}function X(e){return new a.v$({check:"overwrite",tx:e})}function ee(e){return X(t=>t.normalize(e))}function et(){return X(e=>e.trim())}function er(){return X(e=>e.toLowerCase())}function ea(){return X(e=>e.toUpperCase())}function es(){return X(e=>i.Yv(e))}function ei(e,t,r){return new e({type:"array",element:t,...i.A2(r)})}function en(e,t,r){let a=i.A2(r);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function eo(e,t,r){return new e({type:"custom",check:"custom",fn:t,...i.A2(r)})}function el(e,t){var r,s;let n,o=(r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(i.sn(e,t.value,o._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=o),e.continue??(e.continue=!o._zod.def.abort),t.issues.push(i.sn(e)))},e(t.value,t)),s=t,(n=new a.QP({check:"custom",...i.A2(s)}))._zod.check=r,n);return o}function ed(e){let t=new a.QP({check:"describe"});return t._zod.onattach=[t=>{let r=s.fd.get(t)??{};s.fd.add(t,{...r,description:e})}],t._zod.check=()=>{},t}function eu(e){let t=new a.QP({check:"meta"});return t._zod.onattach=[t=>{let r=s.fd.get(t)??{};s.fd.add(t,{...r,...e})}],t._zod.check=()=>{},t}},84607(e,t,r){r.d(t,{DG:()=>y,E6:()=>b,J:()=>$,J_:()=>d,Jk:()=>u,KH:()=>c,Kk:()=>p,NI:()=>g,QP:()=>n,RM:()=>f,Tt:()=>_,Yk:()=>h,kH:()=>v,ql:()=>m,sm:()=>l,v$:()=>w});var a=r(76773),s=r(34175),i=r(30174);let n=a.xI("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),o={number:"number",bigint:"bigint",object:"date"},l=a.xI("$ZodCheckLessThan",(e,t)=>{n.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),d=a.xI("$ZodCheckGreaterThan",(e,t)=>{n.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),u=a.xI("$ZodCheckMultipleOf",(e,t)=>{n.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===i.LG(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),c=a.xI("$ZodCheckNumberFormat",(e,t)=>{n.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),a=r?"int":"number",[o,l]=i.zH[t.format];e._zod.onattach.push(e=>{let a=e._zod.bag;a.format=t.format,a.minimum=o,a.maximum=l,r&&(a.pattern=s.nd)}),e._zod.check=s=>{let i=s.value;if(r){if(!Number.isInteger(i))return void s.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:i,inst:e});if(!Number.isSafeInteger(i))return void(i>0?s.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):s.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}))}i<o&&s.issues.push({origin:"number",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),i>l&&s.issues.push({origin:"number",input:i,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),h=a.xI("$ZodCheckMaxLength",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;if(a.length<=t.maximum)return;let s=i.Rc(a);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),p=a.xI("$ZodCheckMinLength",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;if(a.length>=t.minimum)return;let s=i.Rc(a);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),f=a.xI("$ZodCheckLengthEquals",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let a=r.value,s=a.length;if(s===t.length)return;let n=i.Rc(a),o=s>t.length;r.issues.push({origin:n,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),m=a.xI("$ZodCheckStringFormat",(e,t)=>{var r,a;n.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),y=a.xI("$ZodCheckRegex",(e,t)=>{m.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),g=a.xI("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=s.AC),m.init(e,t)}),v=a.xI("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=s.Zv),m.init(e,t)}),_=a.xI("$ZodCheckIncludes",(e,t)=>{n.init(e,t);let r=i.$f(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=a,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),$=a.xI("$ZodCheckStartsWith",(e,t)=>{n.init(e,t);let r=RegExp(`^${i.$f(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),b=a.xI("$ZodCheckEndsWith",(e,t)=>{n.init(e,t);let r=RegExp(`.*${i.$f(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),w=a.xI("$ZodCheckOverwrite",(e,t)=>{n.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})},76773(e,t,r){var a;function s(e,t,r){function a(r,a){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:a,constr:n,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,a);let s=n.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=s[t].bind(r))}}let s=r?.Parent??Object;class i extends s{}function n(e){var t;let s=r?.Parent?new i:this;for(let r of(a(s,e),(t=s._zod).deferred??(t.deferred=[]),s._zod.deferred))r();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(n,"init",{value:a}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(n,"name",{value:e}),n}r.d(t,{$W:()=>l,GT:()=>i,cV:()=>n,cr:()=>o,xI:()=>s}),Symbol("zod_brand");class i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});let o=globalThis.__zod_globalConfig;function l(e){return e&&Object.assign(o,e),o}},717(e,t,r){r.d(t,{JM:()=>l,Kd:()=>o,Wk:()=>d,a$:()=>n});var a=r(76773),s=r(30174);let i=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,s.k8,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},n=(0,a.xI)("$ZodError",i),o=(0,a.xI)("$ZodError",i,{Parent:Error});function l(e,t=e=>e.message){let r={},a=[];for(let s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:r}}function d(e,t=e=>e.message){let r={_errors:[]},a=(e,s=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>a({issues:e},[...s,...i.path]));else if("invalid_key"===i.code)a({issues:i.issues},[...s,...i.path]);else if("invalid_element"===i.code)a({issues:i.issues},[...s,...i.path]);else{let e=[...s,...i.path];if(0===e.length)r._errors.push(t(i));else{let a=r,s=0;for(;s<e.length;){let r=e[s];s===e.length-1?(a[r]=a[r]||{_errors:[]},a[r]._errors.push(t(i))):a[r]=a[r]||{_errors:[]},a=a[r],s++}}}};return a(e),r}},76882(e,t,r){r.d(t,{$X:()=>T,$k:()=>P,A:()=>x,A6:()=>f,C0:()=>h,Ec:()=>g,GC:()=>$,In:()=>d,NV:()=>c,Q9:()=>S,RH:()=>u,SW:()=>n,Wg:()=>o,Yv:()=>p,bl:()=>N,cR:()=>w,cY:()=>y,dO:()=>l,fs:()=>E,iC:()=>v,i_:()=>_,mh:()=>k,xi:()=>m,yq:()=>b});var a=r(58560),s=r(30174);let i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},n=(e,t,r,a)=>{r.type="string";let{minimum:s,maximum:n,format:o,patterns:l,contentEncoding:d}=e._zod.bag;if("number"==typeof s&&(r.minLength=s),"number"==typeof n&&(r.maxLength=n),o&&(r.format=i[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),d&&(r.contentEncoding=d),l&&l.size>0){let e=[...l];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},o=(e,t,r,a)=>{let{minimum:s,maximum:i,format:n,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;"string"==typeof n&&n.includes("int")?r.type="integer":r.type="number";let u="number"==typeof d&&d>=(s??-1/0),c="number"==typeof l&&l<=(i??1/0),h="draft-04"===t.target||"openapi-3.0"===t.target;u?h?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d:"number"==typeof s&&(r.minimum=s),c?h?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof i&&(r.maximum=i),"number"==typeof o&&(r.multipleOf=o)},l=(e,t,r,a)=>{r.type="boolean"},d=(e,t,r,a)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},u=(e,t,r,a)=>{r.not={}},c=(e,t,r,a)=>{},h=(e,t,r,a)=>{let i=e._zod.def,n=(0,s.w5)(i.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n},p=(e,t,r,a)=>{let s=e._zod.def,i=[];for(let e of s.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(e));else i.push(e);if(0===i.length);else if(1===i.length){let e=i[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),i.every(e=>"boolean"==typeof e)&&(r.type="boolean"),i.every(e=>null===e)&&(r.type="null"),r.enum=i},f=(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},m=(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},y=(e,t,r,s)=>{let i=e._zod.def,{minimum:n,maximum:o}=e._zod.bag;"number"==typeof n&&(r.minItems=n),"number"==typeof o&&(r.maxItems=o),r.type="array",r.items=(0,a.eh)(i.element,t,{...s,path:[...s.path,"items"]})},g=(e,t,r,s)=>{let i=e._zod.def;r.type="object",r.properties={};let n=i.shape;for(let e in n)r.properties[e]=(0,a.eh)(n[e],t,{...s,path:[...s.path,"properties",e]});let o=new Set([...new Set(Object.keys(n))].filter(e=>{let r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));o.size>0&&(r.required=Array.from(o)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=(0,a.eh)(i.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},v=(e,t,r,s)=>{let i=e._zod.def,n=!1===i.inclusive,o=i.options.map((e,r)=>(0,a.eh)(e,t,{...s,path:[...s.path,n?"oneOf":"anyOf",r]}));n?r.oneOf=o:r.anyOf=o},_=(e,t,r,s)=>{let i=e._zod.def,n=(0,a.eh)(i.left,t,{...s,path:[...s.path,"allOf",0]}),o=(0,a.eh)(i.right,t,{...s,path:[...s.path,"allOf",1]}),l=e=>"allOf"in e&&1===Object.keys(e).length;r.allOf=[...l(n)?n.allOf:[n],...l(o)?o.allOf:[o]]},$=(e,t,r,s)=>{let i=e._zod.def;r.type="object";let n=i.keyType,o=n._zod.bag,l=o?.patterns;if("loose"===i.mode&&l&&l.size>0){let e=(0,a.eh)(i.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});for(let t of(r.patternProperties={},l))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=(0,a.eh)(i.keyType,t,{...s,path:[...s.path,"propertyNames"]})),r.additionalProperties=(0,a.eh)(i.valueType,t,{...s,path:[...s.path,"additionalProperties"]});let d=n._zod.values;if(d){let e=[...d].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}},b=(e,t,r,s)=>{let i=e._zod.def,n=(0,a.eh)(i.innerType,t,s),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[n,{type:"null"}]},w=(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType},k=(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},x=(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},S=(e,t,r,s)=>{let i,n=e._zod.def;(0,a.eh)(n.innerType,t,s),t.seen.get(e).ref=n.innerType;try{i=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},E=(e,t,r,s)=>{let i=e._zod.def,n=i.in._zod.traits.has("$ZodTransform"),o="input"===t.io?n?i.out:i.in:i.out;(0,a.eh)(o,t,s),t.seen.get(e).ref=o},T=(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType,r.readOnly=!0},P=(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType},I={string:n,number:o,boolean:l,bigint:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},symbol:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},null:d,undefined:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},void:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},never:u,any:(e,t,r,a)=>{},unknown:c,date:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},enum:h,literal:p,nan:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},template_literal:(e,t,r,a)=>{let s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");r.type="string",r.pattern=s.source},file:(e,t,r,a)=>{let s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:n,mime:o}=e._zod.bag;void 0!==i&&(s.minLength=i),void 0!==n&&(s.maxLength=n),o?1===o.length?(s.contentMediaType=o[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=o.map(e=>({contentMediaType:e}))):Object.assign(r,s)},success:(e,t,r,a)=>{r.type="boolean"},custom:f,function:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},transform:m,map:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},set:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},array:y,object:g,union:v,intersection:_,tuple:(e,t,r,s)=>{let i=e._zod.def;r.type="array";let n="draft-2020-12"===t.target?"prefixItems":"items",o="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",l=i.items.map((e,r)=>(0,a.eh)(e,t,{...s,path:[...s.path,n,r]})),d=i.rest?(0,a.eh)(i.rest,t,{...s,path:[...s.path,o,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(r.prefixItems=l,d&&(r.items=d)):"openapi-3.0"===t.target?(r.items={anyOf:l},d&&r.items.anyOf.push(d),r.minItems=l.length,d||(r.maxItems=l.length)):(r.items=l,d&&(r.additionalItems=d));let{minimum:u,maximum:c}=e._zod.bag;"number"==typeof u&&(r.minItems=u),"number"==typeof c&&(r.maxItems=c)},record:$,nullable:b,nonoptional:w,default:k,prefault:x,catch:S,pipe:E,readonly:T,promise:(e,t,r,s)=>{let i=e._zod.def;(0,a.eh)(i.innerType,t,s),t.seen.get(e).ref=i.innerType},optional:P,lazy:(e,t,r,s)=>{let i=e._zod.innerType;(0,a.eh)(i,t,s),t.seen.get(e).ref=i}};function N(e,t){if("_idmap"in e){let r=(0,a.az)({...t,processors:I}),s={};for(let t of e._idmap.entries()){let[e,s]=t;(0,a.eh)(s,r)}let i={};for(let n of(r.external={registry:e,uri:t?.uri,defs:s},e._idmap.entries())){let[e,t]=n;(0,a.Wb)(r,t),i[e]=(0,a.jE)(r,t)}return Object.keys(s).length>0&&(i.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:s}),{schemas:i}}let r=(0,a.az)({...t,processors:I});return(0,a.eh)(e,r),(0,a.Wb)(r,e),(0,a.jE)(r,e)}},879(e,t,r){r.d(t,{EJ:()=>d,GW:()=>y,Mv:()=>f,Od:()=>u,R3:()=>b,Rb:()=>l,Tj:()=>n,VS:()=>_,bp:()=>p,e2:()=>m,or:()=>g,qg:()=>o,rh:()=>v,v_:()=>$,wG:()=>h,xL:()=>c});var a=r(76773),s=r(717),i=r(30174);let n=e=>(t,r,s,n)=>{let o=s?{...s,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new a.GT;if(l.issues.length){let t=new(n?.Err??e)(l.issues.map(e=>i.iR(e,o,a.$W())));throw i.gx(t,n?.callee),t}return l.value},o=n(s.Kd),l=e=>async(t,r,s,n)=>{let o=s?{...s,async:!0}:{async:!0},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){let t=new(n?.Err??e)(l.issues.map(e=>i.iR(e,o,a.$W())));throw i.gx(t,n?.callee),t}return l.value},d=l(s.Kd),u=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new a.GT;return l.issues.length?{success:!1,error:new(e??s.a$)(l.issues.map(e=>i.iR(e,o,a.$W())))}:{success:!0,data:l.value}},c=u(s.Kd),h=e=>async(t,r,s)=>{let n=s?{...s,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>i.iR(e,n,a.$W())))}:{success:!0,data:o.value}},p=h(s.Kd),f=e=>(t,r,a)=>{let s=a?{...a,direction:"backward"}:{direction:"backward"};return n(e)(t,r,s)};s.Kd;let m=e=>(t,r,a)=>n(e)(t,r,a);s.Kd;let y=e=>async(t,r,a)=>{let s=a?{...a,direction:"backward"}:{direction:"backward"};return l(e)(t,r,s)};s.Kd;let g=e=>async(t,r,a)=>l(e)(t,r,a);s.Kd;let v=e=>(t,r,a)=>{let s=a?{...a,direction:"backward"}:{direction:"backward"};return u(e)(t,r,s)};s.Kd;let _=e=>(t,r,a)=>u(e)(t,r,a);s.Kd;let $=e=>async(t,r,a)=>{let s=a?{...a,direction:"backward"}:{direction:"backward"};return h(e)(t,r,s)};s.Kd;let b=e=>async(t,r,a)=>h(e)(t,r,a);s.Kd},34175(e,t,r){r.d(t,{AC:()=>O,Ak:()=>l,F:()=>$,Gl:()=>s,K3:()=>v,Os:()=>u,Rp:()=>h,Yj:()=>T,Z0:()=>i,Zg:()=>p,Zv:()=>z,ai:()=>I,ch:()=>j,fO:()=>o,gF:()=>a,hQ:()=>b,kB:()=>S,kM:()=>n,l7:()=>g,nd:()=>P,p0:()=>d,p6:()=>k,r0:()=>_,uR:()=>c,uX:()=>f,ug:()=>m,w$:()=>E,zM:()=>N,zr:()=>y});let a=/^[cC][0-9a-z]{6,}$/,s=/^[0-9a-z]+$/,i=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,n=/^[0-9a-vA-V]{20}$/,o=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,d=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u=/^([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})$/,c=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,h=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function p(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let f=/^(?:(?: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])$/,m=/^(([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}|:))$/,y=/^((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])$/,g=/^(([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])$/,v=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_=/^[A-Za-z0-9_-]*$/,$=/^https?$/,b=/^\+[1-9]\d{6,14}$/,w="(?:(?:\\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])))",k=RegExp(`^${w}$`);function x(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function S(e){return RegExp(`^${x(e)}$`)}function E(e){let t=x({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let a=`${t}(?:${r.join("|")})`;return RegExp(`^${w}T(?:${a})$`)}let T=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},P=/^-?\d+$/,I=/^-?\d+(?:\.\d+)?$/,N=/^(?:true|false)$/i,j=/^null$/i,O=/^[^A-Z]*$/,z=/^[^a-z]*$/},32413(e,t,r){var a;r.d(t,{fd:()=>s}),Symbol("ZodOutput"),Symbol("ZodInput");(a=globalThis).__zod_globalRegistry??(a.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let a={...r,...this._map.get(e)};return Object.keys(a).length?a:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let s=globalThis.__zod_globalRegistry},84964(e,t,r){r.d(t,{bl:()=>_,b0:()=>e$,Cn:()=>j,RL:()=>eo,Ko:()=>x,h8:()=>R,I:()=>M,$p:()=>U,rv:()=>ed,VF:()=>ec,Py:()=>v,x8:()=>D,L8:()=>J,qG:()=>m,VO:()=>er,vz:()=>Z,VY:()=>y,w:()=>B,cG:()=>g,KX:()=>eg,Dq:()=>z,LJ:()=>X,qc:()=>el,Sb:()=>ev,EY:()=>h,N$:()=>eh,$v:()=>c,$N:()=>T,P0:()=>Q,Oy:()=>A,Zy:()=>I,Um:()=>F,sF:()=>q,v1:()=>S,W4:()=>u,Zn:()=>f,t$:()=>ef,GY:()=>k,nu:()=>ea,g5:()=>b,Ax:()=>E,CI:()=>N,Zc:()=>p,h:()=>et,cu:()=>W,GP:()=>V,Lc:()=>P,Wc:()=>es,TF:()=>w,ig:()=>en,_m:()=>em,CQ:()=>C,Zu:()=>$});var a=r(84607),s=r(76773);class i{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}var n=r(879),o=r(34175),l=r(30174);let d={major:4,minor:4,patch:3},u=s.xI("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=d;let a=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&a.unshift(e),a))for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let a,i=l.QH(e);for(let n of t){if(n._zod.def.when){if(l.rL(e)||!n._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,o=n._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new s.GT;if(a||o instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(i||(i=l.QH(e,t)))});else{if(e.issues.length===t)continue;i||(i=l.QH(e,t))}}return a?a.then(()=>e):e},r=(r,i,n)=>{if(l.QH(r))return r.aborted=!0,r;let o=t(i,a,n);if(o instanceof Promise){if(!1===n.async)throw new s.GT;return o.then(t=>e._zod.parse(t,n))}return e._zod.parse(o,n)};e._zod.run=(i,n)=>{if(n.skipChecks)return e._zod.parse(i,n);if("backward"===n.direction){let t=e._zod.parse({value:i.value,issues:[]},{...n,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,n)):r(t,i,n)}let o=e._zod.parse(i,n);if(o instanceof Promise){if(!1===n.async)throw new s.GT;return o.then(e=>t(e,a,n))}return t(o,a,n)}}l.gJ(e,"~standard",()=>({validate:t=>{try{let r=(0,n.xL)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,n.bp)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),c=s.xI("$ZodString",(e,t)=>{u.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.Yj(e._zod.bag),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),h=s.xI("$ZodStringFormat",(e,t)=>{a.ql.init(e,t),c.init(e,t)}),p=s.xI("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=o.Os),h.init(e,t)}),f=s.xI("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uR(e))}else t.pattern??(t.pattern=o.uR());h.init(e,t)}),m=s.xI("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=o.Rp),h.init(e,t)}),y=s.xI("$ZodURL",(e,t)=>{h.init(e,t),e._zod.check=r=>{try{let a=r.value.trim();if(!t.normalize&&t.protocol?.source===o.F.source&&!/^https?:\/\//i.test(a))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=a;return}catch(a){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),g=s.xI("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o.Zg()),h.init(e,t)}),v=s.xI("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=o.Ak),h.init(e,t)}),_=s.xI("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=o.gF),h.init(e,t)}),$=s.xI("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=o.Gl),h.init(e,t)}),b=s.xI("$ZodULID",(e,t)=>{t.pattern??(t.pattern=o.Z0),h.init(e,t)}),w=s.xI("$ZodXID",(e,t)=>{t.pattern??(t.pattern=o.kM),h.init(e,t)}),k=s.xI("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=o.fO),h.init(e,t)}),x=s.xI("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=o.w$(t)),h.init(e,t)}),S=s.xI("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=o.p6),h.init(e,t)}),E=s.xI("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=o.kB(t)),h.init(e,t)}),T=s.xI("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o.p0),h.init(e,t)}),P=s.xI("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=o.uX),h.init(e,t),e._zod.bag.format="ipv4"}),I=s.xI("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=o.ug),h.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),N=s.xI("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=o.zr),h.init(e,t)}),j=s.xI("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=o.l7),h.init(e,t),e._zod.check=r=>{let a=r.value.split("/");try{if(2!==a.length)throw Error();let[e,t]=a;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function O(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let z=s.xI("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=o.K3),h.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{O(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),C=s.xI("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=o.r0),h.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!o.r0.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return O(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),A=s.xI("$ZodE164",(e,t)=>{t.pattern??(t.pattern=o.hQ),h.init(e,t)}),R=s.xI("$ZodJWT",(e,t)=>{h.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[a]=r;if(!a)return!1;let s=JSON.parse(atob(a));if("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Z=s.xI("$ZodNumber",(e,t)=>{u.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.ai,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let s=r.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return r;let i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),r}}),M=s.xI("$ZodNumberFormat",(e,t)=>{a.KH.init(e,t),Z.init(e,t)}),q=s.xI("$ZodBoolean",(e,t)=>{u.init(e,t),e._zod.pattern=o.zM,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let s=r.value;return"boolean"==typeof s||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),D=s.xI("$ZodNull",(e,t)=>{u.init(e,t),e._zod.pattern=o.ch,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}}),V=s.xI("$ZodUnknown",(e,t)=>{u.init(e,t),e._zod.parse=e=>e}),F=s.xI("$ZodNever",(e,t)=>{u.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function L(e,t,r){e.issues.length&&t.issues.push(...l.lQ(r,e.issues)),t.value[r]=e.value}let U=s.xI("$ZodArray",(e,t)=>{u.init(e,t),e._zod.parse=(r,a)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let i=[];for(let e=0;e<s.length;e++){let n=s[e],o=t.element._zod.run({value:n,issues:[]},a);o instanceof Promise?i.push(o.then(t=>L(t,r,e))):L(o,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function K(e,t,r,a,s,i){let n=r in a;if(e.issues.length){if(s&&i&&!n)return;t.issues.push(...l.lQ(r,e.issues))}if(!n&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?n&&(t.value[r]=void 0):t.value[r]=e.value}function Y(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=l.NM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function H(e,t,r,a,s,i){let n=[],o=s.keySet,l=s.catchall._zod,d=l.def.type,u="optional"===l.optin,c="optional"===l.optout;for(let s in t){if("__proto__"===s||o.has(s))continue;if("never"===d){n.push(s);continue}let i=l.run({value:t[s],issues:[]},a);i instanceof Promise?e.push(i.then(e=>K(e,r,s,t,u,c))):K(i,r,s,t,u,c)}return(n.length&&r.issues.push({code:"unrecognized_keys",keys:n,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let J=s.xI("$ZodObject",(e,t)=>{let r;u.init(e,t);let a=Object.getOwnPropertyDescriptor(t,"shape");if(!a?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let s=l.PO(()=>Y(t));l.gJ(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let a=e[t]._zod;if(a.values)for(let e of(r[t]??(r[t]=new Set),a.values))r[t].add(e)}return r});let i=l.Gv,n=t.catchall;e._zod.parse=(t,a)=>{r??(r=s.value);let o=t.value;if(!i(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};let l=[],d=r.shape;for(let e of r.keys){let r=d[e],s="optional"===r._zod.optin,i="optional"===r._zod.optout,n=r._zod.run({value:o[e],issues:[]},a);n instanceof Promise?l.push(n.then(r=>K(r,t,e,o,s,i))):K(n,t,e,o,s,i)}return n?H(l,o,t,a,s.value,e):l.length?Promise.all(l).then(()=>t):t}}),B=s.xI("$ZodObjectJIT",(e,t)=>{let r,a;J.init(e,t);let n=e._zod.parse,o=l.PO(()=>Y(t)),d=l.Gv,u=!s.cr.jitless,c=l.hI,h=u&&c.value,p=t.catchall;e._zod.parse=(s,c)=>{a??(a=o.value);let f=s.value;return d(f)?u&&h&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new i(["shape","payload","ctx"]),r=o.value,a=e=>{let t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let s=Object.create(null),n=0;for(let e of r.keys)s[e]=`key_${n++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=s[i],n=l.UQ(i),o=e[i],d=o?._zod?.optin==="optional",u=o?._zod?.optout==="optional";t.write(`const ${r} = ${a(i)};`),d&&u?t.write(`
|
|
18
|
+
if (${r}.issues.length) {
|
|
19
|
+
if (${n} in input) {
|
|
20
|
+
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
21
|
+
...iss,
|
|
22
|
+
path: iss.path ? [${n}, ...iss.path] : [${n}]
|
|
23
|
+
})));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (${r}.value === undefined) {
|
|
28
|
+
if (${n} in input) {
|
|
29
|
+
newResult[${n}] = undefined;
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
newResult[${n}] = ${r}.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
`):d?t.write(`
|
|
36
|
+
if (${r}.issues.length) {
|
|
37
|
+
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
38
|
+
...iss,
|
|
39
|
+
path: iss.path ? [${n}, ...iss.path] : [${n}]
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (${r}.value === undefined) {
|
|
44
|
+
if (${n} in input) {
|
|
45
|
+
newResult[${n}] = undefined;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
newResult[${n}] = ${r}.value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`):t.write(`
|
|
52
|
+
const ${r}_present = ${n} in input;
|
|
53
|
+
if (${r}.issues.length) {
|
|
54
|
+
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
55
|
+
...iss,
|
|
56
|
+
path: iss.path ? [${n}, ...iss.path] : [${n}]
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
if (!${r}_present && !${r}.issues.length) {
|
|
60
|
+
payload.issues.push({
|
|
61
|
+
code: "invalid_type",
|
|
62
|
+
expected: "nonoptional",
|
|
63
|
+
input: undefined,
|
|
64
|
+
path: [${n}]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${r}_present) {
|
|
69
|
+
if (${r}.value === undefined) {
|
|
70
|
+
newResult[${n}] = undefined;
|
|
71
|
+
} else {
|
|
72
|
+
newResult[${n}] = ${r}.value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`)}t.write("payload.value = newResult;"),t.write("return payload;");let d=t.compile();return(t,r)=>d(e,t,r)})(t.shape)),s=r(s,c),p)?H([],f,s,c,a,e):s:n(s,c):(s.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),s)}});function G(e,t,r,a){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!l.QH(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>l.iR(e,a,s.$W())))}),t)}let W=s.xI("$ZodUnion",(e,t)=>{u.init(e,t),l.gJ(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),l.gJ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),l.gJ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),l.gJ(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>l.p6(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(a,s)=>{if(r)return r(a,s);let i=!1,n=[];for(let e of t.options){let t=e._zod.run({value:a.value,issues:[]},s);if(t instanceof Promise)n.push(t),i=!0;else{if(0===t.issues.length)return t;n.push(t)}}return i?Promise.all(n).then(t=>G(t,a,e,s)):G(n,a,e,s)}}),Q=s.xI("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,W.init(e,t);let r=e._zod.parse;l.gJ(e._zod,"propValues",()=>{let e={};for(let r of t.options){let a=r._zod.propValues;if(!a||0===Object.keys(a).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(a))for(let a of(e[t]||(e[t]=new Set),r))e[t].add(a)}return e});let a=l.PO(()=>{let e=t.options,r=new Map;for(let a of e){let e=a._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,a)}}return r});e._zod.parse=(s,i)=>{let n=s.value;if(!l.Gv(n))return s.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),s;let o=a.value.get(n?.[t.discriminator]);return o?o._zod.run(s,i):t.unionFallback||"backward"===i.direction?r(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(a.value.keys()),input:n,path:[t.discriminator],inst:e}),s)}}),X=s.xI("$ZodIntersection",(e,t)=>{u.init(e,t),e._zod.parse=(e,r)=>{let a=e.value,s=t.left._zod.run({value:a,issues:[]},r),i=t.right._zod.run({value:a,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,r])=>ee(e,t,r)):ee(e,s,i)}});function ee(e,t,r){let a,s=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(a??(a=r),r.keys))s.has(e)||s.set(e,{}),s.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)s.has(e)||s.set(e,{}),s.get(e).r=!0;else e.issues.push(t);let i=[...s].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&a&&e.issues.push({...a,keys:i}),l.QH(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(l.Qd(t)&&l.Qd(r)){let a=Object.keys(r),s=Object.keys(t).filter(e=>-1!==a.indexOf(e)),i={...t,...r};for(let a of s){let s=e(t[a],r[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let a=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};a.push(i.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let et=s.xI("$ZodRecord",(e,t)=>{u.init(e,t),e._zod.parse=(r,a)=>{let i=r.value;if(!l.Qd(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let n=[],d=t.keyType._zod.values;if(d){let o;r.value={};let u=new Set;for(let o of d)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){u.add("number"==typeof o?o.toString():o);let d=t.keyType._zod.run({value:o,issues:[]},a);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(e=>l.iR(e,a,s.$W())),input:o,path:[o],inst:e});continue}let c=d.value,h=t.valueType._zod.run({value:i[o],issues:[]},a);h instanceof Promise?n.push(h.then(e=>{e.issues.length&&r.issues.push(...l.lQ(o,e.issues)),r.value[c]=e.value})):(h.issues.length&&r.issues.push(...l.lQ(o,h.issues)),r.value[c]=h.value)}for(let e in i)u.has(e)||(o=o??[]).push(e);o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:o})}else for(let d of(r.value={},Reflect.ownKeys(i))){if("__proto__"===d||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let u=t.keyType._zod.run({value:d,issues:[]},a);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof d&&o.ai.test(d)&&u.issues.length){let e=t.keyType._zod.run({value:Number(d),issues:[]},a);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(u=e)}if(u.issues.length){"loose"===t.mode?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(e=>l.iR(e,a,s.$W())),input:d,path:[d],inst:e});continue}let c=t.valueType._zod.run({value:i[d],issues:[]},a);c instanceof Promise?n.push(c.then(e=>{e.issues.length&&r.issues.push(...l.lQ(d,e.issues)),r.value[u.value]=e.value})):(c.issues.length&&r.issues.push(...l.lQ(d,c.issues)),r.value[u.value]=c.value)}return n.length?Promise.all(n).then(()=>r):r}}),er=s.xI("$ZodEnum",(e,t)=>{u.init(e,t);let r=l.w5(t.entries),a=new Set(r);e._zod.values=a,e._zod.pattern=RegExp(`^(${r.filter(e=>l.qQ.has(typeof e)).map(e=>"string"==typeof e?l.$f(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{let i=t.value;return a.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),ea=s.xI("$ZodLiteral",(e,t)=>{if(u.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?l.$f(e):e?l.$f(e.toString()):String(e)).join("|")})$`),e._zod.parse=(a,s)=>{let i=a.value;return r.has(i)||a.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),a}}),es=s.xI("$ZodTransform",(e,t)=>{u.init(e,t),e._zod.optin="optional",e._zod.parse=(r,a)=>{if("backward"===a.direction)throw new s.cV(e.constructor.name);let i=t.transform(r.value,r);if(a.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r.fallback=!0,r));if(i instanceof Promise)throw new s.GT;return r.value=i,r.fallback=!0,r}});function ei(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let en=s.xI("$ZodOptional",(e,t)=>{u.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let a=e.value,s=t.innerType._zod.run(e,r);return s instanceof Promise?s.then(e=>ei(e,a)):ei(s,a)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),eo=s.xI("$ZodExactOptional",(e,t)=>{en.init(e,t),l.gJ(e._zod,"values",()=>t.innerType._zod.values),l.gJ(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),el=s.xI("$ZodNullable",(e,t)=>{u.init(e,t),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)}|null)$`):void 0}),l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ed=s.xI("$ZodDefault",(e,t)=>{u.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e=>eu(e,t)):eu(a,t)}});function eu(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let ec=s.xI("$ZodPrefault",(e,t)=>{u.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),eh=s.xI("$ZodNonOptional",(e,t)=>{u.init(e,t),l.gJ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,a)=>{let s=t.innerType._zod.run(r,a);return s instanceof Promise?s.then(t=>ep(t,e)):ep(s,e)}});function ep(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let ef=s.xI("$ZodCatch",(e,t)=>{u.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(a=>(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>l.iR(e,r,s.$W()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>l.iR(e,r,s.$W()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),em=s.xI("$ZodPipe",(e,t)=>{u.init(e,t),l.gJ(e._zod,"values",()=>t.in._zod.values),l.gJ(e._zod,"optin",()=>t.in._zod.optin),l.gJ(e._zod,"optout",()=>t.out._zod.optout),l.gJ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let a=t.out._zod.run(e,r);return a instanceof Promise?a.then(e=>ey(e,t.in,r)):ey(a,t.in,r)}let a=t.in._zod.run(e,r);return a instanceof Promise?a.then(e=>ey(e,t.out,r)):ey(a,t.out,r)}});function ey(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}let eg=s.xI("$ZodPreprocess",(e,t)=>{em.init(e,t)}),ev=s.xI("$ZodReadonly",(e,t)=>{u.init(e,t),l.gJ(e._zod,"propValues",()=>t.innerType._zod.propValues),l.gJ(e._zod,"values",()=>t.innerType._zod.values),l.gJ(e._zod,"optin",()=>t.innerType?._zod?.optin),l.gJ(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e_):e_(a)}});function e_(e){return e.value=Object.freeze(e.value),e}let e$=s.xI("$ZodCustom",(e,t)=>{a.QP.init(e,t),u.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let a=r.value,s=t.fn(a);if(s instanceof Promise)return s.then(t=>eb(t,r,a,e));eb(s,r,a,e)}});function eb(e,t,r,a){if(!e){let e={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(l.sn(e))}}},58560(e,t,r){r.d(t,{OA:()=>l,Wb:()=>n,az:()=>s,eh:()=>i,jE:()=>o,uE:()=>d});var a=r(32413);function s(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??a.fd,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function i(e,t,r={path:[],schemaPath:[]}){var a;let s=e._zod.def,n=t.seen.get(e);if(n)return n.count++,r.schemaPath.includes(e)&&(n.cycle=r.path),n.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,o);let l=e._zod.toJSONSchema?.();if(l)o.schema=l;else{let a={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,a);else{let r=o.schema,i=t.processors[s.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,r,a)}let n=e._zod.parent;n&&(o.ref||(o.ref=n),i(n,t,a),t.seen.get(n).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),"input"===t.io&&function e(t,r){let a=r??{seen:new Set};if(a.seen.has(t))return!1;a.seen.add(t);let s=t._zod.def;if("transform"===s.type)return!0;if("array"===s.type)return e(s.element,a);if("set"===s.type)return e(s.valueType,a);if("lazy"===s.type)return e(s.getter(),a);if("promise"===s.type||"optional"===s.type||"nonoptional"===s.type||"nullable"===s.type||"readonly"===s.type||"default"===s.type||"prefault"===s.type)return e(s.innerType,a);if("intersection"===s.type)return e(s.left,a)||e(s.right,a);if("record"===s.type||"map"===s.type)return e(s.keyType,a)||e(s.valueType,a);if("pipe"===s.type)return!!t._zod.traits.has("$ZodCodec")||e(s.in,a)||e(s.out,a);if("object"===s.type){for(let t in s.shape)if(e(s.shape[t],a))return!0;return!1}if("union"===s.type){for(let t of s.options)if(e(t,a))return!0;return!1}if("tuple"===s.type){for(let t of s.items)if(e(t,a))return!0;if(s.rest&&e(s.rest,a))return!0}return!1}(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&"_prefault"in o.schema&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function n(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=a.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(r,t[0])}}let s=t=>{if(t[1].schema.$ref)return;let a=t[1],{ref:s,defId:i}=(t=>{let a="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(r)return{ref:s(r)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${a}/${i}`}}if(t[1]===r)return{ref:"#"};let s=`#/${a}/`,i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:s+i}})(t);a.def={...a.schema},i&&(a.defId=i);let n=a.schema;for(let e in n)delete n[e];n.$ref=s};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
77
|
+
|
|
78
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let a=r[1];if(t===r[0]){s(r);continue}if(e.external){let a=e.external.registry.get(r[0])?.id;if(t!==r[0]&&a){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id||a.cycle||a.count>1&&"ref"===e.reused){s(r);continue}}}function o(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=t=>{let r=e.seen.get(t);if(null===r.ref)return;let s=r.def??r.schema,i={...s},n=r.ref;if(r.ref=null,n){a(n);let r=e.seen.get(n),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(s.allOf=s.allOf??[],s.allOf.push(o)):Object.assign(s,o),Object.assign(s,i),t._zod.parent===n)for(let e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(o.$ref&&r.def)for(let e in s)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(s[e])===JSON.stringify(r.def[e])&&delete s[e]}let o=t._zod.parent;if(o&&o!==n){a(o);let t=e.seen.get(o);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(let e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())a(t[0]);let s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");s.$id=e.external.uri(r)}Object.assign(s,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&s.id===i&&delete s.id;let n=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,n[e.defId]=e.def)}e.external||Object.keys(n).length>0&&("draft-2020-12"===e.target?s.$defs=n:s.definitions=n);try{let r=JSON.parse(JSON.stringify(s));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:d(t,"input",e.processors),output:d(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let l=(e,t={})=>r=>{let a=s({...r,processors:t});return i(e,a),n(a,e),o(a,e)},d=(e,t,r={})=>a=>{let{libraryOptions:l,target:d}=a??{},u=s({...l??{},target:d,io:t,processors:r});return i(e,u),n(u,e),o(u,e)}},30174(e,t,r){r.d(t,{$f:()=>w,A2:()=>x,Gv:()=>g,LG:()=>d,NM:()=>S,OH:()=>O,PO:()=>n,QH:()=>C,Qd:()=>_,Rc:()=>q,UQ:()=>f,Up:()=>T,W0:()=>N,X$:()=>I,Yv:()=>m,cJ:()=>P,cl:()=>o,gJ:()=>c,gx:()=>y,h1:()=>j,hI:()=>v,iR:()=>M,k8:()=>i,lQ:()=>R,mw:()=>z,o8:()=>k,p6:()=>l,qQ:()=>b,rL:()=>A,sn:()=>D,w5:()=>s,yG:()=>$,zH:()=>E,zM:()=>p});var a=r(76773);function s(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function i(e,t){return"bigint"==typeof t?t.toString():t}function n(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function o(e){return null==e}function l(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function d(e,t){let r=e/t,a=Math.round(r),s=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-a)<s?0:r-a}let u=Symbol("evaluating");function c(e,t,r){let a;Object.defineProperty(e,t,{get(){if(a!==u)return void 0===a&&(a=u,a=r()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function h(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function p(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function f(e){return JSON.stringify(e)}function m(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let y="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function g(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let v=n(()=>{if(a.cr.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function _(e){if(!1===g(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==g(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function $(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let b=new Set(["string","number","symbol"]);function w(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function k(e,t,r){let a=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(a._zod.parent=e),a}function x(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function S(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let E={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function T(e,t){let r=e._zod.def,a=r.checks;if(a&&a.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=p(e._zod.def,{get shape(){let e={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&(e[a]=r.shape[a])}return h(this,"shape",e),e},checks:[]});return k(e,s)}function P(e,t){let r=e._zod.def,a=r.checks;if(a&&a.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=p(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete a[e]}return h(this,"shape",a),a},checks:[]});return k(e,s)}function I(e,t){if(!_(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let a=p(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return h(this,"shape",r),r}});return k(e,a)}function N(e,t){if(!_(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=p(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return h(this,"shape",r),r}});return k(e,r)}function j(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=p(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return h(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return k(e,r)}function O(e,t,r){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=p(t._zod.def,{get shape(){let a=t._zod.def.shape,s={...a};if(r)for(let t in r){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(let t in a)s[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return h(this,"shape",s),s},checks:[]});return k(t,s)}function z(e,t,r){let a=p(t._zod.def,{get shape(){let a=t._zod.def.shape,s={...a};if(r)for(let t in r){if(!(t in s))throw Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(let t in a)s[t]=new e({type:"nonoptional",innerType:a[t]});return h(this,"shape",s),s}});return k(t,a)}function C(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function A(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function R(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function Z(e){return"string"==typeof e?e:e?.message}function M(e,t,r){let a=e.message?e.message:Z(e.inst?._zod.def?.error?.(e))??Z(t?.error?.(e))??Z(r.customError?.(e))??Z(r.localeError?.(e))??"Invalid input",{inst:s,continue:i,input:n,...o}=e;return o.path??(o.path=[]),o.message=a,t?.reportInput&&(o.input=n),o}function q(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function D(...e){let[t,r,a]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:a}:{...t}}},84867(e,t,r){var a,s,i,n,o,l,d;let u;r.d(t,{k5:()=>eR,bz:()=>ej,g1:()=>eA,zM:()=>eN,ai:()=>eI,Ik:()=>ez,YO:()=>eO,Yj:()=>eP,KC:()=>eC}),(o=a||(a={})).assertEqual=e=>{},o.assertIs=function(e){},o.assertNever=function(e){throw Error()},o.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},o.getValidEnumValues=e=>{let t=o.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let a of t)r[a]=e[a];return o.objectValues(r)},o.objectValues=e=>o.objectKeys(e).map(function(t){return e[t]}),o.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},o.find=(e,t)=>{for(let r of e)if(t(r))return r},o.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,o.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},o.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(s||(s={})).mergeShapes=(e,t)=>({...e,...t});let c=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h=e=>{switch(typeof e){case"undefined":return c.undefined;case"string":return c.string;case"number":return Number.isNaN(e)?c.nan:c.number;case"boolean":return c.boolean;case"function":return c.function;case"bigint":return c.bigint;case"symbol":return c.symbol;case"object":if(Array.isArray(e))return c.array;if(null===e)return c.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return c.promise;if("u">typeof Map&&e instanceof Map)return c.map;if("u">typeof Set&&e instanceof Set)return c.set;if("u">typeof Date&&e instanceof Date)return c.date;return c.object;default:return c.unknown}},p=a.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"]);class f extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(let s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){let r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof f))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let a of this.issues)if(a.path.length>0){let r=a.path[0];t[r]=t[r]||[],t[r].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}f.create=e=>new f(e);let m=(e,t)=>{let r;switch(e.code){case p.invalid_type:r=e.received===c.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case p.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case p.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.assertNever(e)}return{message:r}};(l=i||(i={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},l.toString=e=>"string"==typeof e?e:e?.message;let y=e=>{let{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],n={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";for(let e of a.filter(e=>!!e).slice().reverse())o=e(n,{data:t,defaultError:o}).message;return{...s,path:i,message:o}};function g(e,t){let r=y({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m,void 0].filter(e=>!!e)});e.common.issues.push(r)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if("aborted"===a.status)return _;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,a=await e.value;r.push({key:t,value:a})}return v.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:t,value:s}=a;if("aborted"===t.status||"aborted"===s.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==s.value||a.alwaysSet)&&(r[t.value]=s.value)}return{status:e.value,value:r}}}let _=Object.freeze({status:"aborted"}),$=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),w=e=>"u">typeof Promise&&e instanceof Promise;class k{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}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}}let x=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new f(e.common.issues);return this._error=t,this._error}}};function S(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??a??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??r??s.defaultError}},description:s}}class E{get description(){return this._def.description}_getType(e){return h(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:h(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:h(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(w(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)},a=this._parseSync({data:e,path:r.path,parent:r});return x(r,a)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return"valid"===r.status?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h(e)},a=this._parse({data:e,path:r.path,parent:r});return x(r,await (w(a)?a:Promise.resolve(a)))}refine(e,t){return this._refinement((r,a)=>{let s=e(r),i=()=>a.addIssue({code:p.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new e_({schema:this,typeName:n.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:e=>this["~validate"](e)}}optional(){return e$.create(this,this._def)}nullable(){return eb.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return er.create(this)}promise(){return ev.create(this,this._def)}or(e){return es.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new e_({...S(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ew({...S(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:n.ZodDefault})}brand(){return new eS({typeName:n.ZodBranded,type:this,...S(this._def)})}catch(e){return new ek({...S(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:n.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eE.create(this,e)}readonly(){return eT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let T=/^c[^\s-]{8,}$/i,P=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/i,N=/^[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,j=/^[a-z0-9_-]{21}$/i,O=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,z=/^[-+]?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)?)??$/,C=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,A=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R=/^(?:(?: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])$/,Z=/^(([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]))$/,M=/^(([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])$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V="((\\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])))",F=RegExp(`^${V}$`);function L(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}class U extends E{_parse(e){var t,r,s,i;let n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==c.string){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.string,received:t.parsedType}),_}let o=new v;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(g(n=this._getOrReturnCtx(e,n),{code:p.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(g(n=this._getOrReturnCtx(e,n),{code:p.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,r=e.data.length<l.value;(t||r)&&(n=this._getOrReturnCtx(e,n),t?g(n,{code:p.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):r&&g(n,{code:p.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)C.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"email",code:p.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)u||(u=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),u.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"emoji",code:p.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)N.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"uuid",code:p.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)j.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"nanoid",code:p.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)T.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"cuid",code:p.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)P.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"cuid2",code:p.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)I.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"ulid",code:p.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{g(n=this._getOrReturnCtx(e,n),{validation:"url",code:p.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"regex",code:p.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${V}T${L(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?F.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${L(l)}$`).test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:p.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?z.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"duration",code:p.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,!(("v4"===(r=l.version)||!r)&&A.test(t)||("v6"===r||!r)&&Z.test(t))&&1&&(g(n=this._getOrReturnCtx(e,n),{validation:"ip",code:p.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!O.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));if("object"!=typeof s||null===s||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(g(n=this._getOrReturnCtx(e,n),{validation:"jwt",code:p.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(s=e.data,!(("v4"===(i=l.version)||!i)&&R.test(s)||("v6"===i||!i)&&M.test(s))&&1&&(g(n=this._getOrReturnCtx(e,n),{validation:"cidr",code:p.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?q.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"base64",code:p.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?D.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"base64url",code:p.invalid_string,message:l.message}),o.dirty()):a.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:p.invalid_string,...i.errToObj(r)})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...i.errToObj(e)})}url(e){return this._addCheck({kind:"url",...i.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...i.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...i.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...i.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...i.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...i.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...i.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...i.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...i.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...i.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...i.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...i.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...i.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...i.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...i.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...i.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...i.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...i.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...i.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...i.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...i.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...i.errToObj(t)})}nonempty(e){return this.min(1,i.errToObj(e))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}U.create=e=>new U({checks:[],typeName:n.ZodString,coerce:e?.coerce??!1,...S(e)});class K extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==c.number){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.number,received:t.parsedType}),_}let r=new v;for(let s of this._def.checks)"int"===s.kind?a.isInteger(e.data)||(g(t=this._getOrReturnCtx(e,t),{code:p.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"multipleOf"===s.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(e.data,s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(g(t=this._getOrReturnCtx(e,t),{code:p.not_finite,message:s.message}),r.dirty()):a.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(e,t,r,a){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.toString(a)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:i.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:i.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}K.create=e=>new K({checks:[],typeName:n.ZodNumber,coerce:e?.coerce||!1,...S(e)});class Y extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==c.bigint)return this._getInvalidInput(e);let r=new v;for(let s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(g(t=this._getOrReturnCtx(e,t),{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):a.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(e,t,r,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.toString(a)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Y.create=e=>new Y({checks:[],typeName:n.ZodBigInt,coerce:e?.coerce??!1,...S(e)});class H extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==c.boolean){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.boolean,received:t.parsedType}),_}return b(e.data)}}H.create=e=>new H({typeName:n.ZodBoolean,coerce:e?.coerce||!1,...S(e)});class J extends E{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==c.date){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.date,received:t.parsedType}),_}if(Number.isNaN(e.data.getTime()))return g(this._getOrReturnCtx(e),{code:p.invalid_date}),_;let r=new v;for(let s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(g(t=this._getOrReturnCtx(e,t),{code:p.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):a.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:i.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:i.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}J.create=e=>new J({checks:[],coerce:e?.coerce||!1,typeName:n.ZodDate,...S(e)});class B extends E{_parse(e){if(this._getType(e)!==c.symbol){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.symbol,received:t.parsedType}),_}return b(e.data)}}B.create=e=>new B({typeName:n.ZodSymbol,...S(e)});class G extends E{_parse(e){if(this._getType(e)!==c.undefined){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.undefined,received:t.parsedType}),_}return b(e.data)}}G.create=e=>new G({typeName:n.ZodUndefined,...S(e)});class W extends E{_parse(e){if(this._getType(e)!==c.null){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.null,received:t.parsedType}),_}return b(e.data)}}W.create=e=>new W({typeName:n.ZodNull,...S(e)});class Q extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}Q.create=e=>new Q({typeName:n.ZodAny,...S(e)});class X extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}X.create=e=>new X({typeName:n.ZodUnknown,...S(e)});class ee extends E{_parse(e){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.never,received:t.parsedType}),_}}ee.create=e=>new ee({typeName:n.ZodNever,...S(e)});class et extends E{_parse(e){if(this._getType(e)!==c.undefined){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.void,received:t.parsedType}),_}return b(e.data)}}et.create=e=>new et({typeName:n.ZodVoid,...S(e)});class er extends E{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==c.array)return g(t,{code:p.invalid_type,expected:c.array,received:t.parsedType}),_;if(null!==a.exactLength){let e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(g(t,{code:e?p.too_big:p.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(g(t,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(g(t,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new k(t,e,t.path,r)))).then(e=>v.mergeArray(r,e));let s=[...t.data].map((e,r)=>a.type._parseSync(new k(t,e,t.path,r)));return v.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new er({...this._def,minLength:{value:e,message:i.toString(t)}})}max(e,t){return new er({...this._def,maxLength:{value:e,message:i.toString(t)}})}length(e,t){return new er({...this._def,exactLength:{value:e,message:i.toString(t)}})}nonempty(e){return this.min(1,e)}}er.create=(e,t)=>new er({type:e,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...S(t)});class ea extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.object){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.object,received:t.parsedType}),_}let{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(let e in r.data)s.includes(e)||i.push(e);let n=[];for(let e of s){let t=a[e],s=r.data[e];n.push({key:{status:"valid",value:e},value:t._parse(new k(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ee){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)n.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(g(r,{code:p.unrecognized_keys,keys:i}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of i){let a=r.data[t];n.push({key:{status:"valid",value:t},value:e._parse(new k(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of n){let r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>v.mergeObjectSync(t,e)):v.mergeObjectSync(t,n)}get shape(){return this._def.shape()}strict(e){return i.errToObj,new ea({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let a=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:i.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new ea({...this._def,unknownKeys:"strip"})}passthrough(){return new ea({...this._def,unknownKeys:"passthrough"})}extend(e){return new ea({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ea({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:n.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ea({...this._def,catchall:e})}pick(e){let t={};for(let r of a.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new ea({...this._def,shape:()=>t})}omit(e){let t={};for(let r of a.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new ea({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof ea){let r={};for(let a in t.shape){let s=t.shape[a];r[a]=e$.create(e(s))}return new ea({...t._def,shape:()=>r})}if(t instanceof er)return new er({...t._def,type:e(t.element)});if(t instanceof e$)return e$.create(e(t.unwrap()));if(t instanceof eb)return eb.create(e(t.unwrap()));if(t instanceof el)return el.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of a.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new ea({...this._def,shape:()=>t})}required(e){let t={};for(let r of a.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof e$;)e=e._def.innerType;t[r]=e}return new ea({...this._def,shape:()=>t})}keyof(){return em(a.objectKeys(this.shape))}}ea.create=(e,t)=>new ea({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:n.ZodObject,...S(t)}),ea.strictCreate=(e,t)=>new ea({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:n.ZodObject,...S(t)}),ea.lazycreate=(e,t)=>new ea({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:n.ZodObject,...S(t)});class es extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new f(e.ctx.common.issues));return g(t,{code:p.invalid_union,unionErrors:r}),_});{let e,a=[];for(let s of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let s=a.map(e=>new f(e));return g(t,{code:p.invalid_union,unionErrors:s}),_}}get options(){return this._def.options}}es.create=(e,t)=>new es({options:e,typeName:n.ZodUnion,...S(t)});let ei=e=>{if(e instanceof ep)return ei(e.schema);if(e instanceof e_)return ei(e.innerType());if(e instanceof ef)return[e.value];if(e instanceof ey)return e.options;if(e instanceof eg)return a.objectValues(e.enum);else if(e instanceof ew)return ei(e._def.innerType);else if(e instanceof G)return[void 0];else if(e instanceof W)return[null];else if(e instanceof e$)return[void 0,...ei(e.unwrap())];else if(e instanceof eb)return[null,...ei(e.unwrap())];else if(e instanceof eS)return ei(e.unwrap());else if(e instanceof eT)return ei(e.unwrap());else if(e instanceof ek)return ei(e._def.innerType);else return[]};class en extends E{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.object)return g(t,{code:p.invalid_type,expected:c.object,received:t.parsedType}),_;let r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let r of t){let t=ei(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of t){if(a.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,r)}}return new en({typeName:n.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...S(r)})}}class eo extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=(e,s)=>{if("aborted"===e.status||"aborted"===s.status)return _;let i=function e(t,r){let s=h(t),i=h(r);if(t===r)return{valid:!0,data:t};if(s===c.object&&i===c.object){let s=a.objectKeys(r),i=a.objectKeys(t).filter(e=>-1!==s.indexOf(e)),n={...t,...r};for(let a of i){let s=e(t[a],r[a]);if(!s.valid)return{valid:!1};n[a]=s.data}return{valid:!0,data:n}}if(s===c.array&&i===c.array){if(t.length!==r.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}if(s===c.date&&i===c.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,s.value);return i.valid?(("dirty"===e.status||"dirty"===s.status)&&t.dirty(),{status:t.value,value:i.data}):(g(r,{code:p.invalid_intersection_types}),_)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eo.create=(e,t,r)=>new eo({left:e,right:t,typeName:n.ZodIntersection,...S(r)});class el extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.array)return g(r,{code:p.invalid_type,expected:c.array,received:r.parsedType}),_;if(r.data.length<this._def.items.length)return g(r,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&r.data.length>this._def.items.length&&(g(r,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((e,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new k(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>v.mergeArray(t,e)):v.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new el({...this._def,rest:e})}}el.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new el({items:e,typeName:n.ZodTuple,rest:null,...S(t)})};class ed extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.object)return g(r,{code:p.invalid_type,expected:c.object,received:r.parsedType}),_;let a=[],s=this._def.keyType,i=this._def.valueType;for(let e in r.data)a.push({key:s._parse(new k(r,e,r.path,e)),value:i._parse(new k(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?v.mergeObjectAsync(t,a):v.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return new ed(t instanceof E?{keyType:e,valueType:t,typeName:n.ZodRecord,...S(r)}:{keyType:U.create(),valueType:e,typeName:n.ZodRecord,...S(t)})}}class eu extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.map)return g(r,{code:p.invalid_type,expected:c.map,received:r.parsedType}),_;let a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new k(r,e,r.path,[i,"key"])),value:s._parse(new k(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of i){let a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return _;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of i){let a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return _;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}eu.create=(e,t,r)=>new eu({valueType:t,keyType:e,typeName:n.ZodMap,...S(r)});class ec extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.set)return g(r,{code:p.invalid_type,expected:c.set,received:r.parsedType}),_;let a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(g(r,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(g(r,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let s=this._def.valueType;function i(e){let r=new Set;for(let a of e){if("aborted"===a.status)return _;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}let n=[...r.data.values()].map((e,t)=>s._parse(new k(r,e,r.path,t)));return r.common.async?Promise.all(n).then(e=>i(e)):i(n)}min(e,t){return new ec({...this._def,minSize:{value:e,message:i.toString(t)}})}max(e,t){return new ec({...this._def,maxSize:{value:e,message:i.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ec.create=(e,t)=>new ec({valueType:e,minSize:null,maxSize:null,typeName:n.ZodSet,...S(t)});class eh extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.function)return g(t,{code:p.invalid_type,expected:c.function,received:t.parsedType}),_;function r(e,r){return y({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m,m].filter(e=>!!e),issueData:{code:p.invalid_arguments,argumentsError:r}})}function a(e,r){return y({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m,m].filter(e=>!!e),issueData:{code:p.invalid_return_type,returnTypeError:r}})}let s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof ev){let e=this;return b(async function(...t){let n=new f([]),o=await e._def.args.parseAsync(t,s).catch(e=>{throw n.addIssue(r(t,e)),n}),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,s).catch(e=>{throw n.addIssue(a(l,e)),n})})}{let e=this;return b(function(...t){let n=e._def.args.safeParse(t,s);if(!n.success)throw new f([r(t,n.error)]);let o=Reflect.apply(i,this,n.data),l=e._def.returns.safeParse(o,s);if(!l.success)throw new f([a(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eh({...this._def,args:el.create(e).rest(X.create())})}returns(e){return new eh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new eh({args:e||el.create([]).rest(X.create()),returns:t||X.create(),typeName:n.ZodFunction,...S(r)})}}class ep extends E{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ep.create=(e,t)=>new ep({getter:e,typeName:n.ZodLazy,...S(t)});class ef extends E{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function em(e,t){return new ey({values:e,typeName:n.ZodEnum,...S(t)})}ef.create=(e,t)=>new ef({value:e,typeName:n.ZodLiteral,...S(t)});class ey extends E{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return g(t,{expected:a.joinValues(r),received:t.parsedType,code:p.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return g(t,{received:t.data,code:p.invalid_enum_value,options:r}),_}return b(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ey.create(e,{...this._def,...t})}exclude(e,t=this._def){return ey.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ey.create=em;class eg extends E{_parse(e){let t=a.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.string&&r.parsedType!==c.number){let e=a.objectValues(t);return g(r,{expected:a.joinValues(e),received:r.parsedType,code:p.invalid_type}),_}if(this._cache||(this._cache=new Set(a.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=a.objectValues(t);return g(r,{received:r.data,code:p.invalid_enum_value,options:e}),_}return b(e.data)}get enum(){return this._def.values}}eg.create=(e,t)=>new eg({values:e,typeName:n.ZodNativeEnum,...S(t)});class ev extends E{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==c.promise&&!1===t.common.async?(g(t,{code:p.invalid_type,expected:c.promise,received:t.parsedType}),_):b((t.parsedType===c.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ev.create=(e,t)=>new ev({type:e,typeName:n.ZodPromise,...S(t)});class e_ extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{g(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){let e=s.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return _;let a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?_:"dirty"===a.status||"dirty"===t.value?$(a.value):a});{if("aborted"===t.value)return _;let a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?_:"dirty"===a.status||"dirty"===t.value?$(a.value):a}}if("refinement"===s.type){let e=e=>{let t=s.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?_:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}}if("transform"===s.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?_:Promise.resolve(s.transform(e.value,i)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return _;let a=s.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}a.assertNever(s)}}e_.create=(e,t,r)=>new e_({schema:e,typeName:n.ZodEffects,effect:t,...S(r)}),e_.createWithPreprocess=(e,t,r)=>new e_({schema:t,effect:{type:"preprocess",transform:e},typeName:n.ZodEffects,...S(r)});class e$ extends E{_parse(e){return this._getType(e)===c.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}e$.create=(e,t)=>new e$({innerType:e,typeName:n.ZodOptional,...S(t)});class eb extends E{_parse(e){return this._getType(e)===c.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eb.create=(e,t)=>new eb({innerType:e,typeName:n.ZodNullable,...S(t)});class ew extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===c.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ew.create=(e,t)=>new ew({innerType:e,typeName:n.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...S(t)});class ek extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return w(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new f(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new f(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ek.create=(e,t)=>new ek({innerType:e,typeName:n.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...S(t)});class ex extends E{_parse(e){if(this._getType(e)!==c.nan){let t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:c.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}ex.create=e=>new ex({typeName:n.ZodNaN,...S(e)}),Symbol("zod_brand");class eS extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eE extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),$(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eE({in:e,out:t,typeName:n.ZodPipeline})}}class eT extends E{_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return w(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}eT.create=(e,t)=>new eT({innerType:e,typeName:n.ZodReadonly,...S(t)}),ea.lazycreate,(d=n||(n={})).ZodString="ZodString",d.ZodNumber="ZodNumber",d.ZodNaN="ZodNaN",d.ZodBigInt="ZodBigInt",d.ZodBoolean="ZodBoolean",d.ZodDate="ZodDate",d.ZodSymbol="ZodSymbol",d.ZodUndefined="ZodUndefined",d.ZodNull="ZodNull",d.ZodAny="ZodAny",d.ZodUnknown="ZodUnknown",d.ZodNever="ZodNever",d.ZodVoid="ZodVoid",d.ZodArray="ZodArray",d.ZodObject="ZodObject",d.ZodUnion="ZodUnion",d.ZodDiscriminatedUnion="ZodDiscriminatedUnion",d.ZodIntersection="ZodIntersection",d.ZodTuple="ZodTuple",d.ZodRecord="ZodRecord",d.ZodMap="ZodMap",d.ZodSet="ZodSet",d.ZodFunction="ZodFunction",d.ZodLazy="ZodLazy",d.ZodLiteral="ZodLiteral",d.ZodEnum="ZodEnum",d.ZodEffects="ZodEffects",d.ZodNativeEnum="ZodNativeEnum",d.ZodOptional="ZodOptional",d.ZodNullable="ZodNullable",d.ZodDefault="ZodDefault",d.ZodCatch="ZodCatch",d.ZodPromise="ZodPromise",d.ZodBranded="ZodBranded",d.ZodPipeline="ZodPipeline",d.ZodReadonly="ZodReadonly";let eP=U.create,eI=K.create;ex.create,Y.create;let eN=H.create;J.create,B.create,G.create,W.create;let ej=Q.create;X.create,ee.create,et.create;let eO=er.create,ez=ea.create;ea.strictCreate;let eC=es.create;en.create,eo.create,el.create;let eA=ed.create;eu.create,ec.create,eh.create,ep.create,ef.create;let eR=ey.create;eg.create,ev.create,e_.create,e$.create,eb.create,e_.createWithPreprocess,eE.create},34557(e){e.exports=JSON.parse('{"$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":false}')},42479(e){e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')},93770(e){e.exports=JSON.parse('{"$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":false}')},33928(e){e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')}};
|