@sura_ai/mcp-server 0.1.46 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +64 -57
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,106 +1,108 @@
1
1
  #!/usr/bin/env node
2
- var hM=Object.create;var{getPrototypeOf:fM,defineProperty:cD,getOwnPropertyNames:yM}=Object;var uM=Object.prototype.hasOwnProperty;var LH=($,I,U)=>{U=$!=null?hM(fM($)):{};let b=I||!$||!$.__esModule?cD(U,"default",{value:$,enumerable:!0}):U;for(let w of yM($))if(!uM.call(b,w))cD(b,w,{get:()=>$[w],enumerable:!0});return b};var Z=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var v6=($,I)=>{for(var U in I)cD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var NU=Z((Yz)=>{Object.defineProperty(Yz,"__esModule",{value:!0});Yz.regexpCode=Yz.getEsmExportName=Yz.getProperty=Yz.safeStringify=Yz.stringify=Yz.strConcat=Yz.addCodeArg=Yz.str=Yz._=Yz.nil=Yz._Code=Yz.Name=Yz.IDENTIFIER=Yz._CodeOrName=void 0;class sw{}Yz._CodeOrName=sw;Yz.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class S1 extends sw{constructor($){super();if(!Yz.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Yz.Name=S1;class j6 extends sw{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof S1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Yz._Code=j6;Yz.nil=new j6("");function Gz($,...I){let U=[$[0]],b=0;while(b<I.length)R8(U,I[b]),U.push($[++b]);return new j6(U)}Yz._=Gz;var k8=new j6("+");function Nz($,...I){let U=[GU($[0])],b=0;while(b<I.length)U.push(k8),R8(U,I[b]),U.push(k8,GU($[++b]));return $k(U),new j6(U)}Yz.str=Nz;function R8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof S1)$.push(I);else $.push(wk(I))}Yz.addCodeArg=R8;function $k($){let I=1;while(I<$.length-1){if($[I]===k8){let U=Ik($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Ik($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof S1||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof S1))return`"${$}${I.slice(1)}`;return}function Uk($,I){return I.emptyStr()?$:$.emptyStr()?I:Nz`${$}${I}`}Yz.strConcat=Uk;function wk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:GU(Array.isArray($)?$.join(","):$)}function bk($){return new j6(GU($))}Yz.stringify=bk;function GU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Yz.safeStringify=GU;function Xk($){return typeof $=="string"&&Yz.IDENTIFIER.test($)?new j6(`.${$}`):Gz`[${$}]`}Yz.getProperty=Xk;function Dk($){if(typeof $=="string"&&Yz.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Yz.getEsmExportName=Dk;function Wk($){return new j6($.toString())}Yz.regexpCode=Wk});var C8=Z((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});Az.ValueScope=Az.ValueScopeName=Az.Scope=Az.varKinds=Az.UsedValueState=void 0;var e$=NU();class Jz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Ib;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Ib||(Az.UsedValueState=Ib={}));Az.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class _8{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof e$.Name?$:this.name($)}name($){return new e$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Az.Scope=_8;class Z8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Az.ValueScopeName=Z8;var vk=e$._`\n`;class Hz extends _8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?vk:e$.nil}}get(){return this._scope}name($){return new Z8($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let b=this.toName($),{prefix:w}=b,X=(U=I.key)!==null&&U!==void 0?U:I.ref,D=this._values[w];if(D){let G=D.get(X);if(G)return G}else D=this._values[w]=new Map;D.set(X,b);let W=this._scope[w]||(this._scope[w]=[]),Q=W.length;return W[Q]=I.ref,b.setValue(I,{property:w,itemIndex:Q}),b}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return e$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(b)=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},I,U)}_reduceValues($,I,U={},b){let w=e$.nil;for(let X in $){let D=$[X];if(!D)continue;let W=U[X]=U[X]||new Map;D.forEach((Q)=>{if(W.has(Q))return;W.set(Q,Ib.Started);let G=I(Q);if(G){let N=this.opts.es5?Az.varKinds.var:Az.varKinds.const;w=e$._`${w}${N} ${Q} = ${G};${this.opts._n}`}else if(G=b===null||b===void 0?void 0:b(Q))w=e$._`${w}${G}${this.opts._n}`;else throw new Jz(Q);W.set(Q,Ib.Completed)})}return w}}Az.ValueScope=Hz});var a=Z((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});s$.or=s$.and=s$.not=s$.CodeGen=s$.operators=s$.varKinds=s$.ValueScopeName=s$.ValueScope=s$.Scope=s$.Name=s$.regexpCode=s$.stringify=s$.getProperty=s$.nil=s$.strConcat=s$.str=s$._=void 0;var X$=NU(),E6=C8(),O4=NU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return O4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return O4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return O4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return O4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return O4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return O4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return O4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return O4.Name}});var Wb=C8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Wb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Wb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Wb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Wb.varKinds}});s$.operators={GT:new X$._Code(">"),GTE:new X$._Code(">="),LT:new X$._Code("<"),LTE:new X$._Code("<="),EQ:new X$._Code("==="),NEQ:new X$._Code("!=="),NOT:new X$._Code("!"),OR:new X$._Code("||"),AND:new X$._Code("&&"),ADD:new X$._Code("+")};class z4{optimizeNodes(){return this}optimizeNames($,I){return this}}class zz extends z4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?E6.varKinds.var:this.varKind,b=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${b};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=k1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class h8 extends z4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof X$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=k1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Db($,this.rhs)}}class Lz extends h8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class Kz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class vz extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class Vz extends z4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class qz extends z4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=k1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Qb extends z4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,b=U.length;while(b--){let w=U[b];if(w.optimizeNames($,I))continue;Mk($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>d4($,I.names),{})}}class L4 extends Qb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class Fz extends Qb{}class YU extends L4{}YU.kind="else";class e6 extends L4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new YU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(Pz($),I instanceof e6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=k1(this.condition,$,I),this}get names(){let $=super.names;if(Db($,this.condition),this.else)d4($,this.else.names);return $}}e6.kind="if";class P1 extends L4{}P1.kind="for";class Mz extends P1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=k1(this.iteration,$,I),this}get names(){return d4(super.names,this.iteration.names)}}class jz extends P1{constructor($,I,U,b){super();this.varKind=$,this.name=I,this.from=U,this.to=b}render($){let I=$.es5?E6.varKinds.var:this.varKind,{name:U,from:b,to:w}=this;return`for(${I} ${U}=${b}; ${U}<${w}; ${U}++)`+super.render($)}get names(){let $=Db(super.names,this.from);return Db($,this.to)}}class g8 extends P1{constructor($,I,U,b){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=b}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=k1(this.iterable,$,I),this}get names(){return d4(super.names,this.iterable.names)}}class Ub extends L4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Ub.kind="func";class wb extends Qb{render($){return"return "+super.render($)}}wb.kind="return";class Ez extends L4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,b;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(b=this.finally)===null||b===void 0||b.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)d4($,this.catch.names);if(this.finally)d4($,this.finally.names);return $}}class bb extends L4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}bb.kind="catch";class Xb extends L4{render($){return"finally"+super.render($)}}Xb.kind="finally";class Sz{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
- `:""},this._extScope=$,this._scope=new E6.Scope({parent:$}),this._nodes=[new Fz]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,b){let w=this._scope.toName(I);if(U!==void 0&&b)this._constants[w.str]=U;return this._leafNode(new zz($,w,U)),w}const($,I,U){return this._def(E6.varKinds.const,$,I,U)}let($,I,U){return this._def(E6.varKinds.let,$,I,U)}var($,I,U){return this._def(E6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new h8($,I,U))}add($,I){return this._leafNode(new Lz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new qz($));return this}object(...$){let I=["{"];for(let[U,b]of $){if(I.length>1)I.push(",");if(I.push(U),U!==b||this.opts.es5)I.push(":"),X$.addCodeArg(I,b)}return I.push("}"),new X$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new e6($))}else(){return this._elseNode(new YU)}endIf(){return this._endBlockNode(e6,YU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new Mz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new jz(w,X,I,U),()=>b(X))}forOf($,I,U,b=E6.varKinds.const){let w=this._scope.toName($);if(this.opts.es5){let X=I instanceof X$.Name?I:this.var("_arr",I);return this.forRange("_i",0,X$._`${X}.length`,(D)=>{this.var(w,X$._`${X}[${D}]`),U(w)})}return this._for(new g8("of",b,w,I),()=>U(w))}forIn($,I,U,b=this.opts.es5?E6.varKinds.var:E6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X$._`Object.keys(${I})`,U);let w=this._scope.toName($);return this._for(new g8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(P1)}label($){return this._leafNode(new Kz($))}break($){return this._leafNode(new vz($))}return($){let I=new wb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new Ez;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new bb(w),I(w)}if(U)this._currNode=b.finally=new Xb,this.code(U);return this._endBlockNode(bb,Xb)}throw($){return this._leafNode(new Vz($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X$.nil,U,b){if(this._blockNode(new Ub($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Ub)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof e6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}s$.CodeGen=Sz;function d4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Db($,I){return I instanceof X$._CodeOrName?d4($,I.names):$}function k1($,I,U){if($ instanceof X$.Name)return b($);if(!w($))return $;return new X$._Code($._items.reduce((X,D)=>{if(D instanceof X$.Name)D=b(D);if(D instanceof X$._Code)X.push(...D._items);else X.push(D);return X},[]));function b(X){let D=U[X.str];if(D===void 0||I[X.str]!==1)return X;return delete I[X.str],D}function w(X){return X instanceof X$._Code&&X._items.some((D)=>D instanceof X$.Name&&I[D.str]===1&&U[D.str]!==void 0)}}function Mk($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function Pz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${x8($)}`}s$.not=Pz;var jk=kz(s$.operators.AND);function Ek(...$){return $.reduce(jk)}s$.and=Ek;var Sk=kz(s$.operators.OR);function Pk(...$){return $.reduce(Sk)}s$.or=Pk;function kz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${x8(I)} ${$} ${x8(U)}`}function x8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.checkStrictMode=fz.getErrorPath=fz.Type=fz.useFunc=fz.setEvaluated=fz.evaluatedPropsToName=fz.mergeEvaluated=fz.eachItem=fz.unescapeJsonPointer=fz.escapeJsonPointer=fz.escapeFragment=fz.unescapeFragment=fz.schemaRefOrVal=fz.schemaHasRulesButRef=fz.schemaHasRules=fz.checkUnknownRules=fz.alwaysValidSchema=fz.toHash=void 0;var H$=a(),_k=NU();function Zk($){let I={};for(let U of $)I[U]=!0;return I}fz.toHash=Zk;function Ck($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return Zz($,I),!Cz(I,$.self.RULES.all)}fz.alwaysValidSchema=Ck;function Zz($,I=$.schema){let{opts:U,self:b}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let w=b.RULES.keywords;for(let X in I)if(!w[X])hz($,`unknown keyword: "${X}"`)}fz.checkUnknownRules=Zz;function Cz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}fz.schemaHasRules=Cz;function gk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}fz.schemaHasRulesButRef=gk;function xk({topSchemaRef:$,schemaPath:I},U,b,w){if(!w){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return H$._`${U}`}return H$._`${$}${I}${H$.getProperty(b)}`}fz.schemaRefOrVal=xk;function hk($){return gz(decodeURIComponent($))}fz.unescapeFragment=hk;function fk($){return encodeURIComponent(y8($))}fz.escapeFragment=fk;function y8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}fz.escapeJsonPointer=y8;function gz($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}fz.unescapeJsonPointer=gz;function yk($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}fz.eachItem=yk;function Tz({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:b}){return(w,X,D,W)=>{let Q=D===void 0?X:D instanceof H$.Name?(X instanceof H$.Name?$(w,X,D):I(w,X,D),D):X instanceof H$.Name?(I(w,D,X),X):U(X,D);return W===H$.Name&&!(Q instanceof H$.Name)?b(w,Q):Q}}fz.mergeEvaluated={props:Tz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>{$.if(H$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,H$._`${U} || {}`).code(H$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,H$._`${U} || {}`),u8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:xz}),items:Tz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,H$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>$.assign(U,I===!0?!0:H$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function xz($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)u8($,U,I);return U}fz.evaluatedPropsToName=xz;function u8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}fz.setEvaluated=u8;var _z={};function uk($,I){return $.scopeValue("func",{ref:I,code:_z[I.code]||(_z[I.code]=new _k._Code(I.code))})}fz.useFunc=uk;var f8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(f8||(fz.Type=f8={}));function lk($,I,U){if($ instanceof H$.Name){let b=I===f8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+y8($)}fz.getErrorPath=lk;function hz($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}fz.checkStrictMode=hz});var s6=Z((uz)=>{Object.defineProperty(uz,"__esModule",{value:!0});var y$=a(),XR={data:new y$.Name("data"),valCxt:new y$.Name("valCxt"),instancePath:new y$.Name("instancePath"),parentData:new y$.Name("parentData"),parentDataProperty:new y$.Name("parentDataProperty"),rootData:new y$.Name("rootData"),dynamicAnchors:new y$.Name("dynamicAnchors"),vErrors:new y$.Name("vErrors"),errors:new y$.Name("errors"),this:new y$.Name("this"),self:new y$.Name("self"),scope:new y$.Name("scope"),json:new y$.Name("json"),jsonPos:new y$.Name("jsonPos"),jsonLen:new y$.Name("jsonLen"),jsonPart:new y$.Name("jsonPart")};uz.default=XR});var BU=Z((rz)=>{Object.defineProperty(rz,"__esModule",{value:!0});rz.extendErrors=rz.resetErrorsCount=rz.reportExtraError=rz.reportError=rz.keyword$DataError=rz.keywordError=void 0;var D$=a(),Nb=W$(),n$=s6();rz.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};rz.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function WR($,I=rz.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=mz($,I,U);if(b!==null&&b!==void 0?b:D||W)lz(X,Q);else cz(w,D$._`[${Q}]`)}rz.reportError=WR;function QR($,I=rz.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=mz($,I,U);if(lz(w,W),!(X||D))cz(b,n$.default.vErrors)}rz.reportExtraError=QR;function GR($,I){$.assign(n$.default.errors,I),$.if(D$._`${n$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(D$._`${n$.default.vErrors}.length`,I),()=>$.assign(n$.default.vErrors,null)))}rz.resetErrorsCount=GR;function NR({gen:$,keyword:I,schemaValue:U,data:b,errsCount:w,it:X}){if(w===void 0)throw new Error("ajv implementation error");let D=$.name("err");$.forRange("i",w,n$.default.errors,(W)=>{if($.const(D,D$._`${n$.default.vErrors}[${W}]`),$.if(D$._`${D}.instancePath === undefined`,()=>$.assign(D$._`${D}.instancePath`,D$.strConcat(n$.default.instancePath,X.errorPath))),$.assign(D$._`${D}.schemaPath`,D$.str`${X.errSchemaPath}/${I}`),X.opts.verbose)$.assign(D$._`${D}.schema`,U),$.assign(D$._`${D}.data`,b)})}rz.extendErrors=NR;function lz($,I){let U=$.const("err",I);$.if(D$._`${n$.default.vErrors} === null`,()=>$.assign(n$.default.vErrors,D$._`[${U}]`),D$._`${n$.default.vErrors}.push(${U})`),$.code(D$._`${n$.default.errors}++`)}function cz($,I){let{gen:U,validateName:b,schemaEnv:w}=$;if(w.$async)U.throw(D$._`new ${$.ValidationError}(${I})`);else U.assign(D$._`${b}.errors`,I),U.return(!1)}var p4={keyword:new D$.Name("keyword"),schemaPath:new D$.Name("schemaPath"),params:new D$.Name("params"),propertyName:new D$.Name("propertyName"),message:new D$.Name("message"),schema:new D$.Name("schema"),parentSchema:new D$.Name("parentSchema")};function mz($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return YR($,I,U)}function YR($,I,U={}){let{gen:b,it:w}=$,X=[BR(w,U),JR($,U)];return HR($,I,X),b.object(...X)}function BR({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Nb.getErrorPath(I,Nb.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function JR({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Nb.getErrorPath(U,Nb.Type.Str)}`;return[p4.schemaPath,w]}function HR($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:N,schemaPath:B}=W;if(b.push([p4.keyword,w],[p4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([p4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([p4.schema,D],[p4.parentSchema,D$._`${N}${B}`],[n$.default.data,X]);if(G)b.push([p4.propertyName,G])}});var pz=Z((oz)=>{Object.defineProperty(oz,"__esModule",{value:!0});oz.boolOrEmptySchema=oz.topBoolOrEmptySchema=void 0;var KR=BU(),vR=a(),VR=s6(),qR={message:"boolean schema is false"};function FR($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)iz($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(VR.default.data);else I.assign(vR._`${b}.errors`,null),I.return(!0)}oz.topBoolOrEmptySchema=FR;function MR($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),iz($);else U.var(I,!0)}oz.boolOrEmptySchema=MR;function iz($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};KR.reportError(w,qR,void 0,I)}});var c8=Z((tz)=>{Object.defineProperty(tz,"__esModule",{value:!0});tz.getRules=tz.isJSONType=void 0;var ER=["string","number","integer","boolean","null","object","array"],SR=new Set(ER);function PR($){return typeof $=="string"&&SR.has($)}tz.isJSONType=PR;function kR(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}tz.getRules=kR});var m8=Z(($3)=>{Object.defineProperty($3,"__esModule",{value:!0});$3.shouldUseRule=$3.shouldUseGroup=$3.schemaHasRulesForType=void 0;function TR({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&ez($,b)}$3.schemaHasRulesForType=TR;function ez($,I){return I.rules.some((U)=>sz($,U))}$3.shouldUseGroup=ez;function sz($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}$3.shouldUseRule=sz});var JU=Z((X3)=>{Object.defineProperty(X3,"__esModule",{value:!0});X3.reportTypeError=X3.checkDataTypes=X3.checkDataType=X3.coerceAndCheckDataType=X3.getJSONTypes=X3.getSchemaTypes=X3.DataType=void 0;var CR=c8(),gR=m8(),xR=BU(),p=a(),U3=W$(),R1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(R1||(X3.DataType=R1={}));function hR($){let I=w3($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}X3.getSchemaTypes=hR;function w3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(CR.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}X3.getJSONTypes=w3;function fR($,I){let{gen:U,data:b,opts:w}=$,X=yR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&gR.schemaHasRulesForType($,I[0]));if(D){let W=n8(I,b,w.strictNumbers,R1.Wrong);U.if(W,()=>{if(X.length)uR($,I,X);else i8($)})}return D}X3.coerceAndCheckDataType=fR;var b3=new Set(["string","number","integer","boolean","null"]);function yR($,I){return I?$.filter((U)=>b3.has(U)||I==="array"&&U==="array"):[]}function uR($,I,U){let{gen:b,data:w,opts:X}=$,D=b.let("dataType",p._`typeof ${w}`),W=b.let("coerced",p._`undefined`);if(X.coerceTypes==="array")b.if(p._`${D} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>b.assign(w,p._`${w}[0]`).assign(D,p._`typeof ${w}`).if(n8(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(b3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),i8($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),lR($,W)});function Q(G){switch(G){case"string":b.elseIf(p._`${D} == "number" || ${D} == "boolean"`).assign(W,p._`"" + ${w}`).elseIf(p._`${w} === null`).assign(W,p._`""`);return;case"number":b.elseIf(p._`${D} == "boolean" || ${w} === null
2
+ var Ij=Object.create;var{getPrototypeOf:Uj,defineProperty:eD,getOwnPropertyNames:wj}=Object;var bj=Object.prototype.hasOwnProperty;var CH=($,I,U)=>{U=$!=null?Ij(Uj($)):{};let b=I||!$||!$.__esModule?eD(U,"default",{value:$,enumerable:!0}):U;for(let w of wj($))if(!bj.call(b,w))eD(b,w,{get:()=>$[w],enumerable:!0});return b};var Z=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var v6=($,I)=>{for(var U in I)eD($,U,{get:I[U],enumerable:!0,configurable:!0,set:(b)=>I[U]=()=>b})};var JU=Z((Sz)=>{Object.defineProperty(Sz,"__esModule",{value:!0});Sz.regexpCode=Sz.getEsmExportName=Sz.getProperty=Sz.safeStringify=Sz.stringify=Sz.strConcat=Sz.addCodeArg=Sz.str=Sz._=Sz.nil=Sz._Code=Sz.Name=Sz.IDENTIFIER=Sz._CodeOrName=void 0;class Xb{}Sz._CodeOrName=Xb;Sz.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class P1 extends Xb{constructor($){super();if(!Sz.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Sz.Name=P1;class j6 extends Xb{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof P1)I[U.str]=(I[U.str]||0)+1;return I},{})}}Sz._Code=j6;Sz.nil=new j6("");function jz($,...I){let U=[$[0]],b=0;while(b<I.length)u8(U,I[b]),U.push($[++b]);return new j6(U)}Sz._=jz;var y8=new j6("+");function Ez($,...I){let U=[NU($[0])],b=0;while(b<I.length)U.push(y8),u8(U,I[b]),U.push(y8,NU($[++b]));return Lk(U),new j6(U)}Sz.str=Ez;function u8($,I){if(I instanceof j6)$.push(...I._items);else if(I instanceof P1)$.push(I);else $.push(Vk(I))}Sz.addCodeArg=u8;function Lk($){let I=1;while(I<$.length-1){if($[I]===y8){let U=Kk($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Kk($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof P1||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof P1))return`"${$}${I.slice(1)}`;return}function vk($,I){return I.emptyStr()?$:$.emptyStr()?I:Ez`${$}${I}`}Sz.strConcat=vk;function Vk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:NU(Array.isArray($)?$.join(","):$)}function qk($){return new j6(NU($))}Sz.stringify=qk;function NU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Sz.safeStringify=NU;function Mk($){return typeof $=="string"&&Sz.IDENTIFIER.test($)?new j6(`.${$}`):jz`[${$}]`}Sz.getProperty=Mk;function Fk($){if(typeof $=="string"&&Sz.IDENTIFIER.test($))return new j6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Sz.getEsmExportName=Fk;function jk($){return new j6($.toString())}Sz.regexpCode=jk});var r8=Z((Tz)=>{Object.defineProperty(Tz,"__esModule",{value:!0});Tz.ValueScope=Tz.ValueScopeName=Tz.Scope=Tz.varKinds=Tz.UsedValueState=void 0;var e$=JU();class kz extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Wb;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Wb||(Tz.UsedValueState=Wb={}));Tz.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class c8{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof e$.Name?$:this.name($)}name($){return new e$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Tz.Scope=c8;class m8 extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}Tz.ValueScopeName=m8;var fk=e$._`\n`;class Rz extends c8{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?fk:e$.nil}}get(){return this._scope}name($){return new m8($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let b=this.toName($),{prefix:w}=b,X=(U=I.key)!==null&&U!==void 0?U:I.ref,D=this._values[w];if(D){let G=D.get(X);if(G)return G}else D=this._values[w]=new Map;D.set(X,b);let W=this._scope[w]||(this._scope[w]=[]),Q=W.length;return W[Q]=I.ref,b.setValue(I,{property:w,itemIndex:Q}),b}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return e$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(b)=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},I,U)}_reduceValues($,I,U={},b){let w=e$.nil;for(let X in $){let D=$[X];if(!D)continue;let W=U[X]=U[X]||new Map;D.forEach((Q)=>{if(W.has(Q))return;W.set(Q,Wb.Started);let G=I(Q);if(G){let Y=this.opts.es5?Tz.varKinds.var:Tz.varKinds.const;w=e$._`${w}${Y} ${Q} = ${G};${this.opts._n}`}else if(G=b===null||b===void 0?void 0:b(Q))w=e$._`${w}${G}${this.opts._n}`;else throw new kz(Q);W.set(Q,Wb.Completed)})}return w}}Tz.ValueScope=Rz});var a=Z((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});s$.or=s$.and=s$.not=s$.CodeGen=s$.operators=s$.varKinds=s$.ValueScopeName=s$.ValueScope=s$.Scope=s$.Name=s$.regexpCode=s$.stringify=s$.getProperty=s$.nil=s$.strConcat=s$.str=s$._=void 0;var X$=JU(),E6=r8(),z4=JU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return z4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return z4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return z4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return z4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return z4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return z4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return z4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return z4.Name}});var Bb=r8();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return Bb.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return Bb.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return Bb.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return Bb.varKinds}});s$.operators={GT:new X$._Code(">"),GTE:new X$._Code(">="),LT:new X$._Code("<"),LTE:new X$._Code("<="),EQ:new X$._Code("==="),NEQ:new X$._Code("!=="),NOT:new X$._Code("!"),OR:new X$._Code("||"),AND:new X$._Code("&&"),ADD:new X$._Code("+")};class L4{optimizeNodes(){return this}optimizeNames($,I){return this}}class Zz extends L4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?E6.varKinds.var:this.varKind,b=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${b};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=R1(this.rhs,$,I);return this}get names(){return this.rhs instanceof X$._CodeOrName?this.rhs.names:{}}}class o8 extends L4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof X$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=R1(this.rhs,$,I),this}get names(){let $=this.lhs instanceof X$.Name?{}:{...this.lhs.names};return Jb($,this.rhs)}}class Cz extends o8{constructor($,I,U,b){super($,U,b);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class gz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class xz extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class hz extends L4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class fz extends L4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=R1(this.code,$,I),this}get names(){return this.code instanceof X$._CodeOrName?this.code.names:{}}}class Hb extends L4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,b=U.length;while(b--){let w=U[b];if(w.optimizeNames($,I))continue;ck($,w.names),U.splice(b,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>p4($,I.names),{})}}class K4 extends Hb{render($){return"{"+$._n+super.render($)+"}"+$._n}}class yz extends Hb{}class BU extends K4{}BU.kind="else";class e6 extends K4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new BU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(rz($),I instanceof e6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=R1(this.condition,$,I),this}get names(){let $=super.names;if(Jb($,this.condition),this.else)p4($,this.else.names);return $}}e6.kind="if";class k1 extends K4{}k1.kind="for";class uz extends k1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=R1(this.iteration,$,I),this}get names(){return p4(super.names,this.iteration.names)}}class lz extends k1{constructor($,I,U,b){super();this.varKind=$,this.name=I,this.from=U,this.to=b}render($){let I=$.es5?E6.varKinds.var:this.varKind,{name:U,from:b,to:w}=this;return`for(${I} ${U}=${b}; ${U}<${w}; ${U}++)`+super.render($)}get names(){let $=Jb(super.names,this.from);return Jb($,this.to)}}class n8 extends k1{constructor($,I,U,b){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=b}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=R1(this.iterable,$,I),this}get names(){return p4(super.names,this.iterable.names)}}class Qb extends K4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}Qb.kind="func";class Gb extends Hb{render($){return"return "+super.render($)}}Gb.kind="return";class cz extends K4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,b;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(b=this.finally)===null||b===void 0||b.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)p4($,this.catch.names);if(this.finally)p4($,this.finally.names);return $}}class Yb extends K4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}Yb.kind="catch";class Nb extends K4{render($){return"finally"+super.render($)}}Nb.kind="finally";class mz{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
+ `:""},this._extScope=$,this._scope=new E6.Scope({parent:$}),this._nodes=[new yz]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,b){let w=this._scope.toName(I);if(U!==void 0&&b)this._constants[w.str]=U;return this._leafNode(new Zz($,w,U)),w}const($,I,U){return this._def(E6.varKinds.const,$,I,U)}let($,I,U){return this._def(E6.varKinds.let,$,I,U)}var($,I,U){return this._def(E6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new o8($,I,U))}add($,I){return this._leafNode(new Cz($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==X$.nil)this._leafNode(new fz($));return this}object(...$){let I=["{"];for(let[U,b]of $){if(I.length>1)I.push(",");if(I.push(U),U!==b||this.opts.es5)I.push(":"),X$.addCodeArg(I,b)}return I.push("}"),new X$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new e6($))}else(){return this._elseNode(new BU)}endIf(){return this._endBlockNode(e6,BU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new uz($),I)}forRange($,I,U,b,w=this.opts.es5?E6.varKinds.var:E6.varKinds.let){let X=this._scope.toName($);return this._for(new lz(w,X,I,U),()=>b(X))}forOf($,I,U,b=E6.varKinds.const){let w=this._scope.toName($);if(this.opts.es5){let X=I instanceof X$.Name?I:this.var("_arr",I);return this.forRange("_i",0,X$._`${X}.length`,(D)=>{this.var(w,X$._`${X}[${D}]`),U(w)})}return this._for(new n8("of",b,w,I),()=>U(w))}forIn($,I,U,b=this.opts.es5?E6.varKinds.var:E6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,X$._`Object.keys(${I})`,U);let w=this._scope.toName($);return this._for(new n8("in",b,w,I),()=>U(w))}endFor(){return this._endBlockNode(k1)}label($){return this._leafNode(new gz($))}break($){return this._leafNode(new xz($))}return($){let I=new Gb;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gb)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let b=new cz;if(this._blockNode(b),this.code($),I){let w=this.name("e");this._currNode=b.catch=new Yb(w),I(w)}if(U)this._currNode=b.finally=new Nb,this.code(U);return this._endBlockNode(Yb,Nb)}throw($){return this._leafNode(new hz($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=X$.nil,U,b){if(this._blockNode(new Qb($,I,U)),b)this.code(b).endFunc();return this}endFunc(){return this._endBlockNode(Qb)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof e6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}s$.CodeGen=mz;function p4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Jb($,I){return I instanceof X$._CodeOrName?p4($,I.names):$}function R1($,I,U){if($ instanceof X$.Name)return b($);if(!w($))return $;return new X$._Code($._items.reduce((X,D)=>{if(D instanceof X$.Name)D=b(D);if(D instanceof X$._Code)X.push(...D._items);else X.push(D);return X},[]));function b(X){let D=U[X.str];if(D===void 0||I[X.str]!==1)return X;return delete I[X.str],D}function w(X){return X instanceof X$._Code&&X._items.some((D)=>D instanceof X$.Name&&I[D.str]===1&&U[D.str]!==void 0)}}function ck($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function rz($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:X$._`!${i8($)}`}s$.not=rz;var mk=nz(s$.operators.AND);function rk(...$){return $.reduce(mk)}s$.and=rk;var nk=nz(s$.operators.OR);function ik(...$){return $.reduce(nk)}s$.or=ik;function nz($){return(I,U)=>I===X$.nil?U:U===X$.nil?I:X$._`${i8(I)} ${$} ${i8(U)}`}function i8($){return $ instanceof X$.Name?$:X$._`(${$})`}});var W$=Z(($3)=>{Object.defineProperty($3,"__esModule",{value:!0});$3.checkStrictMode=$3.getErrorPath=$3.Type=$3.useFunc=$3.setEvaluated=$3.evaluatedPropsToName=$3.mergeEvaluated=$3.eachItem=$3.unescapeJsonPointer=$3.escapeJsonPointer=$3.escapeFragment=$3.unescapeFragment=$3.schemaRefOrVal=$3.schemaHasRulesButRef=$3.schemaHasRules=$3.checkUnknownRules=$3.alwaysValidSchema=$3.toHash=void 0;var H$=a(),tk=JU();function ak($){let I={};for(let U of $)I[U]=!0;return I}$3.toHash=ak;function ek($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return pz($,I),!tz(I,$.self.RULES.all)}$3.alwaysValidSchema=ek;function pz($,I=$.schema){let{opts:U,self:b}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let w=b.RULES.keywords;for(let X in I)if(!w[X])sz($,`unknown keyword: "${X}"`)}$3.checkUnknownRules=pz;function tz($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}$3.schemaHasRules=tz;function sk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}$3.schemaHasRulesButRef=sk;function $2({topSchemaRef:$,schemaPath:I},U,b,w){if(!w){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return H$._`${U}`}return H$._`${$}${I}${H$.getProperty(b)}`}$3.schemaRefOrVal=$2;function I2($){return az(decodeURIComponent($))}$3.unescapeFragment=I2;function U2($){return encodeURIComponent(p8($))}$3.escapeFragment=U2;function p8($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}$3.escapeJsonPointer=p8;function az($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}$3.unescapeJsonPointer=az;function w2($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}$3.eachItem=w2;function oz({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:b}){return(w,X,D,W)=>{let Q=D===void 0?X:D instanceof H$.Name?(X instanceof H$.Name?$(w,X,D):I(w,X,D),D):X instanceof H$.Name?(I(w,D,X),X):U(X,D);return W===H$.Name&&!(Q instanceof H$.Name)?b(w,Q):Q}}$3.mergeEvaluated={props:oz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>{$.if(H$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,H$._`${U} || {}`).code(H$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,H$._`${U} || {}`),t8($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:ez}),items:oz({mergeNames:($,I,U)=>$.if(H$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,H$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(H$._`${U} !== true`,()=>$.assign(U,I===!0?!0:H$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function ez($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",H$._`{}`);if(I!==void 0)t8($,U,I);return U}$3.evaluatedPropsToName=ez;function t8($,I,U){Object.keys(U).forEach((b)=>$.assign(H$._`${I}${H$.getProperty(b)}`,!0))}$3.setEvaluated=t8;var dz={};function b2($,I){return $.scopeValue("func",{ref:I,code:dz[I.code]||(dz[I.code]=new tk._Code(I.code))})}$3.useFunc=b2;var d8;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(d8||($3.Type=d8={}));function X2($,I,U){if($ instanceof H$.Name){let b=I===d8.Num;return U?b?H$._`"[" + ${$} + "]"`:H$._`"['" + ${$} + "']"`:b?H$._`"/" + ${$}`:H$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?H$.getProperty($).toString():"/"+p8($)}$3.getErrorPath=X2;function sz($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}$3.checkStrictMode=sz});var s6=Z((U3)=>{Object.defineProperty(U3,"__esModule",{value:!0});var y$=a(),M2={data:new y$.Name("data"),valCxt:new y$.Name("valCxt"),instancePath:new y$.Name("instancePath"),parentData:new y$.Name("parentData"),parentDataProperty:new y$.Name("parentDataProperty"),rootData:new y$.Name("rootData"),dynamicAnchors:new y$.Name("dynamicAnchors"),vErrors:new y$.Name("vErrors"),errors:new y$.Name("errors"),this:new y$.Name("this"),self:new y$.Name("self"),scope:new y$.Name("scope"),json:new y$.Name("json"),jsonPos:new y$.Name("jsonPos"),jsonLen:new y$.Name("jsonLen"),jsonPart:new y$.Name("jsonPart")};U3.default=M2});var HU=Z((D3)=>{Object.defineProperty(D3,"__esModule",{value:!0});D3.extendErrors=D3.resetErrorsCount=D3.reportExtraError=D3.reportError=D3.keyword$DataError=D3.keywordError=void 0;var D$=a(),Ob=W$(),n$=s6();D3.keywordError={message:({keyword:$})=>D$.str`must pass "${$}" keyword validation`};D3.keyword$DataError={message:({keyword:$,schemaType:I})=>I?D$.str`"${$}" keyword must be ${I} ($data)`:D$.str`"${$}" keyword is invalid ($data)`};function j2($,I=D3.keywordError,U,b){let{it:w}=$,{gen:X,compositeRule:D,allErrors:W}=w,Q=X3($,I,U);if(b!==null&&b!==void 0?b:D||W)w3(X,Q);else b3(w,D$._`[${Q}]`)}D3.reportError=j2;function E2($,I=D3.keywordError,U){let{it:b}=$,{gen:w,compositeRule:X,allErrors:D}=b,W=X3($,I,U);if(w3(w,W),!(X||D))b3(b,n$.default.vErrors)}D3.reportExtraError=E2;function S2($,I){$.assign(n$.default.errors,I),$.if(D$._`${n$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(D$._`${n$.default.vErrors}.length`,I),()=>$.assign(n$.default.vErrors,null)))}D3.resetErrorsCount=S2;function P2({gen:$,keyword:I,schemaValue:U,data:b,errsCount:w,it:X}){if(w===void 0)throw new Error("ajv implementation error");let D=$.name("err");$.forRange("i",w,n$.default.errors,(W)=>{if($.const(D,D$._`${n$.default.vErrors}[${W}]`),$.if(D$._`${D}.instancePath === undefined`,()=>$.assign(D$._`${D}.instancePath`,D$.strConcat(n$.default.instancePath,X.errorPath))),$.assign(D$._`${D}.schemaPath`,D$.str`${X.errSchemaPath}/${I}`),X.opts.verbose)$.assign(D$._`${D}.schema`,U),$.assign(D$._`${D}.data`,b)})}D3.extendErrors=P2;function w3($,I){let U=$.const("err",I);$.if(D$._`${n$.default.vErrors} === null`,()=>$.assign(n$.default.vErrors,D$._`[${U}]`),D$._`${n$.default.vErrors}.push(${U})`),$.code(D$._`${n$.default.errors}++`)}function b3($,I){let{gen:U,validateName:b,schemaEnv:w}=$;if(w.$async)U.throw(D$._`new ${$.ValidationError}(${I})`);else U.assign(D$._`${b}.errors`,I),U.return(!1)}var t4={keyword:new D$.Name("keyword"),schemaPath:new D$.Name("schemaPath"),params:new D$.Name("params"),propertyName:new D$.Name("propertyName"),message:new D$.Name("message"),schema:new D$.Name("schema"),parentSchema:new D$.Name("parentSchema")};function X3($,I,U){let{createErrors:b}=$.it;if(b===!1)return D$._`{}`;return k2($,I,U)}function k2($,I,U={}){let{gen:b,it:w}=$,X=[R2(w,U),T2($,U)];return _2($,I,X),b.object(...X)}function R2({errorPath:$},{instancePath:I}){let U=I?D$.str`${$}${Ob.getErrorPath(I,Ob.Type.Str)}`:$;return[n$.default.instancePath,D$.strConcat(n$.default.instancePath,U)]}function T2({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:b}){let w=b?I:D$.str`${I}/${$}`;if(U)w=D$.str`${w}${Ob.getErrorPath(U,Ob.Type.Str)}`;return[t4.schemaPath,w]}function _2($,{params:I,message:U},b){let{keyword:w,data:X,schemaValue:D,it:W}=$,{opts:Q,propertyName:G,topSchemaRef:Y,schemaPath:J}=W;if(b.push([t4.keyword,w],[t4.params,typeof I=="function"?I($):I||D$._`{}`]),Q.messages)b.push([t4.message,typeof U=="function"?U($):U]);if(Q.verbose)b.push([t4.schema,D],[t4.parentSchema,D$._`${Y}${J}`],[n$.default.data,X]);if(G)b.push([t4.propertyName,G])}});var N3=Z((G3)=>{Object.defineProperty(G3,"__esModule",{value:!0});G3.boolOrEmptySchema=G3.topBoolOrEmptySchema=void 0;var h2=HU(),f2=a(),y2=s6(),u2={message:"boolean schema is false"};function l2($){let{gen:I,schema:U,validateName:b}=$;if(U===!1)Q3($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(y2.default.data);else I.assign(f2._`${b}.errors`,null),I.return(!0)}G3.topBoolOrEmptySchema=l2;function c2($,I){let{gen:U,schema:b}=$;if(b===!1)U.var(I,!1),Q3($);else U.var(I,!0)}G3.boolOrEmptySchema=c2;function Q3($,I){let{gen:U,data:b}=$,w={gen:U,keyword:"false schema",data:b,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};h2.reportError(w,u2,void 0,I)}});var e8=Z((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.getRules=J3.isJSONType=void 0;var r2=["string","number","integer","boolean","null","object","array"],n2=new Set(r2);function i2($){return typeof $=="string"&&n2.has($)}J3.isJSONType=i2;function o2(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}J3.getRules=o2});var s8=Z((O3)=>{Object.defineProperty(O3,"__esModule",{value:!0});O3.shouldUseRule=O3.shouldUseGroup=O3.schemaHasRulesForType=void 0;function p2({schema:$,self:I},U){let b=I.RULES.types[U];return b&&b!==!0&&H3($,b)}O3.schemaHasRulesForType=p2;function H3($,I){return I.rules.some((U)=>A3($,U))}O3.shouldUseGroup=H3;function A3($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((b)=>$[b]!==void 0))}O3.shouldUseRule=A3});var AU=Z((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});V3.reportTypeError=V3.checkDataTypes=V3.checkDataType=V3.coerceAndCheckDataType=V3.getJSONTypes=V3.getSchemaTypes=V3.DataType=void 0;var e2=e8(),s2=s8(),$R=HU(),p=a(),L3=W$(),T1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(T1||(V3.DataType=T1={}));function IR($){let I=K3($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}V3.getSchemaTypes=IR;function K3($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(e2.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}V3.getJSONTypes=K3;function UR($,I){let{gen:U,data:b,opts:w}=$,X=wR(I,w.coerceTypes),D=I.length>0&&!(X.length===0&&I.length===1&&s2.schemaHasRulesForType($,I[0]));if(D){let W=IQ(I,b,w.strictNumbers,T1.Wrong);U.if(W,()=>{if(X.length)bR($,I,X);else UQ($)})}return D}V3.coerceAndCheckDataType=UR;var v3=new Set(["string","number","integer","boolean","null"]);function wR($,I){return I?$.filter((U)=>v3.has(U)||I==="array"&&U==="array"):[]}function bR($,I,U){let{gen:b,data:w,opts:X}=$,D=b.let("dataType",p._`typeof ${w}`),W=b.let("coerced",p._`undefined`);if(X.coerceTypes==="array")b.if(p._`${D} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>b.assign(w,p._`${w}[0]`).assign(D,p._`typeof ${w}`).if(IQ(I,w,X.strictNumbers),()=>b.assign(W,w)));b.if(p._`${W} !== undefined`);for(let G of U)if(v3.has(G)||G==="array"&&X.coerceTypes==="array")Q(G);b.else(),UQ($),b.endIf(),b.if(p._`${W} !== undefined`,()=>{b.assign(w,W),XR($,W)});function Q(G){switch(G){case"string":b.elseIf(p._`${D} == "number" || ${D} == "boolean"`).assign(W,p._`"" + ${w}`).elseIf(p._`${w} === null`).assign(W,p._`""`);return;case"number":b.elseIf(p._`${D} == "boolean" || ${w} === null
4
4
  || (${D} == "string" && ${w} && ${w} == +${w})`).assign(W,p._`+${w}`);return;case"integer":b.elseIf(p._`${D} === "boolean" || ${w} === null
5
5
  || (${D} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(W,p._`+${w}`);return;case"boolean":b.elseIf(p._`${w} === "false" || ${w} === 0 || ${w} === null`).assign(W,!1).elseIf(p._`${w} === "true" || ${w} === 1`).assign(W,!0);return;case"null":b.elseIf(p._`${w} === "" || ${w} === 0 || ${w} === false`),b.assign(W,null);return;case"array":b.elseIf(p._`${D} === "string" || ${D} === "number"
6
- || ${D} === "boolean" || ${w} === null`).assign(W,p._`[${w}]`)}}}function lR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function r8($,I,U,b=R1.Correct){let w=b===R1.Correct?p.operators.EQ:p.operators.NEQ,X;switch($){case"null":return p._`${I} ${w} null`;case"array":X=p._`Array.isArray(${I})`;break;case"object":X=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":X=D(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":X=D();break;default:return p._`typeof ${I} ${w} ${$}`}return b===R1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}X3.checkDataType=r8;function n8($,I,U,b){if($.length===1)return r8($[0],I,U,b);let w,X=U3.toHash($);if(X.array&&X.object){let D=p._`typeof ${I} != "object"`;w=X.null?D:p._`!${I} || ${D}`,delete X.null,delete X.array,delete X.object}else w=p.nil;if(X.number)delete X.integer;for(let D in X)w=p.and(w,r8(D,I,U,b));return w}X3.checkDataTypes=n8;var cR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function i8($){let I=mR($);xR.reportError(I,cR)}X3.reportTypeError=i8;function mR($){let{gen:I,data:U,schema:b}=$,w=U3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var N3=Z((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});Q3.assignDefaults=void 0;var T1=a(),tR=W$();function aR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)W3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>W3($,X,w.default))}Q3.assignDefaults=aR;function W3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=T1._`${X}${T1.getProperty(I)}`;if(w){tR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=T1._`${W} === undefined`;if(D.useDefaults==="empty")Q=T1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,T1._`${W} = ${T1.stringify(U)}`)}});var O6=Z((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.validateUnion=J3.validateArray=J3.usePattern=J3.callValidateCode=J3.schemaProperties=J3.allSchemaProperties=J3.noPropertyInData=J3.propertyInData=J3.isOwnProperty=J3.hasPropFunc=J3.reportMissingProp=J3.checkMissingProp=J3.checkReportMissingProp=void 0;var K$=a(),o8=W$(),K4=s6(),eR=W$();function sR($,I){let{gen:U,data:b,it:w}=$;U.if(p8(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}J3.checkReportMissingProp=sR;function $2({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(p8($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}J3.checkMissingProp=$2;function I2($,I){$.setParams({missingProperty:I},!0),$.error()}J3.reportMissingProp=I2;function Y3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}J3.hasPropFunc=Y3;function d8($,I,U){return K$._`${Y3($)}.call(${I}, ${U})`}J3.isOwnProperty=d8;function U2($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${d8($,I,U)}`:w}J3.propertyInData=U2;function p8($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(d8($,I,U))):w}J3.noPropertyInData=p8;function B3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}J3.allSchemaProperties=B3;function w2($,I){return B3(I).filter((U)=>!o8.alwaysValidSchema($,I[U]))}J3.schemaProperties=w2;function b2({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let N=G?K$._`${$}, ${I}, ${b}${w}`:I,B=[[K4.default.instancePath,K$.strConcat(K4.default.instancePath,X)],[K4.default.parentData,D.parentData],[K4.default.parentDataProperty,D.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(D.opts.dynamicRef)B.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let H=K$._`${N}, ${U.object(...B)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}J3.callValidateCode=b2;var X2=K$._`new RegExp`;function D2({gen:$,it:{opts:I}},U){let b=I.unicodeRegExp?"u":"",{regExp:w}=I.code,X=w(U,b);return $.scopeValue("pattern",{key:X.toString(),ref:X,code:K$._`${w.code==="new RegExp"?X2:eR.useFunc($,w)}(${U}, ${b})`})}J3.usePattern=D2;function W2($){let{gen:I,data:U,keyword:b,it:w}=$,X=I.name("valid");if(w.allErrors){let W=I.let("valid",!0);return D(()=>I.assign(W,!1)),W}return I.var(X,!0),D(()=>I.break()),X;function D(W){let Q=I.const("len",K$._`${U}.length`);I.forRange("i",0,Q,(G)=>{$.subschema({keyword:b,dataProp:G,dataPropType:o8.Type.Num},X),I.if(K$.not(X),W)})}}J3.validateArray=W2;function Q2($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>o8.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let N=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(N,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}J3.validateUnion=Q2});var K3=Z((z3)=>{Object.defineProperty(z3,"__esModule",{value:!0});z3.validateKeywordUsage=z3.validSchemaType=z3.funcKeywordCode=z3.macroKeywordCode=void 0;var i$=a(),t4=s6(),V2=O6(),q2=BU();function F2($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=O3(U,b,W);if(D.opts.validateSchema!==!1)D.self.validateSchema(W,!0);let G=U.name("valid");$.subschema({schema:W,schemaPath:i$.nil,errSchemaPath:`${D.errSchemaPath}/${b}`,topSchemaRef:Q,compositeRule:!0},G),$.pass(G,()=>$.error(!0))}z3.macroKeywordCode=F2;function M2($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;E2(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,N=O3(b,w,G),B=b.let("valid");$.block$data(B,H),$.ok((U=I.valid)!==null&&U!==void 0?U:B);function H(){if(I.errors===!1){if(O(),I.modifying)A3($);V(()=>$.error())}else{let q=I.async?J():A();if(I.modifying)A3($);V(()=>j2($,q))}}function J(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(B,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${N}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?t4.default.this:t4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(B,i$._`${q}${V2.callValidateCode($,N,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:B),q)}}z3.funcKeywordCode=M2;function A3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function j2($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(t4.default.vErrors,i$._`${t4.default.vErrors} === null ? ${I} : ${t4.default.vErrors}.concat(${I})`).assign(t4.default.errors,i$._`${t4.default.vErrors}.length`),q2.extendErrors($)},()=>$.error())}function E2({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function O3($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:i$.stringify(U)})}function S2($,I,U=!1){return!I.length||I.some((b)=>b==="array"?Array.isArray($):b==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==b||U&&typeof $=="undefined")}z3.validSchemaType=S2;function P2({schema:$,opts:I,self:U,errSchemaPath:b},w,X){if(Array.isArray(w.keyword)?!w.keyword.includes(X):w.keyword!==X)throw new Error("ajv implementation error");let D=w.dependencies;if(D===null||D===void 0?void 0:D.some((W)=>!Object.prototype.hasOwnProperty.call($,W)))throw new Error(`parent schema must have dependencies of ${X}: ${D.join(",")}`);if(w.validateSchema){if(!w.validateSchema($[X])){let Q=`keyword "${X}" value is invalid at path "${b}": `+U.errorsText(w.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(Q);else throw new Error(Q)}}}z3.validateKeywordUsage=P2});var F3=Z((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});V3.extendSubschemaMode=V3.extendSubschemaData=V3.getSubschema=void 0;var h6=a(),v3=W$();function _2($,{keyword:I,schemaProp:U,schema:b,schemaPath:w,errSchemaPath:X,topSchemaRef:D}){if(I!==void 0&&b!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let W=$.schema[I];return U===void 0?{schema:W,schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:W[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${v3.escapeFragment(U)}`}}if(b!==void 0){if(w===void 0||X===void 0||D===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:b,schemaPath:w,topSchemaRef:D,errSchemaPath:X}}throw new Error('either "keyword" or "schema" must be passed')}V3.getSubschema=_2;function Z2($,I,{dataProp:U,dataPropType:b,data:w,dataTypes:X,propertyName:D}){if(w!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=I;if(U!==void 0){let{errorPath:G,dataPathArr:N,opts:B}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${v3.getErrorPath(U,b,B.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...N,$.parentDataProperty]}if(w!==void 0){let G=w instanceof h6.Name?w:W.let("data",w,!0);if(Q(G),D!==void 0)$.propertyName=D}if(X)$.dataTypes=X;function Q(G){$.data=G,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,G]}}V3.extendSubschemaData=Z2;function C2($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:b,createErrors:w,allErrors:X}){if(b!==void 0)$.compositeRule=b;if(w!==void 0)$.createErrors=w;if(X!==void 0)$.allErrors=X;$.jtdDiscriminator=I,$.jtdMetadata=U}V3.extendSubschemaMode=C2});var t8=Z((Ci,M3)=>{M3.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var b,w,X;if(Array.isArray(I)){if(b=I.length,b!=U.length)return!1;for(w=b;w--!==0;)if(!$(I[w],U[w]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(X=Object.keys(I),b=X.length,b!==Object.keys(U).length)return!1;for(w=b;w--!==0;)if(!Object.prototype.hasOwnProperty.call(U,X[w]))return!1;for(w=b;w--!==0;){var D=X[w];if(!$(I[D],U[D]))return!1}return!0}return I!==I&&U!==U}});var E3=Z((gi,j3)=>{var v4=j3.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var b=typeof U=="function"?U:U.pre||function(){},w=U.post||function(){};Yb(I,b,w,$,"",$)};v4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};v4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};v4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};v4.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Yb($,I,U,b,w,X,D,W,Q,G){if(b&&typeof b=="object"&&!Array.isArray(b)){I(b,w,X,D,W,Q,G);for(var N in b){var B=b[N];if(Array.isArray(B)){if(N in v4.arrayKeywords)for(var H=0;H<B.length;H++)Yb($,I,U,B[H],w+"/"+N+"/"+H,X,w,N,b,H)}else if(N in v4.propsKeywords){if(B&&typeof B=="object")for(var J in B)Yb($,I,U,B[J],w+"/"+N+"/"+h2(J),X,w,N,b,J)}else if(N in v4.keywords||$.allKeys&&!(N in v4.skipKeywords))Yb($,I,U,B,w+"/"+N,X,w,N,b)}U(b,w,X,D,W,Q,G)}}function h2($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var HU=Z((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});R3.getSchemaRefs=R3.resolveUrl=R3.normalizeId=R3._getFullPath=R3.getFullPath=R3.inlineRef=void 0;var f2=W$(),y2=t8(),u2=E3(),l2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function c2($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!a8($);if(!I)return!1;return S3($)<=I}R3.inlineRef=c2;var m2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a8($){for(let I in $){if(m2.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(a8))return!0;if(typeof U=="object"&&a8(U))return!0}return!1}function S3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,l2.has(U))continue;if(typeof $[U]=="object")f2.eachItem($[U],(b)=>I+=S3(b));if(I===1/0)return 1/0}return I}function P3($,I="",U){if(U!==!1)I=_1(I);let b=$.parse(I);return k3($,b)}R3.getFullPath=P3;function k3($,I){return $.serialize(I).split("#")[0]+"#"}R3._getFullPath=k3;var r2=/#\/?$/;function _1($){return $?$.replace(r2,""):""}R3.normalizeId=_1;function n2($,I,U){return U=_1(U),$.resolve(I,U)}R3.resolveUrl=n2;var i2=/^[a-z_][-a-z0-9._]*$/i;function o2($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=_1($[U]||I),X={"":w},D=P3(b,w,!1),W={},Q=new Set;return u2($,{allKeys:!0},(B,H,J,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof B[U]=="string")V=q.call(this,B[U]);k.call(this,B.$anchor),k.call(this,B.$dynamicAnchor),X[H]=V;function q(P){let x=this.opts.uriResolver.resolve;if(P=_1(V?x(V,P):P),Q.has(P))throw N(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(B,l.schema,P);else if(P!==_1(O))if(P[0]==="#")G(B,W[P],P),W[P]=B;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!i2.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(B,H,J){if(H!==void 0&&!y2(B,H))throw N(J)}function N(B){return new Error(`reference "${B}" resolves to more than one schema`)}}R3.getSchemaRefs=o2});var zU=Z((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});i3.getData=i3.KeywordCxt=i3.validateFunctionCode=void 0;var x3=pz(),_3=JU(),s8=m8(),Bb=JU(),s2=N3(),OU=K3(),e8=F3(),y=a(),i=s6(),$T=HU(),$4=W$(),AU=BU();function IT($){if(y3($)){if(u3($),f3($)){bT($);return}}h3($,()=>x3.topBoolOrEmptySchema($))}i3.validateFunctionCode=IT;function h3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,y._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(y._`"use strict"; ${Z3(U,w)}`),wT($,w),$.code(X)});else $.func(I,y._`${i.default.data}, ${UT(w)}`,b.$async,()=>$.code(Z3(U,w)).code(X))}function UT($){return y._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?y._`, ${i.default.dynamicAnchors}={}`:y.nil}}={}`}function wT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,y._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,y._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,y._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,y._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,y._`""`),$.var(i.default.parentData,y._`undefined`),$.var(i.default.parentDataProperty,y._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,y._`{}`)})}function bT($){let{schema:I,opts:U,gen:b}=$;h3($,()=>{if(U.$comment&&I.$comment)c3($);if(GT($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)XT($);l3($),BT($)});return}function XT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",y._`${U}.evaluated`),I.if(y._`${$.evaluated}.dynamicProps`,()=>I.assign(y._`${$.evaluated}.props`,y._`undefined`)),I.if(y._`${$.evaluated}.dynamicItems`,()=>I.assign(y._`${$.evaluated}.items`,y._`undefined`))}function Z3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function DT($,I){if(y3($)){if(u3($),f3($)){WT($,I);return}}x3.boolOrEmptySchema($,I)}function f3({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function y3($){return typeof $.schema!="boolean"}function WT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)c3($);NT($),YT($);let X=b.const("_errs",i.default.errors);l3($,X),b.var(I,y._`${X} === ${i.default.errors}`)}function u3($){$4.checkUnknownRules($),QT($)}function l3($,I){if($.opts.jtd)return C3($,[],!1,I);let U=_3.getSchemaTypes($.schema),b=_3.coerceAndCheckDataType($,U);C3($,U,!b,I)}function QT($){let{schema:I,errSchemaPath:U,opts:b,self:w}=$;if(I.$ref&&b.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,w.RULES))w.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function GT($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function NT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=$T.resolveUrl($.opts.uriResolver,$.baseId,I)}function YT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function c3({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(y._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=y.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(y._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function BT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(y._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(y._`new ${w}(${i.default.vErrors})`));else{if(I.assign(y._`${b}.errors`,i.default.vErrors),X.unevaluated)JT($);I.return(y._`${i.default.errors} === 0`)}}function JT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof y.Name)$.assign(y._`${I}.props`,U);if(b instanceof y.Name)$.assign(y._`${I}.items`,b)}function C3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:N}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,N))){w.block(()=>r3($,"$ref",N.all.$ref.definition));return}if(!Q.jtd)HT($,I);w.block(()=>{for(let H of N.rules)B(H);B(N.post)});function B(H){if(!s8.shouldUseGroup(X,H))return;if(H.type){if(w.if(Bb.checkDataType(H.type,D,Q.strictNumbers)),g3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Bb.reportTypeError($);w.endIf()}else g3($,H);if(!W)w.if(y._`${i.default.errors} === ${b||0}`)}}function g3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)s2.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(s8.shouldUseRule(b,X))r3($,X.keyword,X.definition,I.type)})}function HT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(AT($,I),!$.opts.allowUnionTypes)OT($,I);zT($,$.dataTypes)}function AT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!m3($.dataTypes,U))$Q($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),KT($,I)}function OT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))$Q($,"use allowUnionTypes to allow union type keyword")}function zT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&s8.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>LT(I,D)))$Q($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function LT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function m3($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function KT($,I){let U=[];for(let b of $.dataTypes)if(m3(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function $Q($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class IQ{constructor($,I,U){if(OU.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=$4.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",n3(this.$data,$));else if(this.schemaCode=this.schemaValue,!OU.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",i.default.errors)}result($,I,U){this.failResult(y.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(y.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(y._`${I} !== undefined && (${y.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?AU.reportExtraError:AU.reportError)(this,this.def.error,I)}$dataError(){AU.reportError(this,this.def.$dataError||AU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');AU.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=y.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=y.nil,I=y.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(y.or(y._`${b} === undefined`,I)),$!==y.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==y.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return y.or(X(),D());function X(){if(U.length){if(!(I instanceof y.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return y._`${Bb.checkDataTypes(W,I,w.opts.strictNumbers,Bb.DataType.Wrong)}`}return y.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return y._`!${W}(${I})`}return y.nil}}subschema($,I){let U=e8.getSubschema(this.it,$);e8.extendSubschemaData(U,this.it,$),e8.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return DT(b,I),b}mergeEvaluated($,I){let{it:U,gen:b}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=$4.mergeEvaluated.props(b,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.mergeEvaluated.items(b,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:b}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return b.if(I,()=>this.mergeEvaluated($,y.Name)),!0}}i3.KeywordCxt=IQ;function r3($,I,U,b){let w=new IQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)OU.funcKeywordCode(w,U);else if("macro"in U)OU.macroKeywordCode(w,U);else if(U.compile||U.validate)OU.funcKeywordCode(w,U)}var vT=/^\/(?:[^~]|~0|~1)*$/,VT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function n3($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!vT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=VT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let N=+G[1];if(w=G[2],w==="#"){if(N>=I)throw new Error(Q("property/index",N));return b[I-N]}if(N>I)throw new Error(Q("data",N));if(X=U[I-N],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=y._`${X}${y.getProperty($4.unescapeJsonPointer(G))}`,D=y._`${D} && ${X}`;return D;function Q(G,N){return`Cannot access ${G} ${N} levels up, current level is ${I}`}}i3.getData=n3});var Jb=Z((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});class d3 extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}p3.default=d3});var LU=Z((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});var UQ=HU();class t3 extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=UQ.resolveUrl($,I,U),this.missingSchema=UQ.normalizeId(UQ.getFullPath($,this.missingRef))}}a3.default=t3});var Ab=Z(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});$L.resolveSchema=$L.getCompilingSchema=$L.resolveRef=$L.compileSchema=$L.SchemaEnv=void 0;var S6=a(),ET=Jb(),a4=s6(),P6=HU(),e3=W$(),ST=zU();class KU{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:P6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}$L.SchemaEnv=KU;function bQ($){let I=s3.call(this,$);if(I)return I;let U=P6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:b,lines:w}=this.opts.code,{ownProperties:X}=this.opts,D=new S6.CodeGen(this.scope,{es5:b,lines:w,ownProperties:X}),W;if($.$async)W=D.scopeValue("Error",{ref:ET.default,code:S6._`require("ajv/dist/runtime/validation_error").default`});let Q=D.scopeName("validate");$.validateName=Q;let G={gen:D,allErrors:this.opts.allErrors,data:a4.default.data,parentData:a4.default.parentData,parentDataProperty:a4.default.parentDataProperty,dataNames:[a4.default.data],dataPathArr:[S6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:D.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:S6.stringify($.schema)}:{ref:$.schema}),validateName:Q,ValidationError:W,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:S6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:S6._`""`,opts:this.opts,self:this},N;try{this._compilations.add($),ST.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let B=D.toString();if(N=`${D.scopeRefs(a4.default.scope)}return ${B}`,this.opts.code.process)N=this.opts.code.process(N,$);let J=new Function(`${a4.default.self}`,`${a4.default.scope}`,N)(this,this.scope.get());if(this.scope.value(Q,{ref:J}),J.errors=null,J.schema=$.schema,J.schemaEnv=$,$.$async)J.$async=!0;if(this.opts.code.source===!0)J.source={validateName:Q,validateCode:B,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(J.evaluated={props:A instanceof S6.Name?void 0:A,items:O instanceof S6.Name?void 0:O,dynamicProps:A instanceof S6.Name,dynamicItems:O instanceof S6.Name},J.source)J.source.evaluated=S6.stringify(J.evaluated)}return $.validate=J,$}catch(B){if(delete $.validate,delete $.validateName,N)this.logger.error("Error compiling schema, function code:",N);throw B}finally{this._compilations.delete($)}}$L.compileSchema=bQ;function PT($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=TT.call(this,$,U);if(X===void 0){let D=(b=$.localRefs)===null||b===void 0?void 0:b[U],{schemaId:W}=this.opts;if(D)X=new KU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=kT.call(this,X)}$L.resolveRef=PT;function kT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:bQ.call(this,$)}function s3($){for(let I of this._compilations)if(RT(I,$))return I}$L.getCompilingSchema=s3;function RT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function TT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||Hb.call(this,$,I)}function Hb($,I){let U=this.opts.uriResolver.parse(I),b=P6._getFullPath(this.opts.uriResolver,U),w=P6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&b===w)return wQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=Hb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return wQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)bQ.call(this,D);if(X===P6.normalizeId(I)){let{schema:W}=D,{schemaId:Q}=this.opts,G=W[Q];if(G)w=P6.resolveUrl(this.opts.uriResolver,w,G);return new KU({schema:W,schemaId:Q,root:$,baseId:w})}return wQ.call(this,U,D)}$L.resolveSchema=Hb;var _T=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function wQ($,{baseId:I,schema:U,root:b}){var w;if(((w=$.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let W of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let Q=U[e3.unescapeFragment(W)];if(Q===void 0)return;U=Q;let G=typeof U==="object"&&U[this.opts.schemaId];if(!_T.has(W)&&G)I=P6.resolveUrl(this.opts.uriResolver,I,G)}let X;if(typeof U!="boolean"&&U.$ref&&!e3.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=Hb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new KU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var UL=Z((li,hT)=>{hT.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var DQ=Z((ci,DL)=>{var fT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),bL=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function XQ($){let I="",U=0,b=0;for(b=0;b<$.length;b++){if(U=$[b].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b];break}for(b+=1;b<$.length;b++){if(U=$[b].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b]}return I}var yT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function wL($){return $.length=0,!0}function uT($,I,U){if($.length){let b=XQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function lT($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=uT;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(G==="["||G==="]")continue;if(G===":"){if(X===!0)D=!0;if(!W(w,b,U))break;if(++I>7){U.error=!0;break}if(Q>0&&$[Q-1]===":")X=!0;b.push(":");continue}else if(G==="%"){if(!W(w,b,U))break;W=wL}else{w.push(G);continue}}if(w.length)if(W===wL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(XQ(w));return U.address=b.join(""),U}function XL($){if(cT($,":")<2)return{host:$,isIPV6:!1};let I=lT($);if(!I.error){let{address:U,address:b}=I;if(I.zone)U+="%"+I.zone,b+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:b}}else return{host:$,isIPV6:!1}}function cT($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function mT($){let I=$,U=[],b=-1,w=0;while(w=I.length){if(w===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(w===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(w===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((b=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,b)),I=I.slice(b)}return U.join("")}function rT($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function nT($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!bL(U)){let b=XL(U);if(b.isIPV6===!0)U=`[${b.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}DL.exports={nonSimpleDomain:yT,recomposeAuthority:nT,normalizeComponentEncoding:rT,removeDotSegments:mT,isIPv4:bL,isUUID:fT,normalizeIPv6:XL,stringArrayToHexStripped:XQ}});var YL=Z((mi,NL)=>{var{isUUID:iT}=DQ(),oT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,dT=["http","https","ws","wss","urn","urn:uuid"];function pT($){return dT.indexOf($)!==-1}function WQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function WL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function QL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function tT($){return $.secure=WQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function aT($){if($.port===(WQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function eT($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(oT);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=QQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function sT($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",b=$.nid.toLowerCase(),w=`${U}:${I.nid||b}`,X=QQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function $_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!iT(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function I_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var GL={scheme:"http",domainHost:!0,parse:WL,serialize:QL},U_={scheme:"https",domainHost:GL.domainHost,parse:WL,serialize:QL},Ob={scheme:"ws",domainHost:!0,parse:tT,serialize:aT},w_={scheme:"wss",domainHost:Ob.domainHost,parse:Ob.parse,serialize:Ob.serialize},b_={scheme:"urn",parse:eT,serialize:sT,skipNormalize:!0},X_={scheme:"urn:uuid",parse:$_,serialize:I_,skipNormalize:!0},zb={http:GL,https:U_,ws:Ob,wss:w_,urn:b_,"urn:uuid":X_};Object.setPrototypeOf(zb,null);function QQ($){return $&&(zb[$]||zb[$.toLowerCase()])||void 0}NL.exports={wsIsSecure:WQ,SCHEMES:zb,isValidSchemeName:pT,getSchemeHandler:QQ}});var HL=Z((ri,Kb)=>{var{normalizeIPv6:D_,removeDotSegments:vU,recomposeAuthority:W_,normalizeComponentEncoding:Lb,isIPv4:Q_,nonSimpleDomain:G_}=DQ(),{SCHEMES:N_,getSchemeHandler:BL}=YL();function Y_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function B_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=JL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function JL($,I,U,b){let w={};if(!b)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)w.scheme=I.scheme,w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=vU(I.path||""),w.query=I.query;else{if(!I.path)if(w.path=$.path,I.query!==void 0)w.query=I.query;else w.query=$.query;else{if(I.path[0]==="/")w.path=vU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)w.path="/"+I.path;else if(!$.path)w.path=I.path;else w.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;w.path=vU(w.path)}w.query=I.query}w.userinfo=$.userinfo,w.host=$.host,w.port=$.port}w.scheme=$.scheme}return w.fragment=I.fragment,w}function J_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Lb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Lb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Lb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Lb(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function f6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},b=Object.assign({},I),w=[],X=BL(b.scheme||U.scheme);if(X&&X.serialize)X.serialize(U,b);if(U.path!==void 0)if(!b.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(b.reference!=="suffix"&&U.scheme)w.push(U.scheme,":");let D=W_(U);if(D!==void 0){if(b.reference!=="suffix")w.push("//");if(w.push(D),U.path&&U.path[0]!=="/")w.push("/")}if(U.path!==void 0){let W=U.path;if(!b.absolutePath&&(!X||!X.absolutePath))W=vU(W);if(D===void 0&&W[0]==="/"&&W[1]==="/")W="/%2F"+W.slice(2);w.push(W)}if(U.query!==void 0)w.push("?",U.query);if(U.fragment!==void 0)w.push("#",U.fragment);return w.join("")}var H_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let X=$.match(H_);if(X){if(b.scheme=X[1],b.userinfo=X[3],b.host=X[4],b.port=parseInt(X[5],10),b.path=X[6]||"",b.query=X[7],b.fragment=X[8],isNaN(b.port))b.port=X[5];if(b.host)if(Q_(b.host)===!1){let Q=D_(b.host);b.host=Q.host.toLowerCase(),w=Q.isIPV6}else w=!0;if(b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path)b.reference="same-document";else if(b.scheme===void 0)b.reference="relative";else if(b.fragment===void 0)b.reference="absolute";else b.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==b.reference)b.error=b.error||"URI is not a "+U.reference+" reference.";let D=BL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&G_(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(W){b.error=b.error||"Host's domain name can not be converted to ASCII: "+W}}if(!D||D&&!D.skipNormalize){if($.indexOf("%")!==-1){if(b.scheme!==void 0)b.scheme=unescape(b.scheme);if(b.host!==void 0)b.host=unescape(b.host)}if(b.path)b.path=escape(unescape(b.path));if(b.fragment)b.fragment=encodeURI(decodeURIComponent(b.fragment))}if(D&&D.parse)D.parse(b,U)}else b.error=b.error||"URI can not be parsed.";return b}var GQ={SCHEMES:N_,normalize:Y_,resolve:B_,resolveComponent:JL,equal:J_,serialize:f6,parse:I4};Kb.exports=GQ;Kb.exports.default=GQ;Kb.exports.fastUri=GQ});var zL=Z((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var AL=HL();AL.code='require("ajv/dist/runtime/uri").default';OL.default=AL});var jL=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var O_=zU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return O_.KeywordCxt}});var Z1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return Z1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return Z1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return Z1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return Z1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return Z1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return Z1.CodeGen}});var z_=Jb(),qL=LU(),L_=c8(),VU=Ab(),K_=a(),qU=HU(),vb=JU(),YQ=W$(),LL=UL(),v_=zL(),FL=($,I)=>new RegExp($,I);FL.code="new RegExp";var V_=["removeAdditional","useDefaults","coerceTypes"],q_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),F_={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."},M_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},KL=200;function j_($){var I,U,b,w,X,D,W,Q,G,N,B,H,J,A,O,V,q,k,P,x,l,l$,Y6,B1,uD;let jI=$.strict,lD=(I=$.code)===null||I===void 0?void 0:I.optimize,OH=lD===!0||lD===void 0?1:lD||0,zH=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:FL,xM=(w=$.uriResolver)!==null&&w!==void 0?w:v_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:jI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:jI)!==null&&Q!==void 0?Q:!0,strictTypes:(N=(G=$.strictTypes)!==null&&G!==void 0?G:jI)!==null&&N!==void 0?N:"log",strictTuples:(H=(B=$.strictTuples)!==null&&B!==void 0?B:jI)!==null&&H!==void 0?H:"log",strictRequired:(A=(J=$.strictRequired)!==null&&J!==void 0?J:jI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:OH,regExp:zH}:{optimize:OH,regExp:zH},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:KL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:KL,meta:(q=$.meta)!==null&&q!==void 0?q:!0,messages:(k=$.messages)!==null&&k!==void 0?k:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(x=$.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(Y6=$.validateFormats)!==null&&Y6!==void 0?Y6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(uD=$.int32range)!==null&&uD!==void 0?uD:!0,uriResolver:xM}}class Vb{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...j_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new K_.ValueScope({scope:{},prefixes:q_,es5:I,lines:U}),this.logger=T_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=L_.getRules(),vL.call(this,F_,$,"NOT SUPPORTED"),vL.call(this,M_,$,"DEPRECATED","warn"),this._metaOpts=k_.call(this),$.formats)S_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)P_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);E_.call(this),$.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,b=LL;if(U==="id")b={...LL},b.id=b.$id,delete b.$id;if(I&&$)this.addMetaSchema(b,b[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let b=U(I);if(!("$async"in U))this.errors=U.errors;return b}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return b.call(this,$,I);async function b(G,N){await w.call(this,G.$schema);let B=this._addSchema(G,N);return B.validate||X.call(this,B)}async function w(G){if(G&&!this.getSchema(G))await b.call(this,{$ref:G},!0)}async function X(G){try{return this._compileSchemaEnv(G)}catch(N){if(!(N instanceof qL.default))throw N;return D.call(this,N),await W.call(this,N.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:N}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${N} cannot be resolved`)}async function W(G){let N=await Q.call(this,G);if(!this.refs[G])await w.call(this,N.$schema);if(!this.refs[G])this.addSchema(N,G,I)}async function Q(G){let N=this._loading[G];if(N)return N;try{return await(this._loading[G]=U(G))}finally{delete this._loading[G]}}}addSchema($,I,U,b=this.opts.validateSchema){if(Array.isArray($)){for(let X of $)this.addSchema(X,void 0,U,b);return this}let w;if(typeof $==="object"){let{schemaId:X}=this.opts;if(w=$[X],w!==void 0&&typeof w!="string")throw new Error(`schema ${X} must be string`)}return I=qU.normalizeId(I||w),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,b,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let b=this.validate(U,$);if(!b&&I){let w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return b}getSchema($){let I;while(typeof(I=VL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new VU.SchemaEnv({schema:{},schemaId:U});if(I=VU.resolveSchema.call(this,b,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=VL.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=qU.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Z_.call(this,U,I),!I)return YQ.eachItem(U,(w)=>NQ.call(this,w)),this;g_.call(this,I);let b={...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)};return YQ.eachItem(U,b.type.length===0?(w)=>NQ.call(this,w,b):(w)=>b.type.forEach((X)=>NQ.call(this,w,b,X))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let b=U.rules.findIndex((w)=>w.keyword===$);if(b>=0)U.rules.splice(b,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((b)=>`${U}${b.instancePath} ${b.message}`).reduce((b,w)=>b+I+w)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let b of I){let w=b.split("/").slice(1),X=$;for(let D of w)X=X[D];for(let D in U){let W=U[D];if(typeof W!="object")continue;let{$data:Q}=W.definition,G=X[D];if(Q&&G)X[D]=ML(G)}}return $}_removeAllSchemas($,I){for(let U in $){let b=$[U];if(!I||I.test(U)){if(typeof b=="string")delete $[U];else if(b&&!b.meta)this._cache.delete(b.schema),delete $[U]}}}_addSchema($,I,U,b=this.opts.validateSchema,w=this.opts.addUsedSchema){let X,{schemaId:D}=this.opts;if(typeof $=="object")X=$[D];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let W=this._cache.get($);if(W!==void 0)return W;U=qU.normalizeId(X||U);let Q=qU.getSchemaRefs.call(this,$,U);if(W=new VU.SchemaEnv({schema:$,schemaId:D,meta:I,baseId:U,localRefs:Q}),this._cache.set(W.schema,W),w&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=W}if(b)this.validateSchema($,!0);return W}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else VU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{VU.compileSchema.call(this,$)}finally{this.opts=I}}}Vb.ValidationError=z_.default;Vb.MissingRefError=qL.default;U4.default=Vb;function vL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function VL($){return $=qU.normalizeId($),this.schemas[$]||this.refs[$]}function E_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function S_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function P_($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function k_(){let $={...this.opts};for(let I of V_)delete $[I];return $}var R_={log(){},warn(){},error(){}};function T_($){if($===!1)return R_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var __=/^[a-z_$][a-z0-9_$:-]*$/i;function Z_($,I){let{RULES:U}=this;if(YQ.eachItem($,(b)=>{if(U.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!__.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function NQ($,I,U){var b;let w=I===null||I===void 0?void 0:I.post;if(U&&w)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,D=w?X.post:X.rules.find(({type:Q})=>Q===U);if(!D)D={type:U,rules:[]},X.rules.push(D);if(X.keywords[$]=!0,!I)return;let W={keyword:$,definition:{...I,type:vb.getJSONTypes(I.type),schemaType:vb.getJSONTypes(I.schemaType)}};if(I.before)C_.call(this,D,W,I.before);else D.rules.push(W);X.all[$]=W,(b=I.implements)===null||b===void 0||b.forEach((Q)=>this.addKeyword(Q))}function C_($,I,U){let b=$.rules.findIndex((w)=>w.keyword===U);if(b>=0)$.rules.splice(b,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function g_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=ML(I);$.validateSchema=this.compile(I,!0)}var x_={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ML($){return{anyOf:[$,x_]}}});var SL=Z((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});var y_={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};EL.default=y_});var ZL=Z((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});TL.callRef=TL.getValidate=void 0;var l_=LU(),PL=O6(),$6=a(),C1=s6(),kL=Ab(),qb=W$(),c_={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:b}=$,{baseId:w,schemaEnv:X,validateName:D,opts:W,self:Q}=b,{root:G}=X;if((U==="#"||U==="#/")&&w===G.baseId)return B();let N=kL.resolveRef.call(Q,G,w,U);if(N===void 0)throw new l_.default(b.opts.uriResolver,w,U);if(N instanceof kL.SchemaEnv)return H(N);return J(N);function B(){if(X===G)return Fb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return Fb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=RL($,A);Fb($,O,A,A.$async)}function J(A){let O=I.scopeValue("schema",W.code.source===!0?{ref:A,code:$6.stringify(A)}:{ref:A}),V=I.name("valid"),q=$.subschema({schema:A,dataTypes:[],schemaPath:$6.nil,topSchemaRef:O,errSchemaPath:U},V);$.mergeEvaluated(q),$.ok(V)}}};function RL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}TL.getValidate=RL;function Fb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?C1.default.this:$6.nil;if(b)N();else B();function N(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${PL.callValidateCode($,I,G)}`),J(I),!D)w.assign(A,!0)},(O)=>{if(w.if($6._`!(${O} instanceof ${X.ValidationError})`,()=>w.throw(O)),H(O),!D)w.assign(A,!1)}),$.ok(A)}function B(){$.result(PL.callValidateCode($,I,G),()=>J(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(C1.default.vErrors,$6._`${C1.default.vErrors} === null ? ${O} : ${C1.default.vErrors}.concat(${O})`),w.assign(C1.default.errors,$6._`${C1.default.vErrors}.length`)}function J(A){var O;if(!X.opts.unevaluated)return;let V=(O=U===null||U===void 0?void 0:U.validate)===null||O===void 0?void 0:O.evaluated;if(X.props!==!0)if(V&&!V.dynamicProps){if(V.props!==void 0)X.props=qb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=qb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=qb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=qb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}TL.callRef=Fb;TL.default=c_});var gL=Z((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});var n_=SL(),i_=ZL(),o_=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n_.default,i_.default];CL.default=o_});var hL=Z((xL)=>{Object.defineProperty(xL,"__esModule",{value:!0});var Mb=a(),V4=Mb.operators,jb={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},p_={message:({keyword:$,schemaCode:I})=>Mb.str`must be ${jb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Mb._`{comparison: ${jb[$].okStr}, limit: ${I}}`},t_={keyword:Object.keys(jb),type:"number",schemaType:"number",$data:!0,error:p_,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Mb._`${U} ${jb[I].fail} ${b} || isNaN(${U})`)}};xL.default=t_});var yL=Z((fL)=>{Object.defineProperty(fL,"__esModule",{value:!0});var FU=a(),e_={message:({schemaCode:$})=>FU.str`must be multiple of ${$}`,params:({schemaCode:$})=>FU._`{multipleOf: ${$}}`},s_={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:e_,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?FU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:FU._`${D} !== parseInt(${D})`;$.fail$data(FU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};fL.default=s_});var cL=Z((lL)=>{Object.defineProperty(lL,"__esModule",{value:!0});function uL($){let I=$.length,U=0,b=0,w;while(b<I)if(U++,w=$.charCodeAt(b++),w>=55296&&w<=56319&&b<I){if(w=$.charCodeAt(b),(w&64512)===56320)b++}return U}lL.default=uL;uL.code='require("ajv/dist/runtime/ucs2length").default'});var rL=Z((mL)=>{Object.defineProperty(mL,"__esModule",{value:!0});var e4=a(),UZ=W$(),wZ=cL(),bZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return e4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>e4._`{limit: ${$}}`},XZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?e4.operators.GT:e4.operators.LT,D=w.opts.unicode===!1?e4._`${U}.length`:e4._`${UZ.useFunc($.gen,wZ.default)}(${U})`;$.fail$data(e4._`${D} ${X} ${b}`)}};mL.default=XZ});var iL=Z((nL)=>{Object.defineProperty(nL,"__esModule",{value:!0});var WZ=O6(),Eb=a(),QZ={message:({schemaCode:$})=>Eb.str`must match pattern "${$}"`,params:({schemaCode:$})=>Eb._`{pattern: ${$}}`},GZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?Eb._`(new RegExp(${w}, ${D}))`:WZ.usePattern($,b);$.fail$data(Eb._`!${W}.test(${I})`)}};nL.default=GZ});var dL=Z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});var MU=a(),YZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return MU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>MU._`{limit: ${$}}`},BZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:YZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?MU.operators.GT:MU.operators.LT;$.fail$data(MU._`Object.keys(${U}).length ${w} ${b}`)}};oL.default=BZ});var tL=Z((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});var jU=O6(),EU=a(),HZ=W$(),AZ={message:({params:{missingProperty:$}})=>EU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>EU._`{missingProperty: ${$}}`},OZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AZ,code($){let{gen:I,schema:U,schemaCode:b,data:w,$data:X,it:D}=$,{opts:W}=D;if(!X&&U.length===0)return;let Q=U.length>=W.loopRequired;if(D.allErrors)G();else N();if(W.strictRequired){let J=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((J===null||J===void 0?void 0:J[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;HZ.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(EU.nil,B);else for(let J of U)jU.checkReportMissingProp($,J)}function N(){let J=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(J,A)),$.ok(A)}else I.if(jU.checkMissingProp($,U,J)),jU.reportMissingProp($,J),I.else()}function B(){I.forOf("prop",b,(J)=>{$.setParams({missingProperty:J}),I.if(jU.noPropertyInData(I,w,J,W.ownProperties),()=>$.error())})}function H(J,A){$.setParams({missingProperty:J}),I.forOf(J,b,()=>{I.assign(A,jU.propertyInData(I,w,J,W.ownProperties)),I.if(EU.not(A),()=>{$.error(),I.break()})},EU.nil)}}};pL.default=OZ});var eL=Z((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var SU=a(),LZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return SU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>SU._`{limit: ${$}}`},KZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:LZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?SU.operators.GT:SU.operators.LT;$.fail$data(SU._`${U}.length ${w} ${b}`)}};aL.default=KZ});var Sb=Z(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var sL=t8();sL.code='require("ajv/dist/runtime/equal").default';$K.default=sL});var UK=Z((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var BQ=JU(),h$=a(),qZ=W$(),FZ=Sb(),MZ={message:({params:{i:$,j:I}})=>h$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>h$._`{i: ${$}, j: ${I}}`},jZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MZ,code($){let{gen:I,data:U,$data:b,schema:w,parentSchema:X,schemaCode:D,it:W}=$;if(!b&&!w)return;let Q=I.let("valid"),G=X.items?BQ.getSchemaTypes(X.items):[];$.block$data(Q,N,h$._`${D} === false`),$.ok(Q);function N(){let A=I.let("i",h$._`${U}.length`),O=I.let("j");$.setParams({i:A,j:O}),I.assign(Q,!0),I.if(h$._`${A} > 1`,()=>(B()?H:J)(A,O))}function B(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=BQ.checkDataTypes(G,V,W.opts.strictNumbers,BQ.DataType.Wrong),k=I.const("indices",h$._`{}`);I.for(h$._`;${A}--;`,()=>{if(I.let(V,h$._`${U}[${A}]`),I.if(q,h$._`continue`),G.length>1)I.if(h$._`typeof ${V} == "string"`,h$._`${V} += "_"`);I.if(h$._`typeof ${k}[${V}] == "number"`,()=>{I.assign(O,h$._`${k}[${V}]`),$.error(),I.assign(Q,!1).break()}).code(h$._`${k}[${V}] = ${A}`)})}function J(A,O){let V=qZ.useFunc(I,FZ.default),q=I.name("outer");I.label(q).for(h$._`;${A}--;`,()=>I.for(h$._`${O} = ${A}; ${O}--;`,()=>I.if(h$._`${V}(${U}[${A}], ${U}[${O}])`,()=>{$.error(),I.assign(Q,!1).break(q)})))}}};IK.default=jZ});var bK=Z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});var JQ=a(),SZ=W$(),PZ=Sb(),kZ={message:"must be equal to constant",params:({schemaCode:$})=>JQ._`{allowedValue: ${$}}`},RZ={keyword:"const",$data:!0,error:kZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(JQ._`!${SZ.useFunc(I,PZ.default)}(${U}, ${w})`);else $.fail(JQ._`${X} !== ${U}`)}};wK.default=RZ});var DK=Z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var PU=a(),_Z=W$(),ZZ=Sb(),CZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>PU._`{allowedValues: ${$}}`},gZ={keyword:"enum",schemaType:"array",$data:!0,error:CZ,code($){let{gen:I,data:U,$data:b,schema:w,schemaCode:X,it:D}=$;if(!b&&w.length===0)throw new Error("enum must have non-empty array");let W=w.length>=D.opts.loopEnum,Q,G=()=>Q!==null&&Q!==void 0?Q:Q=_Z.useFunc(I,ZZ.default),N;if(W||b)N=I.let("valid"),$.block$data(N,B);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let J=I.const("vSchema",X);N=PU.or(...w.map((A,O)=>H(J,O)))}$.pass(N);function B(){I.assign(N,!1),I.forOf("v",X,(J)=>I.if(PU._`${G()}(${U}, ${J})`,()=>I.assign(N,!0).break()))}function H(J,A){let O=w[A];return typeof O==="object"&&O!==null?PU._`${G()}(${U}, ${J}[${A}])`:PU._`${U} === ${O}`}}};XK.default=gZ});var QK=Z((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});var hZ=hL(),fZ=yL(),yZ=rL(),uZ=iL(),lZ=dL(),cZ=tL(),mZ=eL(),rZ=UK(),nZ=bK(),iZ=DK(),oZ=[hZ.default,fZ.default,yZ.default,uZ.default,lZ.default,cZ.default,mZ.default,rZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nZ.default,iZ.default];WK.default=oZ});var AQ=Z((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});NK.validateAdditionalItems=void 0;var s4=a(),HQ=W$(),pZ={message:({params:{len:$}})=>s4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>s4._`{limit: ${$}}`},tZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:pZ,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){HQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}GK($,b)}};function GK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",s4._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass(s4._`${W} <= ${I.length}`);else if(typeof b=="object"&&!HQ.alwaysValidSchema(D,b)){let G=U.var("valid",s4._`${W} <= ${I.length}`);U.if(s4.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(N)=>{if($.subschema({keyword:X,dataProp:N,dataPropType:HQ.Type.Num},G),!D.allErrors)U.if(s4.not(G),()=>U.break())})}}NK.validateAdditionalItems=GK;NK.default=tZ});var OQ=Z((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});HK.validateTuple=void 0;var BK=a(),Pb=W$(),eZ=O6(),sZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return JK($,"additionalItems",I);if(U.items=!0,Pb.alwaysValidSchema(U,I))return;$.ok(eZ.validateArray($))}};function JK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(N(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Pb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",BK._`${X}.length`);U.forEach((B,H)=>{if(Pb.alwaysValidSchema(W,B))return;b.if(BK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function N(B){let{opts:H,errSchemaPath:J}=W,A=U.length,O=A===B.minItems&&(A===B.maxItems||B[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${J}"`;Pb.checkStrictMode(W,V,H.strictTuples)}}}HK.validateTuple=JK;HK.default=sZ});var zK=Z((OK)=>{Object.defineProperty(OK,"__esModule",{value:!0});var IC=OQ(),UC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>IC.validateTuple($,"items")};OK.default=UC});var vK=Z((KK)=>{Object.defineProperty(KK,"__esModule",{value:!0});var LK=a(),bC=W$(),XC=O6(),DC=AQ(),WC={message:({params:{len:$}})=>LK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>LK._`{limit: ${$}}`},QC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:WC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,bC.alwaysValidSchema(b,I))return;if(w)DC.validateAdditionalItems($,w);else $.ok(XC.validateArray($))}};KK.default=QC});var qK=Z((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var z6=a(),kb=W$(),NC={message:({params:{min:$,max:I}})=>I===void 0?z6.str`must contain at least ${$} valid item(s)`:z6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?z6._`{minContains: ${$}}`:z6._`{minContains: ${$}, maxContains: ${I}}`},YC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:NC,code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$,D,W,{minContains:Q,maxContains:G}=b;if(X.opts.next)D=Q===void 0?1:Q,W=G;else D=1;let N=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){kb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){kb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(kb.alwaysValidSchema(X,U)){let O=z6._`${N} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${N} <= ${W}`;$.pass(O);return}X.items=!0;let B=I.name("valid");if(W===void 0&&D===1)J(B,()=>I.if(B,()=>I.break()));else if(D===0){if(I.let(B,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(B,!1),H();$.result(B,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);J(O,()=>I.if(O,()=>A(V)))}function J(O,V){I.forRange("i",0,N,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:kb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(B,!1).break()),D===1)I.assign(B,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(B,!0))}}};VK.default=YC});var PK=Z((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});jK.validateSchemaDeps=jK.validatePropertyDeps=jK.error=void 0;var zQ=a(),JC=W$(),kU=O6();jK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return zQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>zQ._`{property: ${$},
6
+ || ${D} === "boolean" || ${w} === null`).assign(W,p._`[${w}]`)}}}function XR({gen:$,parentData:I,parentDataProperty:U},b){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,b))}function $Q($,I,U,b=T1.Correct){let w=b===T1.Correct?p.operators.EQ:p.operators.NEQ,X;switch($){case"null":return p._`${I} ${w} null`;case"array":X=p._`Array.isArray(${I})`;break;case"object":X=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":X=D(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":X=D();break;default:return p._`typeof ${I} ${w} ${$}`}return b===T1.Correct?X:p.not(X);function D(W=p.nil){return p.and(p._`typeof ${I} == "number"`,W,U?p._`isFinite(${I})`:p.nil)}}V3.checkDataType=$Q;function IQ($,I,U,b){if($.length===1)return $Q($[0],I,U,b);let w,X=L3.toHash($);if(X.array&&X.object){let D=p._`typeof ${I} != "object"`;w=X.null?D:p._`!${I} || ${D}`,delete X.null,delete X.array,delete X.object}else w=p.nil;if(X.number)delete X.integer;for(let D in X)w=p.and(w,$Q(D,I,U,b));return w}V3.checkDataTypes=IQ;var DR={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function UQ($){let I=WR($);$R.reportError(I,DR)}V3.reportTypeError=UQ;function WR($){let{gen:I,data:U,schema:b}=$,w=L3.schemaRefOrVal($,b,"type");return{gen:I,keyword:"type",data:U,schema:b.type,schemaCode:w,schemaValue:w,parentSchema:b,params:{},it:$}}});var E3=Z((F3)=>{Object.defineProperty(F3,"__esModule",{value:!0});F3.assignDefaults=void 0;var _1=a(),HR=W$();function AR($,I){let{properties:U,items:b}=$.schema;if(I==="object"&&U)for(let w in U)M3($,w,U[w].default);else if(I==="array"&&Array.isArray(b))b.forEach((w,X)=>M3($,X,w.default))}F3.assignDefaults=AR;function M3($,I,U){let{gen:b,compositeRule:w,data:X,opts:D}=$;if(U===void 0)return;let W=_1._`${X}${_1.getProperty(I)}`;if(w){HR.checkStrictMode($,`default is ignored for: ${W}`);return}let Q=_1._`${W} === undefined`;if(D.useDefaults==="empty")Q=_1._`${Q} || ${W} === null || ${W} === ""`;b.if(Q,_1._`${W} = ${_1.stringify(U)}`)}});var O6=Z((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});k3.validateUnion=k3.validateArray=k3.usePattern=k3.callValidateCode=k3.schemaProperties=k3.allSchemaProperties=k3.noPropertyInData=k3.propertyInData=k3.isOwnProperty=k3.hasPropFunc=k3.reportMissingProp=k3.checkMissingProp=k3.checkReportMissingProp=void 0;var K$=a(),wQ=W$(),v4=s6(),OR=W$();function zR($,I){let{gen:U,data:b,it:w}=$;U.if(XQ(U,b,I,w.opts.ownProperties),()=>{$.setParams({missingProperty:K$._`${I}`},!0),$.error()})}k3.checkReportMissingProp=zR;function LR({gen:$,data:I,it:{opts:U}},b,w){return K$.or(...b.map((X)=>K$.and(XQ($,I,X,U.ownProperties),K$._`${w} = ${X}`)))}k3.checkMissingProp=LR;function KR($,I){$.setParams({missingProperty:I},!0),$.error()}k3.reportMissingProp=KR;function S3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:K$._`Object.prototype.hasOwnProperty`})}k3.hasPropFunc=S3;function bQ($,I,U){return K$._`${S3($)}.call(${I}, ${U})`}k3.isOwnProperty=bQ;function vR($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} !== undefined`;return b?K$._`${w} && ${bQ($,I,U)}`:w}k3.propertyInData=vR;function XQ($,I,U,b){let w=K$._`${I}${K$.getProperty(U)} === undefined`;return b?K$.or(w,K$.not(bQ($,I,U))):w}k3.noPropertyInData=XQ;function P3($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}k3.allSchemaProperties=P3;function VR($,I){return P3(I).filter((U)=>!wQ.alwaysValidSchema($,I[U]))}k3.schemaProperties=VR;function qR({schemaCode:$,data:I,it:{gen:U,topSchemaRef:b,schemaPath:w,errorPath:X},it:D},W,Q,G){let Y=G?K$._`${$}, ${I}, ${b}${w}`:I,J=[[v4.default.instancePath,K$.strConcat(v4.default.instancePath,X)],[v4.default.parentData,D.parentData],[v4.default.parentDataProperty,D.parentDataProperty],[v4.default.rootData,v4.default.rootData]];if(D.opts.dynamicRef)J.push([v4.default.dynamicAnchors,v4.default.dynamicAnchors]);let H=K$._`${Y}, ${U.object(...J)}`;return Q!==K$.nil?K$._`${W}.call(${Q}, ${H})`:K$._`${W}(${H})`}k3.callValidateCode=qR;var MR=K$._`new RegExp`;function FR({gen:$,it:{opts:I}},U){let b=I.unicodeRegExp?"u":"",{regExp:w}=I.code,X=w(U,b);return $.scopeValue("pattern",{key:X.toString(),ref:X,code:K$._`${w.code==="new RegExp"?MR:OR.useFunc($,w)}(${U}, ${b})`})}k3.usePattern=FR;function jR($){let{gen:I,data:U,keyword:b,it:w}=$,X=I.name("valid");if(w.allErrors){let W=I.let("valid",!0);return D(()=>I.assign(W,!1)),W}return I.var(X,!0),D(()=>I.break()),X;function D(W){let Q=I.const("len",K$._`${U}.length`);I.forRange("i",0,Q,(G)=>{$.subschema({keyword:b,dataProp:G,dataPropType:wQ.Type.Num},X),I.if(K$.not(X),W)})}}k3.validateArray=jR;function ER($){let{gen:I,schema:U,keyword:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((Q)=>wQ.alwaysValidSchema(w,Q))&&!w.opts.unevaluated)return;let D=I.let("valid",!1),W=I.name("_valid");I.block(()=>U.forEach((Q,G)=>{let Y=$.subschema({keyword:b,schemaProp:G,compositeRule:!0},W);if(I.assign(D,K$._`${D} || ${W}`),!$.mergeValidEvaluated(Y,W))I.if(K$.not(D))})),$.result(D,()=>$.reset(),()=>$.error(!0))}k3.validateUnion=ER});var g3=Z((Z3)=>{Object.defineProperty(Z3,"__esModule",{value:!0});Z3.validateKeywordUsage=Z3.validSchemaType=Z3.funcKeywordCode=Z3.macroKeywordCode=void 0;var i$=a(),a4=s6(),yR=O6(),uR=HU();function lR($,I){let{gen:U,keyword:b,schema:w,parentSchema:X,it:D}=$,W=I.macro.call(D.self,w,X,D),Q=_3(U,b,W);if(D.opts.validateSchema!==!1)D.self.validateSchema(W,!0);let G=U.name("valid");$.subschema({schema:W,schemaPath:i$.nil,errSchemaPath:`${D.errSchemaPath}/${b}`,topSchemaRef:Q,compositeRule:!0},G),$.pass(G,()=>$.error(!0))}Z3.macroKeywordCode=lR;function cR($,I){var U;let{gen:b,keyword:w,schema:X,parentSchema:D,$data:W,it:Q}=$;rR(Q,I);let G=!W&&I.compile?I.compile.call(Q.self,X,D,Q):I.validate,Y=_3(b,w,G),J=b.let("valid");$.block$data(J,H),$.ok((U=I.valid)!==null&&U!==void 0?U:J);function H(){if(I.errors===!1){if(O(),I.modifying)T3($);V(()=>$.error())}else{let q=I.async?B():A();if(I.modifying)T3($);V(()=>mR($,q))}}function B(){let q=b.let("ruleErrs",null);return b.try(()=>O(i$._`await `),(k)=>b.assign(J,!1).if(i$._`${k} instanceof ${Q.ValidationError}`,()=>b.assign(q,i$._`${k}.errors`),()=>b.throw(k))),q}function A(){let q=i$._`${Y}.errors`;return b.assign(q,null),O(i$.nil),q}function O(q=I.async?i$._`await `:i$.nil){let k=Q.opts.passContext?a4.default.this:a4.default.self,P=!(("compile"in I)&&!W||I.schema===!1);b.assign(J,i$._`${q}${yR.callValidateCode($,Y,k,P)}`,I.modifying)}function V(q){var k;b.if(i$.not((k=I.valid)!==null&&k!==void 0?k:J),q)}}Z3.funcKeywordCode=cR;function T3($){let{gen:I,data:U,it:b}=$;I.if(b.parentData,()=>I.assign(U,i$._`${b.parentData}[${b.parentDataProperty}]`))}function mR($,I){let{gen:U}=$;U.if(i$._`Array.isArray(${I})`,()=>{U.assign(a4.default.vErrors,i$._`${a4.default.vErrors} === null ? ${I} : ${a4.default.vErrors}.concat(${I})`).assign(a4.default.errors,i$._`${a4.default.vErrors}.length`),uR.extendErrors($)},()=>$.error())}function rR({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function _3($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:i$.stringify(U)})}function nR($,I,U=!1){return!I.length||I.some((b)=>b==="array"?Array.isArray($):b==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==b||U&&typeof $=="undefined")}Z3.validSchemaType=nR;function iR({schema:$,opts:I,self:U,errSchemaPath:b},w,X){if(Array.isArray(w.keyword)?!w.keyword.includes(X):w.keyword!==X)throw new Error("ajv implementation error");let D=w.dependencies;if(D===null||D===void 0?void 0:D.some((W)=>!Object.prototype.hasOwnProperty.call($,W)))throw new Error(`parent schema must have dependencies of ${X}: ${D.join(",")}`);if(w.validateSchema){if(!w.validateSchema($[X])){let Q=`keyword "${X}" value is invalid at path "${b}": `+U.errorsText(w.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(Q);else throw new Error(Q)}}}Z3.validateKeywordUsage=iR});var y3=Z((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});h3.extendSubschemaMode=h3.extendSubschemaData=h3.getSubschema=void 0;var h6=a(),x3=W$();function tR($,{keyword:I,schemaProp:U,schema:b,schemaPath:w,errSchemaPath:X,topSchemaRef:D}){if(I!==void 0&&b!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let W=$.schema[I];return U===void 0?{schema:W,schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:W[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${x3.escapeFragment(U)}`}}if(b!==void 0){if(w===void 0||X===void 0||D===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:b,schemaPath:w,topSchemaRef:D,errSchemaPath:X}}throw new Error('either "keyword" or "schema" must be passed')}h3.getSubschema=tR;function aR($,I,{dataProp:U,dataPropType:b,data:w,dataTypes:X,propertyName:D}){if(w!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=I;if(U!==void 0){let{errorPath:G,dataPathArr:Y,opts:J}=I,H=W.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);Q(H),$.errorPath=h6.str`${G}${x3.getErrorPath(U,b,J.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...Y,$.parentDataProperty]}if(w!==void 0){let G=w instanceof h6.Name?w:W.let("data",w,!0);if(Q(G),D!==void 0)$.propertyName=D}if(X)$.dataTypes=X;function Q(G){$.data=G,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,G]}}h3.extendSubschemaData=aR;function eR($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:b,createErrors:w,allErrors:X}){if(b!==void 0)$.compositeRule=b;if(w!==void 0)$.createErrors=w;if(X!==void 0)$.allErrors=X;$.jtdDiscriminator=I,$.jtdMetadata=U}h3.extendSubschemaMode=eR});var DQ=Z(($o,u3)=>{u3.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var b,w,X;if(Array.isArray(I)){if(b=I.length,b!=U.length)return!1;for(w=b;w--!==0;)if(!$(I[w],U[w]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(X=Object.keys(I),b=X.length,b!==Object.keys(U).length)return!1;for(w=b;w--!==0;)if(!Object.prototype.hasOwnProperty.call(U,X[w]))return!1;for(w=b;w--!==0;){var D=X[w];if(!$(I[D],U[D]))return!1}return!0}return I!==I&&U!==U}});var c3=Z((Io,l3)=>{var V4=l3.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var b=typeof U=="function"?U:U.pre||function(){},w=U.post||function(){};zb(I,b,w,$,"",$)};V4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};V4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};V4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};V4.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function zb($,I,U,b,w,X,D,W,Q,G){if(b&&typeof b=="object"&&!Array.isArray(b)){I(b,w,X,D,W,Q,G);for(var Y in b){var J=b[Y];if(Array.isArray(J)){if(Y in V4.arrayKeywords)for(var H=0;H<J.length;H++)zb($,I,U,J[H],w+"/"+Y+"/"+H,X,w,Y,b,H)}else if(Y in V4.propsKeywords){if(J&&typeof J=="object")for(var B in J)zb($,I,U,J[B],w+"/"+Y+"/"+IT(B),X,w,Y,b,B)}else if(Y in V4.keywords||$.allKeys&&!(Y in V4.skipKeywords))zb($,I,U,J,w+"/"+Y,X,w,Y,b)}U(b,w,X,D,W,Q,G)}}function IT($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var OU=Z((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});i3.getSchemaRefs=i3.resolveUrl=i3.normalizeId=i3._getFullPath=i3.getFullPath=i3.inlineRef=void 0;var UT=W$(),wT=DQ(),bT=c3(),XT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DT($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!WQ($);if(!I)return!1;return m3($)<=I}i3.inlineRef=DT;var WT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function WQ($){for(let I in $){if(WT.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(WQ))return!0;if(typeof U=="object"&&WQ(U))return!0}return!1}function m3($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,XT.has(U))continue;if(typeof $[U]=="object")UT.eachItem($[U],(b)=>I+=m3(b));if(I===1/0)return 1/0}return I}function r3($,I="",U){if(U!==!1)I=Z1(I);let b=$.parse(I);return n3($,b)}i3.getFullPath=r3;function n3($,I){return $.serialize(I).split("#")[0]+"#"}i3._getFullPath=n3;var QT=/#\/?$/;function Z1($){return $?$.replace(QT,""):""}i3.normalizeId=Z1;function GT($,I,U){return U=Z1(U),$.resolve(I,U)}i3.resolveUrl=GT;var YT=/^[a-z_][-a-z0-9._]*$/i;function NT($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:b}=this.opts,w=Z1($[U]||I),X={"":w},D=r3(b,w,!1),W={},Q=new Set;return bT($,{allKeys:!0},(J,H,B,A)=>{if(A===void 0)return;let O=D+H,V=X[A];if(typeof J[U]=="string")V=q.call(this,J[U]);k.call(this,J.$anchor),k.call(this,J.$dynamicAnchor),X[H]=V;function q(P){let h=this.opts.uriResolver.resolve;if(P=Z1(V?h(V,P):P),Q.has(P))throw Y(P);Q.add(P);let l=this.refs[P];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")G(J,l.schema,P);else if(P!==Z1(O))if(P[0]==="#")G(J,W[P],P),W[P]=J;else this.refs[P]=O;return P}function k(P){if(typeof P=="string"){if(!YT.test(P))throw new Error(`invalid anchor "${P}"`);q.call(this,`#${P}`)}}}),W;function G(J,H,B){if(H!==void 0&&!wT(J,H))throw Y(B)}function Y(J){return new Error(`reference "${J}" resolves to more than one schema`)}}i3.getSchemaRefs=NT});var KU=Z((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});QL.getData=QL.KeywordCxt=QL.validateFunctionCode=void 0;var e3=N3(),d3=AU(),GQ=s8(),Lb=AU(),zT=E3(),LU=g3(),QQ=y3(),u=a(),i=s6(),LT=OU(),$4=W$(),zU=HU();function KT($){if(IL($)){if(UL($),$L($)){qT($);return}}s3($,()=>e3.topBoolOrEmptySchema($))}QL.validateFunctionCode=KT;function s3({gen:$,validateName:I,schema:U,schemaEnv:b,opts:w},X){if(w.code.es5)$.func(I,u._`${i.default.data}, ${i.default.valCxt}`,b.$async,()=>{$.code(u._`"use strict"; ${p3(U,w)}`),VT($,w),$.code(X)});else $.func(I,u._`${i.default.data}, ${vT(w)}`,b.$async,()=>$.code(p3(U,w)).code(X))}function vT($){return u._`{${i.default.instancePath}="", ${i.default.parentData}, ${i.default.parentDataProperty}, ${i.default.rootData}=${i.default.data}${$.dynamicRef?u._`, ${i.default.dynamicAnchors}={}`:u.nil}}={}`}function VT($,I){$.if(i.default.valCxt,()=>{if($.var(i.default.instancePath,u._`${i.default.valCxt}.${i.default.instancePath}`),$.var(i.default.parentData,u._`${i.default.valCxt}.${i.default.parentData}`),$.var(i.default.parentDataProperty,u._`${i.default.valCxt}.${i.default.parentDataProperty}`),$.var(i.default.rootData,u._`${i.default.valCxt}.${i.default.rootData}`),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`${i.default.valCxt}.${i.default.dynamicAnchors}`)},()=>{if($.var(i.default.instancePath,u._`""`),$.var(i.default.parentData,u._`undefined`),$.var(i.default.parentDataProperty,u._`undefined`),$.var(i.default.rootData,i.default.data),I.dynamicRef)$.var(i.default.dynamicAnchors,u._`{}`)})}function qT($){let{schema:I,opts:U,gen:b}=$;s3($,()=>{if(U.$comment&&I.$comment)bL($);if(ST($),b.let(i.default.vErrors,null),b.let(i.default.errors,0),U.unevaluated)MT($);wL($),RT($)});return}function MT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",u._`${U}.evaluated`),I.if(u._`${$.evaluated}.dynamicProps`,()=>I.assign(u._`${$.evaluated}.props`,u._`undefined`)),I.if(u._`${$.evaluated}.dynamicItems`,()=>I.assign(u._`${$.evaluated}.items`,u._`undefined`))}function p3($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?u._`/*# sourceURL=${U} */`:u.nil}function FT($,I){if(IL($)){if(UL($),$L($)){jT($,I);return}}e3.boolOrEmptySchema($,I)}function $L({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function IL($){return typeof $.schema!="boolean"}function jT($,I){let{schema:U,gen:b,opts:w}=$;if(w.$comment&&U.$comment)bL($);PT($),kT($);let X=b.const("_errs",i.default.errors);wL($,X),b.var(I,u._`${X} === ${i.default.errors}`)}function UL($){$4.checkUnknownRules($),ET($)}function wL($,I){if($.opts.jtd)return t3($,[],!1,I);let U=d3.getSchemaTypes($.schema),b=d3.coerceAndCheckDataType($,U);t3($,U,!b,I)}function ET($){let{schema:I,errSchemaPath:U,opts:b,self:w}=$;if(I.$ref&&b.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,w.RULES))w.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function ST($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function PT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=LT.resolveUrl($.opts.uriResolver,$.baseId,I)}function kT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function bL({gen:$,schemaEnv:I,schema:U,errSchemaPath:b,opts:w}){let X=U.$comment;if(w.$comment===!0)$.code(u._`${i.default.self}.logger.log(${X})`);else if(typeof w.$comment=="function"){let D=u.str`${b}/$comment`,W=$.scopeValue("root",{ref:I.root});$.code(u._`${i.default.self}.opts.$comment(${X}, ${D}, ${W}.schema)`)}}function RT($){let{gen:I,schemaEnv:U,validateName:b,ValidationError:w,opts:X}=$;if(U.$async)I.if(u._`${i.default.errors} === 0`,()=>I.return(i.default.data),()=>I.throw(u._`new ${w}(${i.default.vErrors})`));else{if(I.assign(u._`${b}.errors`,i.default.vErrors),X.unevaluated)TT($);I.return(u._`${i.default.errors} === 0`)}}function TT({gen:$,evaluated:I,props:U,items:b}){if(U instanceof u.Name)$.assign(u._`${I}.props`,U);if(b instanceof u.Name)$.assign(u._`${I}.items`,b)}function t3($,I,U,b){let{gen:w,schema:X,data:D,allErrors:W,opts:Q,self:G}=$,{RULES:Y}=G;if(X.$ref&&(Q.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(X,Y))){w.block(()=>DL($,"$ref",Y.all.$ref.definition));return}if(!Q.jtd)_T($,I);w.block(()=>{for(let H of Y.rules)J(H);J(Y.post)});function J(H){if(!GQ.shouldUseGroup(X,H))return;if(H.type){if(w.if(Lb.checkDataType(H.type,D,Q.strictNumbers)),a3($,H),I.length===1&&I[0]===H.type&&U)w.else(),Lb.reportTypeError($);w.endIf()}else a3($,H);if(!W)w.if(u._`${i.default.errors} === ${b||0}`)}}function a3($,I){let{gen:U,schema:b,opts:{useDefaults:w}}=$;if(w)zT.assignDefaults($,I.type);U.block(()=>{for(let X of I.rules)if(GQ.shouldUseRule(b,X))DL($,X.keyword,X.definition,I.type)})}function _T($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(ZT($,I),!$.opts.allowUnionTypes)CT($,I);gT($,$.dataTypes)}function ZT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!XL($.dataTypes,U))YQ($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),hT($,I)}function CT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))YQ($,"use allowUnionTypes to allow union type keyword")}function gT($,I){let U=$.self.RULES.all;for(let b in U){let w=U[b];if(typeof w=="object"&&GQ.shouldUseRule($.schema,w)){let{type:X}=w.definition;if(X.length&&!X.some((D)=>xT(I,D)))YQ($,`missing type "${X.join(",")}" for keyword "${b}"`)}}}function xT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function XL($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function hT($,I){let U=[];for(let b of $.dataTypes)if(XL(I,b))U.push(b);else if(I.includes("integer")&&b==="number")U.push("integer");$.dataTypes=U}function YQ($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class NQ{constructor($,I,U){if(LU.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=$4.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",WL(this.$data,$));else if(this.schemaCode=this.schemaValue,!LU.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",i.default.errors)}result($,I,U){this.failResult(u.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(u.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(u._`${I} !== undefined && (${u.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?zU.reportExtraError:zU.reportError)(this,this.def.error,I)}$dataError(){zU.reportError(this,this.def.$dataError||zU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');zU.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=u.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=u.nil,I=u.nil){if(!this.$data)return;let{gen:U,schemaCode:b,schemaType:w,def:X}=this;if(U.if(u.or(u._`${b} === undefined`,I)),$!==u.nil)U.assign($,!0);if(w.length||X.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:b,it:w}=this;return u.or(X(),D());function X(){if(U.length){if(!(I instanceof u.Name))throw new Error("ajv implementation error");let W=Array.isArray(U)?U:[U];return u._`${Lb.checkDataTypes(W,I,w.opts.strictNumbers,Lb.DataType.Wrong)}`}return u.nil}function D(){if(b.validateSchema){let W=$.scopeValue("validate$data",{ref:b.validateSchema});return u._`!${W}(${I})`}return u.nil}}subschema($,I){let U=QQ.getSubschema(this.it,$);QQ.extendSubschemaData(U,this.it,$),QQ.extendSubschemaMode(U,$);let b={...this.it,...U,items:void 0,props:void 0};return FT(b,I),b}mergeEvaluated($,I){let{it:U,gen:b}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=$4.mergeEvaluated.props(b,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.mergeEvaluated.items(b,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:b}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return b.if(I,()=>this.mergeEvaluated($,u.Name)),!0}}QL.KeywordCxt=NQ;function DL($,I,U,b){let w=new NQ($,U,I);if("code"in U)U.code(w,b);else if(w.$data&&U.validate)LU.funcKeywordCode(w,U);else if("macro"in U)LU.macroKeywordCode(w,U);else if(U.compile||U.validate)LU.funcKeywordCode(w,U)}var fT=/^\/(?:[^~]|~0|~1)*$/,yT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function WL($,{dataLevel:I,dataNames:U,dataPathArr:b}){let w,X;if($==="")return i.default.rootData;if($[0]==="/"){if(!fT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);w=$,X=i.default.rootData}else{let G=yT.exec($);if(!G)throw new Error(`Invalid JSON-pointer: ${$}`);let Y=+G[1];if(w=G[2],w==="#"){if(Y>=I)throw new Error(Q("property/index",Y));return b[I-Y]}if(Y>I)throw new Error(Q("data",Y));if(X=U[I-Y],!w)return X}let D=X,W=w.split("/");for(let G of W)if(G)X=u._`${X}${u.getProperty($4.unescapeJsonPointer(G))}`,D=u._`${D} && ${X}`;return D;function Q(G,Y){return`Cannot access ${G} ${Y} levels up, current level is ${I}`}}QL.getData=WL});var Kb=Z((NL)=>{Object.defineProperty(NL,"__esModule",{value:!0});class YL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}NL.default=YL});var vU=Z((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});var JQ=OU();class JL extends Error{constructor($,I,U,b){super(b||`can't resolve reference ${U} from id ${I}`);this.missingRef=JQ.resolveUrl($,I,U),this.missingSchema=JQ.normalizeId(JQ.getFullPath($,this.missingRef))}}BL.default=JL});var Vb=Z((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});OL.resolveSchema=OL.getCompilingSchema=OL.resolveRef=OL.compileSchema=OL.SchemaEnv=void 0;var S6=a(),rT=Kb(),e4=s6(),P6=OU(),HL=W$(),nT=KU();class VU{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:P6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}OL.SchemaEnv=VU;function HQ($){let I=AL.call(this,$);if(I)return I;let U=P6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:b,lines:w}=this.opts.code,{ownProperties:X}=this.opts,D=new S6.CodeGen(this.scope,{es5:b,lines:w,ownProperties:X}),W;if($.$async)W=D.scopeValue("Error",{ref:rT.default,code:S6._`require("ajv/dist/runtime/validation_error").default`});let Q=D.scopeName("validate");$.validateName=Q;let G={gen:D,allErrors:this.opts.allErrors,data:e4.default.data,parentData:e4.default.parentData,parentDataProperty:e4.default.parentDataProperty,dataNames:[e4.default.data],dataPathArr:[S6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:D.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:S6.stringify($.schema)}:{ref:$.schema}),validateName:Q,ValidationError:W,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:S6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:S6._`""`,opts:this.opts,self:this},Y;try{this._compilations.add($),nT.validateFunctionCode(G),D.optimize(this.opts.code.optimize);let J=D.toString();if(Y=`${D.scopeRefs(e4.default.scope)}return ${J}`,this.opts.code.process)Y=this.opts.code.process(Y,$);let B=new Function(`${e4.default.self}`,`${e4.default.scope}`,Y)(this,this.scope.get());if(this.scope.value(Q,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:Q,validateCode:J,scopeValues:D._values};if(this.opts.unevaluated){let{props:A,items:O}=G;if(B.evaluated={props:A instanceof S6.Name?void 0:A,items:O instanceof S6.Name?void 0:O,dynamicProps:A instanceof S6.Name,dynamicItems:O instanceof S6.Name},B.source)B.source.evaluated=S6.stringify(B.evaluated)}return $.validate=B,$}catch(J){if(delete $.validate,delete $.validateName,Y)this.logger.error("Error compiling schema, function code:",Y);throw J}finally{this._compilations.delete($)}}OL.compileSchema=HQ;function iT($,I,U){var b;U=P6.resolveUrl(this.opts.uriResolver,I,U);let w=$.refs[U];if(w)return w;let X=pT.call(this,$,U);if(X===void 0){let D=(b=$.localRefs)===null||b===void 0?void 0:b[U],{schemaId:W}=this.opts;if(D)X=new VU({schema:D,schemaId:W,root:$,baseId:I})}if(X===void 0)return;return $.refs[U]=oT.call(this,X)}OL.resolveRef=iT;function oT($){if(P6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:HQ.call(this,$)}function AL($){for(let I of this._compilations)if(dT(I,$))return I}OL.getCompilingSchema=AL;function dT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function pT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||vb.call(this,$,I)}function vb($,I){let U=this.opts.uriResolver.parse(I),b=P6._getFullPath(this.opts.uriResolver,U),w=P6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&b===w)return BQ.call(this,U,$);let X=P6.normalizeId(b),D=this.refs[X]||this.schemas[X];if(typeof D=="string"){let W=vb.call(this,$,D);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return BQ.call(this,U,W)}if(typeof(D===null||D===void 0?void 0:D.schema)!=="object")return;if(!D.validate)HQ.call(this,D);if(X===P6.normalizeId(I)){let{schema:W}=D,{schemaId:Q}=this.opts,G=W[Q];if(G)w=P6.resolveUrl(this.opts.uriResolver,w,G);return new VU({schema:W,schemaId:Q,root:$,baseId:w})}return BQ.call(this,U,D)}OL.resolveSchema=vb;var tT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function BQ($,{baseId:I,schema:U,root:b}){var w;if(((w=$.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let W of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let Q=U[HL.unescapeFragment(W)];if(Q===void 0)return;U=Q;let G=typeof U==="object"&&U[this.opts.schemaId];if(!tT.has(W)&&G)I=P6.resolveUrl(this.opts.uriResolver,I,G)}let X;if(typeof U!="boolean"&&U.$ref&&!HL.schemaHasRulesButRef(U,this.RULES)){let W=P6.resolveUrl(this.opts.uriResolver,I,U.$ref);X=vb.call(this,b,W)}let{schemaId:D}=this.opts;if(X=X||new VU({schema:U,schemaId:D,root:b,baseId:I}),X.schema!==X.root.schema)return X;return}});var LL=Z((Wo,I_)=>{I_.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var OQ=Z((Qo,qL)=>{var U_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vL=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function AQ($){let I="",U=0,b=0;for(b=0;b<$.length;b++){if(U=$[b].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b];break}for(b+=1;b<$.length;b++){if(U=$[b].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[b]}return I}var w_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function KL($){return $.length=0,!0}function b_($,I,U){if($.length){let b=AQ($);if(b!=="")I.push(b);else return U.error=!0,!1;$.length=0}return!0}function X_($){let I=0,U={error:!1,address:"",zone:""},b=[],w=[],X=!1,D=!1,W=b_;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(G==="["||G==="]")continue;if(G===":"){if(X===!0)D=!0;if(!W(w,b,U))break;if(++I>7){U.error=!0;break}if(Q>0&&$[Q-1]===":")X=!0;b.push(":");continue}else if(G==="%"){if(!W(w,b,U))break;W=KL}else{w.push(G);continue}}if(w.length)if(W===KL)U.zone=w.join("");else if(D)b.push(w.join(""));else b.push(AQ(w));return U.address=b.join(""),U}function VL($){if(D_($,":")<2)return{host:$,isIPV6:!1};let I=X_($);if(!I.error){let{address:U,address:b}=I;if(I.zone)U+="%"+I.zone,b+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:b}}else return{host:$,isIPV6:!1}}function D_($,I){let U=0;for(let b=0;b<$.length;b++)if($[b]===I)U++;return U}function W_($){let I=$,U=[],b=-1,w=0;while(w=I.length){if(w===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(w===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(w===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((b=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,b)),I=I.slice(b)}return U.join("")}function Q_($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function G_($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!vL(U)){let b=VL(U);if(b.isIPV6===!0)U=`[${b.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}qL.exports={nonSimpleDomain:w_,recomposeAuthority:G_,normalizeComponentEncoding:Q_,removeDotSegments:W_,isIPv4:vL,isUUID:U_,normalizeIPv6:VL,stringArrayToHexStripped:AQ}});var SL=Z((Go,EL)=>{var{isUUID:Y_}=OQ(),N_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,J_=["http","https","ws","wss","urn","urn:uuid"];function B_($){return J_.indexOf($)!==-1}function zQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function ML($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function FL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function H_($){return $.secure=zQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function A_($){if($.port===(zQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function O_($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(N_);if(U){let b=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let w=`${b}:${I.nid||$.nid}`,X=LQ(w);if($.path=void 0,X)$=X.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function z_($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",b=$.nid.toLowerCase(),w=`${U}:${I.nid||b}`,X=LQ(w);if(X)$=X.serialize($,I);let D=$,W=$.nss;return D.path=`${b||I.nid}:${W}`,I.skipEscape=!0,D}function L_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!Y_(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function K_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var jL={scheme:"http",domainHost:!0,parse:ML,serialize:FL},v_={scheme:"https",domainHost:jL.domainHost,parse:ML,serialize:FL},qb={scheme:"ws",domainHost:!0,parse:H_,serialize:A_},V_={scheme:"wss",domainHost:qb.domainHost,parse:qb.parse,serialize:qb.serialize},q_={scheme:"urn",parse:O_,serialize:z_,skipNormalize:!0},M_={scheme:"urn:uuid",parse:L_,serialize:K_,skipNormalize:!0},Mb={http:jL,https:v_,ws:qb,wss:V_,urn:q_,"urn:uuid":M_};Object.setPrototypeOf(Mb,null);function LQ($){return $&&(Mb[$]||Mb[$.toLowerCase()])||void 0}EL.exports={wsIsSecure:zQ,SCHEMES:Mb,isValidSchemeName:B_,getSchemeHandler:LQ}});var RL=Z((Yo,jb)=>{var{normalizeIPv6:F_,removeDotSegments:qU,recomposeAuthority:j_,normalizeComponentEncoding:Fb,isIPv4:E_,nonSimpleDomain:S_}=OQ(),{SCHEMES:P_,getSchemeHandler:PL}=SL();function k_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function R_($,I,U){let b=U?Object.assign({scheme:"null"},U):{scheme:"null"},w=kL(I4($,b),I4(I,b),b,!0);return b.skipEscape=!0,f6(w,b)}function kL($,I,U,b){let w={};if(!b)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)w.scheme=I.scheme,w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=qU(I.path||""),w.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)w.userinfo=I.userinfo,w.host=I.host,w.port=I.port,w.path=qU(I.path||""),w.query=I.query;else{if(!I.path)if(w.path=$.path,I.query!==void 0)w.query=I.query;else w.query=$.query;else{if(I.path[0]==="/")w.path=qU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)w.path="/"+I.path;else if(!$.path)w.path=I.path;else w.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;w.path=qU(w.path)}w.query=I.query}w.userinfo=$.userinfo,w.host=$.host,w.port=$.port}w.scheme=$.scheme}return w.fragment=I.fragment,w}function T_($,I,U){if(typeof $==="string")$=unescape($),$=f6(Fb(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(Fb($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(Fb(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(Fb(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function f6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},b=Object.assign({},I),w=[],X=PL(b.scheme||U.scheme);if(X&&X.serialize)X.serialize(U,b);if(U.path!==void 0)if(!b.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(b.reference!=="suffix"&&U.scheme)w.push(U.scheme,":");let D=j_(U);if(D!==void 0){if(b.reference!=="suffix")w.push("//");if(w.push(D),U.path&&U.path[0]!=="/")w.push("/")}if(U.path!==void 0){let W=U.path;if(!b.absolutePath&&(!X||!X.absolutePath))W=qU(W);if(D===void 0&&W[0]==="/"&&W[1]==="/")W="/%2F"+W.slice(2);w.push(W)}if(U.query!==void 0)w.push("?",U.query);if(U.fragment!==void 0)w.push("#",U.fragment);return w.join("")}var __=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},w=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let X=$.match(__);if(X){if(b.scheme=X[1],b.userinfo=X[3],b.host=X[4],b.port=parseInt(X[5],10),b.path=X[6]||"",b.query=X[7],b.fragment=X[8],isNaN(b.port))b.port=X[5];if(b.host)if(E_(b.host)===!1){let Q=F_(b.host);b.host=Q.host.toLowerCase(),w=Q.isIPV6}else w=!0;if(b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path)b.reference="same-document";else if(b.scheme===void 0)b.reference="relative";else if(b.fragment===void 0)b.reference="absolute";else b.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==b.reference)b.error=b.error||"URI is not a "+U.reference+" reference.";let D=PL(U.scheme||b.scheme);if(!U.unicodeSupport&&(!D||!D.unicodeSupport)){if(b.host&&(U.domainHost||D&&D.domainHost)&&w===!1&&S_(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(W){b.error=b.error||"Host's domain name can not be converted to ASCII: "+W}}if(!D||D&&!D.skipNormalize){if($.indexOf("%")!==-1){if(b.scheme!==void 0)b.scheme=unescape(b.scheme);if(b.host!==void 0)b.host=unescape(b.host)}if(b.path)b.path=escape(unescape(b.path));if(b.fragment)b.fragment=encodeURI(decodeURIComponent(b.fragment))}if(D&&D.parse)D.parse(b,U)}else b.error=b.error||"URI can not be parsed.";return b}var KQ={SCHEMES:P_,normalize:k_,resolve:R_,resolveComponent:kL,equal:T_,serialize:f6,parse:I4};jb.exports=KQ;jb.exports.default=KQ;jb.exports.fastUri=KQ});var ZL=Z((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});var TL=RL();TL.code='require("ajv/dist/runtime/uri").default';_L.default=TL});var lL=Z((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var C_=KU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return C_.KeywordCxt}});var C1=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return C1._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return C1.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return C1.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return C1.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return C1.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return C1.CodeGen}});var g_=Kb(),fL=vU(),x_=e8(),MU=Vb(),h_=a(),FU=OU(),Eb=AU(),VQ=W$(),CL=LL(),f_=ZL(),yL=($,I)=>new RegExp($,I);yL.code="new RegExp";var y_=["removeAdditional","useDefaults","coerceTypes"],u_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),l_={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."},c_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gL=200;function m_($){var I,U,b,w,X,D,W,Q,G,Y,J,H,B,A,O,V,q,k,P,h,l,l$,N6,B1,tD;let SI=$.strict,aD=(I=$.code)===null||I===void 0?void 0:I.optimize,_H=aD===!0||aD===void 0?1:aD||0,ZH=(b=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&b!==void 0?b:yL,$j=(w=$.uriResolver)!==null&&w!==void 0?w:f_.default;return{strictSchema:(D=(X=$.strictSchema)!==null&&X!==void 0?X:SI)!==null&&D!==void 0?D:!0,strictNumbers:(Q=(W=$.strictNumbers)!==null&&W!==void 0?W:SI)!==null&&Q!==void 0?Q:!0,strictTypes:(Y=(G=$.strictTypes)!==null&&G!==void 0?G:SI)!==null&&Y!==void 0?Y:"log",strictTuples:(H=(J=$.strictTuples)!==null&&J!==void 0?J:SI)!==null&&H!==void 0?H:"log",strictRequired:(A=(B=$.strictRequired)!==null&&B!==void 0?B:SI)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:_H,regExp:ZH}:{optimize:_H,regExp:ZH},loopRequired:(O=$.loopRequired)!==null&&O!==void 0?O:gL,loopEnum:(V=$.loopEnum)!==null&&V!==void 0?V:gL,meta:(q=$.meta)!==null&&q!==void 0?q:!0,messages:(k=$.messages)!==null&&k!==void 0?k:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(h=$.schemaId)!==null&&h!==void 0?h:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(N6=$.validateFormats)!==null&&N6!==void 0?N6:!0,unicodeRegExp:(B1=$.unicodeRegExp)!==null&&B1!==void 0?B1:!0,int32range:(tD=$.int32range)!==null&&tD!==void 0?tD:!0,uriResolver:$j}}class Sb{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...m_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new h_.ValueScope({scope:{},prefixes:u_,es5:I,lines:U}),this.logger=p_($.logger);let b=$.validateFormats;if($.validateFormats=!1,this.RULES=x_.getRules(),xL.call(this,l_,$,"NOT SUPPORTED"),xL.call(this,c_,$,"DEPRECATED","warn"),this._metaOpts=o_.call(this),$.formats)n_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)i_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);r_.call(this),$.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,b=CL;if(U==="id")b={...CL},b.id=b.$id,delete b.$id;if(I&&$)this.addMetaSchema(b,b[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let b=U(I);if(!("$async"in U))this.errors=U.errors;return b}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return b.call(this,$,I);async function b(G,Y){await w.call(this,G.$schema);let J=this._addSchema(G,Y);return J.validate||X.call(this,J)}async function w(G){if(G&&!this.getSchema(G))await b.call(this,{$ref:G},!0)}async function X(G){try{return this._compileSchemaEnv(G)}catch(Y){if(!(Y instanceof fL.default))throw Y;return D.call(this,Y),await W.call(this,Y.missingSchema),X.call(this,G)}}function D({missingSchema:G,missingRef:Y}){if(this.refs[G])throw new Error(`AnySchema ${G} is loaded but ${Y} cannot be resolved`)}async function W(G){let Y=await Q.call(this,G);if(!this.refs[G])await w.call(this,Y.$schema);if(!this.refs[G])this.addSchema(Y,G,I)}async function Q(G){let Y=this._loading[G];if(Y)return Y;try{return await(this._loading[G]=U(G))}finally{delete this._loading[G]}}}addSchema($,I,U,b=this.opts.validateSchema){if(Array.isArray($)){for(let X of $)this.addSchema(X,void 0,U,b);return this}let w;if(typeof $==="object"){let{schemaId:X}=this.opts;if(w=$[X],w!==void 0&&typeof w!="string")throw new Error(`schema ${X} must be string`)}return I=FU.normalizeId(I||w),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,b,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let b=this.validate(U,$);if(!b&&I){let w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return b}getSchema($){let I;while(typeof(I=hL.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,b=new MU.SchemaEnv({schema:{},schemaId:U});if(I=MU.resolveSchema.call(this,b,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=hL.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=FU.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(a_.call(this,U,I),!I)return VQ.eachItem(U,(w)=>vQ.call(this,w)),this;s_.call(this,I);let b={...I,type:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)};return VQ.eachItem(U,b.type.length===0?(w)=>vQ.call(this,w,b):(w)=>b.type.forEach((X)=>vQ.call(this,w,b,X))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let b=U.rules.findIndex((w)=>w.keyword===$);if(b>=0)U.rules.splice(b,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((b)=>`${U}${b.instancePath} ${b.message}`).reduce((b,w)=>b+I+w)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let b of I){let w=b.split("/").slice(1),X=$;for(let D of w)X=X[D];for(let D in U){let W=U[D];if(typeof W!="object")continue;let{$data:Q}=W.definition,G=X[D];if(Q&&G)X[D]=uL(G)}}return $}_removeAllSchemas($,I){for(let U in $){let b=$[U];if(!I||I.test(U)){if(typeof b=="string")delete $[U];else if(b&&!b.meta)this._cache.delete(b.schema),delete $[U]}}}_addSchema($,I,U,b=this.opts.validateSchema,w=this.opts.addUsedSchema){let X,{schemaId:D}=this.opts;if(typeof $=="object")X=$[D];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let W=this._cache.get($);if(W!==void 0)return W;U=FU.normalizeId(X||U);let Q=FU.getSchemaRefs.call(this,$,U);if(W=new MU.SchemaEnv({schema:$,schemaId:D,meta:I,baseId:U,localRefs:Q}),this._cache.set(W.schema,W),w&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=W}if(b)this.validateSchema($,!0);return W}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else MU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{MU.compileSchema.call(this,$)}finally{this.opts=I}}}Sb.ValidationError=g_.default;Sb.MissingRefError=fL.default;U4.default=Sb;function xL($,I,U,b="error"){for(let w in $){let X=w;if(X in I)this.logger[b](`${U}: option ${w}. ${$[X]}`)}}function hL($){return $=FU.normalizeId($),this.schemas[$]||this.refs[$]}function r_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function n_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function i_($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function o_(){let $={...this.opts};for(let I of y_)delete $[I];return $}var d_={log(){},warn(){},error(){}};function p_($){if($===!1)return d_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var t_=/^[a-z_$][a-z0-9_$:-]*$/i;function a_($,I){let{RULES:U}=this;if(VQ.eachItem($,(b)=>{if(U.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!t_.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function vQ($,I,U){var b;let w=I===null||I===void 0?void 0:I.post;if(U&&w)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,D=w?X.post:X.rules.find(({type:Q})=>Q===U);if(!D)D={type:U,rules:[]},X.rules.push(D);if(X.keywords[$]=!0,!I)return;let W={keyword:$,definition:{...I,type:Eb.getJSONTypes(I.type),schemaType:Eb.getJSONTypes(I.schemaType)}};if(I.before)e_.call(this,D,W,I.before);else D.rules.push(W);X.all[$]=W,(b=I.implements)===null||b===void 0||b.forEach((Q)=>this.addKeyword(Q))}function e_($,I,U){let b=$.rules.findIndex((w)=>w.keyword===U);if(b>=0)$.rules.splice(b,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function s_($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=uL(I);$.validateSchema=this.compile(I,!0)}var $Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function uL($){return{anyOf:[$,$Z]}}});var mL=Z((cL)=>{Object.defineProperty(cL,"__esModule",{value:!0});var wZ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cL.default=wZ});var pL=Z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});oL.callRef=oL.getValidate=void 0;var XZ=vU(),rL=O6(),$6=a(),g1=s6(),nL=Vb(),Pb=W$(),DZ={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:b}=$,{baseId:w,schemaEnv:X,validateName:D,opts:W,self:Q}=b,{root:G}=X;if((U==="#"||U==="#/")&&w===G.baseId)return J();let Y=nL.resolveRef.call(Q,G,w,U);if(Y===void 0)throw new XZ.default(b.opts.uriResolver,w,U);if(Y instanceof nL.SchemaEnv)return H(Y);return B(Y);function J(){if(X===G)return kb($,D,X,X.$async);let A=I.scopeValue("root",{ref:G});return kb($,$6._`${A}.validate`,G,G.$async)}function H(A){let O=iL($,A);kb($,O,A,A.$async)}function B(A){let O=I.scopeValue("schema",W.code.source===!0?{ref:A,code:$6.stringify(A)}:{ref:A}),V=I.name("valid"),q=$.subschema({schema:A,dataTypes:[],schemaPath:$6.nil,topSchemaRef:O,errSchemaPath:U},V);$.mergeEvaluated(q),$.ok(V)}}};function iL($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}oL.getValidate=iL;function kb($,I,U,b){let{gen:w,it:X}=$,{allErrors:D,schemaEnv:W,opts:Q}=X,G=Q.passContext?g1.default.this:$6.nil;if(b)Y();else J();function Y(){if(!W.$async)throw new Error("async schema referenced by sync schema");let A=w.let("valid");w.try(()=>{if(w.code($6._`await ${rL.callValidateCode($,I,G)}`),B(I),!D)w.assign(A,!0)},(O)=>{if(w.if($6._`!(${O} instanceof ${X.ValidationError})`,()=>w.throw(O)),H(O),!D)w.assign(A,!1)}),$.ok(A)}function J(){$.result(rL.callValidateCode($,I,G),()=>B(I),()=>H(I))}function H(A){let O=$6._`${A}.errors`;w.assign(g1.default.vErrors,$6._`${g1.default.vErrors} === null ? ${O} : ${g1.default.vErrors}.concat(${O})`),w.assign(g1.default.errors,$6._`${g1.default.vErrors}.length`)}function B(A){var O;if(!X.opts.unevaluated)return;let V=(O=U===null||U===void 0?void 0:U.validate)===null||O===void 0?void 0:O.evaluated;if(X.props!==!0)if(V&&!V.dynamicProps){if(V.props!==void 0)X.props=Pb.mergeEvaluated.props(w,V.props,X.props)}else{let q=w.var("props",$6._`${A}.evaluated.props`);X.props=Pb.mergeEvaluated.props(w,q,X.props,$6.Name)}if(X.items!==!0)if(V&&!V.dynamicItems){if(V.items!==void 0)X.items=Pb.mergeEvaluated.items(w,V.items,X.items)}else{let q=w.var("items",$6._`${A}.evaluated.items`);X.items=Pb.mergeEvaluated.items(w,q,X.items,$6.Name)}}}oL.callRef=kb;oL.default=DZ});var aL=Z((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});var GZ=mL(),YZ=pL(),NZ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",GZ.default,YZ.default];tL.default=NZ});var sL=Z((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});var Rb=a(),q4=Rb.operators,Tb={maximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},minimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},exclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},exclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},BZ={message:({keyword:$,schemaCode:I})=>Rb.str`must be ${Tb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>Rb._`{comparison: ${Tb[$].okStr}, limit: ${I}}`},HZ={keyword:Object.keys(Tb),type:"number",schemaType:"number",$data:!0,error:BZ,code($){let{keyword:I,data:U,schemaCode:b}=$;$.fail$data(Rb._`${U} ${Tb[I].fail} ${b} || isNaN(${U})`)}};eL.default=HZ});var IK=Z(($K)=>{Object.defineProperty($K,"__esModule",{value:!0});var jU=a(),OZ={message:({schemaCode:$})=>jU.str`must be multiple of ${$}`,params:({schemaCode:$})=>jU._`{multipleOf: ${$}}`},zZ={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:OZ,code($){let{gen:I,data:U,schemaCode:b,it:w}=$,X=w.opts.multipleOfPrecision,D=I.let("res"),W=X?jU._`Math.abs(Math.round(${D}) - ${D}) > 1e-${X}`:jU._`${D} !== parseInt(${D})`;$.fail$data(jU._`(${b} === 0 || (${D} = ${U}/${b}, ${W}))`)}};$K.default=zZ});var bK=Z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});function UK($){let I=$.length,U=0,b=0,w;while(b<I)if(U++,w=$.charCodeAt(b++),w>=55296&&w<=56319&&b<I){if(w=$.charCodeAt(b),(w&64512)===56320)b++}return U}wK.default=UK;UK.code='require("ajv/dist/runtime/ucs2length").default'});var DK=Z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var s4=a(),vZ=W$(),VZ=bK(),qZ={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return s4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>s4._`{limit: ${$}}`},MZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qZ,code($){let{keyword:I,data:U,schemaCode:b,it:w}=$,X=I==="maxLength"?s4.operators.GT:s4.operators.LT,D=w.opts.unicode===!1?s4._`${U}.length`:s4._`${vZ.useFunc($.gen,VZ.default)}(${U})`;$.fail$data(s4._`${D} ${X} ${b}`)}};XK.default=MZ});var QK=Z((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});var jZ=O6(),_b=a(),EZ={message:({schemaCode:$})=>_b.str`must match pattern "${$}"`,params:({schemaCode:$})=>_b._`{pattern: ${$}}`},SZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:EZ,code($){let{data:I,$data:U,schema:b,schemaCode:w,it:X}=$,D=X.opts.unicodeRegExp?"u":"",W=U?_b._`(new RegExp(${w}, ${D}))`:jZ.usePattern($,b);$.fail$data(_b._`!${W}.test(${I})`)}};WK.default=SZ});var YK=Z((GK)=>{Object.defineProperty(GK,"__esModule",{value:!0});var EU=a(),kZ={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return EU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>EU._`{limit: ${$}}`},RZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxProperties"?EU.operators.GT:EU.operators.LT;$.fail$data(EU._`Object.keys(${U}).length ${w} ${b}`)}};GK.default=RZ});var JK=Z((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});var SU=O6(),PU=a(),_Z=W$(),ZZ={message:({params:{missingProperty:$}})=>PU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>PU._`{missingProperty: ${$}}`},CZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ZZ,code($){let{gen:I,schema:U,schemaCode:b,data:w,$data:X,it:D}=$,{opts:W}=D;if(!X&&U.length===0)return;let Q=U.length>=W.loopRequired;if(D.allErrors)G();else Y();if(W.strictRequired){let B=$.parentSchema.properties,{definedProperties:A}=$.it;for(let O of U)if((B===null||B===void 0?void 0:B[O])===void 0&&!A.has(O)){let V=D.schemaEnv.baseId+D.errSchemaPath,q=`required property "${O}" is not defined at "${V}" (strictRequired)`;_Z.checkStrictMode(D,q,D.opts.strictRequired)}}function G(){if(Q||X)$.block$data(PU.nil,J);else for(let B of U)SU.checkReportMissingProp($,B)}function Y(){let B=I.let("missing");if(Q||X){let A=I.let("valid",!0);$.block$data(A,()=>H(B,A)),$.ok(A)}else I.if(SU.checkMissingProp($,U,B)),SU.reportMissingProp($,B),I.else()}function J(){I.forOf("prop",b,(B)=>{$.setParams({missingProperty:B}),I.if(SU.noPropertyInData(I,w,B,W.ownProperties),()=>$.error())})}function H(B,A){$.setParams({missingProperty:B}),I.forOf(B,b,()=>{I.assign(A,SU.propertyInData(I,w,B,W.ownProperties)),I.if(PU.not(A),()=>{$.error(),I.break()})},PU.nil)}}};NK.default=CZ});var HK=Z((BK)=>{Object.defineProperty(BK,"__esModule",{value:!0});var kU=a(),xZ={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return kU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>kU._`{limit: ${$}}`},hZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:xZ,code($){let{keyword:I,data:U,schemaCode:b}=$,w=I==="maxItems"?kU.operators.GT:kU.operators.LT;$.fail$data(kU._`${U}.length ${w} ${b}`)}};BK.default=hZ});var Zb=Z((OK)=>{Object.defineProperty(OK,"__esModule",{value:!0});var AK=DQ();AK.code='require("ajv/dist/runtime/equal").default';OK.default=AK});var LK=Z((zK)=>{Object.defineProperty(zK,"__esModule",{value:!0});var qQ=AU(),h$=a(),uZ=W$(),lZ=Zb(),cZ={message:({params:{i:$,j:I}})=>h$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>h$._`{i: ${$}, j: ${I}}`},mZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cZ,code($){let{gen:I,data:U,$data:b,schema:w,parentSchema:X,schemaCode:D,it:W}=$;if(!b&&!w)return;let Q=I.let("valid"),G=X.items?qQ.getSchemaTypes(X.items):[];$.block$data(Q,Y,h$._`${D} === false`),$.ok(Q);function Y(){let A=I.let("i",h$._`${U}.length`),O=I.let("j");$.setParams({i:A,j:O}),I.assign(Q,!0),I.if(h$._`${A} > 1`,()=>(J()?H:B)(A,O))}function J(){return G.length>0&&!G.some((A)=>A==="object"||A==="array")}function H(A,O){let V=I.name("item"),q=qQ.checkDataTypes(G,V,W.opts.strictNumbers,qQ.DataType.Wrong),k=I.const("indices",h$._`{}`);I.for(h$._`;${A}--;`,()=>{if(I.let(V,h$._`${U}[${A}]`),I.if(q,h$._`continue`),G.length>1)I.if(h$._`typeof ${V} == "string"`,h$._`${V} += "_"`);I.if(h$._`typeof ${k}[${V}] == "number"`,()=>{I.assign(O,h$._`${k}[${V}]`),$.error(),I.assign(Q,!1).break()}).code(h$._`${k}[${V}] = ${A}`)})}function B(A,O){let V=uZ.useFunc(I,lZ.default),q=I.name("outer");I.label(q).for(h$._`;${A}--;`,()=>I.for(h$._`${O} = ${A}; ${O}--;`,()=>I.if(h$._`${V}(${U}[${A}], ${U}[${O}])`,()=>{$.error(),I.assign(Q,!1).break(q)})))}}};zK.default=mZ});var vK=Z((KK)=>{Object.defineProperty(KK,"__esModule",{value:!0});var MQ=a(),nZ=W$(),iZ=Zb(),oZ={message:"must be equal to constant",params:({schemaCode:$})=>MQ._`{allowedValue: ${$}}`},dZ={keyword:"const",$data:!0,error:oZ,code($){let{gen:I,data:U,$data:b,schemaCode:w,schema:X}=$;if(b||X&&typeof X=="object")$.fail$data(MQ._`!${nZ.useFunc(I,iZ.default)}(${U}, ${w})`);else $.fail(MQ._`${X} !== ${U}`)}};KK.default=dZ});var qK=Z((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var RU=a(),tZ=W$(),aZ=Zb(),eZ={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>RU._`{allowedValues: ${$}}`},sZ={keyword:"enum",schemaType:"array",$data:!0,error:eZ,code($){let{gen:I,data:U,$data:b,schema:w,schemaCode:X,it:D}=$;if(!b&&w.length===0)throw new Error("enum must have non-empty array");let W=w.length>=D.opts.loopEnum,Q,G=()=>Q!==null&&Q!==void 0?Q:Q=tZ.useFunc(I,aZ.default),Y;if(W||b)Y=I.let("valid"),$.block$data(Y,J);else{if(!Array.isArray(w))throw new Error("ajv implementation error");let B=I.const("vSchema",X);Y=RU.or(...w.map((A,O)=>H(B,O)))}$.pass(Y);function J(){I.assign(Y,!1),I.forOf("v",X,(B)=>I.if(RU._`${G()}(${U}, ${B})`,()=>I.assign(Y,!0).break()))}function H(B,A){let O=w[A];return typeof O==="object"&&O!==null?RU._`${G()}(${U}, ${B}[${A}])`:RU._`${U} === ${O}`}}};VK.default=sZ});var FK=Z((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var IC=sL(),UC=IK(),wC=DK(),bC=QK(),XC=YK(),DC=JK(),WC=HK(),QC=LK(),GC=vK(),YC=qK(),NC=[IC.default,UC.default,wC.default,bC.default,XC.default,DC.default,WC.default,QC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},GC.default,YC.default];MK.default=NC});var jQ=Z((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});EK.validateAdditionalItems=void 0;var $1=a(),FQ=W$(),BC={message:({params:{len:$}})=>$1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>$1._`{limit: ${$}}`},HC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:BC,code($){let{parentSchema:I,it:U}=$,{items:b}=I;if(!Array.isArray(b)){FQ.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}jK($,b)}};function jK($,I){let{gen:U,schema:b,data:w,keyword:X,it:D}=$;D.items=!0;let W=U.const("len",$1._`${w}.length`);if(b===!1)$.setParams({len:I.length}),$.pass($1._`${W} <= ${I.length}`);else if(typeof b=="object"&&!FQ.alwaysValidSchema(D,b)){let G=U.var("valid",$1._`${W} <= ${I.length}`);U.if($1.not(G),()=>Q(G)),$.ok(G)}function Q(G){U.forRange("i",I.length,W,(Y)=>{if($.subschema({keyword:X,dataProp:Y,dataPropType:FQ.Type.Num},G),!D.allErrors)U.if($1.not(G),()=>U.break())})}}EK.validateAdditionalItems=jK;EK.default=HC});var EQ=Z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});RK.validateTuple=void 0;var PK=a(),Cb=W$(),OC=O6(),zC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return kK($,"additionalItems",I);if(U.items=!0,Cb.alwaysValidSchema(U,I))return;$.ok(OC.validateArray($))}};function kK($,I,U=$.schema){let{gen:b,parentSchema:w,data:X,keyword:D,it:W}=$;if(Y(w),W.opts.unevaluated&&U.length&&W.items!==!0)W.items=Cb.mergeEvaluated.items(b,U.length,W.items);let Q=b.name("valid"),G=b.const("len",PK._`${X}.length`);U.forEach((J,H)=>{if(Cb.alwaysValidSchema(W,J))return;b.if(PK._`${G} > ${H}`,()=>$.subschema({keyword:D,schemaProp:H,dataProp:H},Q)),$.ok(Q)});function Y(J){let{opts:H,errSchemaPath:B}=W,A=U.length,O=A===J.minItems&&(A===J.maxItems||J[I]===!1);if(H.strictTuples&&!O){let V=`"${D}" is ${A}-tuple, but minItems or maxItems/${I} are not specified or different at path "${B}"`;Cb.checkStrictMode(W,V,H.strictTuples)}}}RK.validateTuple=kK;RK.default=zC});var ZK=Z((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var KC=EQ(),vC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>KC.validateTuple($,"items")};_K.default=vC});var xK=Z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});var CK=a(),qC=W$(),MC=O6(),FC=jQ(),jC={message:({params:{len:$}})=>CK.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>CK._`{limit: ${$}}`},EC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jC,code($){let{schema:I,parentSchema:U,it:b}=$,{prefixItems:w}=U;if(b.items=!0,qC.alwaysValidSchema(b,I))return;if(w)FC.validateAdditionalItems($,w);else $.ok(MC.validateArray($))}};gK.default=EC});var fK=Z((hK)=>{Object.defineProperty(hK,"__esModule",{value:!0});var z6=a(),gb=W$(),PC={message:({params:{min:$,max:I}})=>I===void 0?z6.str`must contain at least ${$} valid item(s)`:z6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?z6._`{minContains: ${$}}`:z6._`{minContains: ${$}, maxContains: ${I}}`},kC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PC,code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$,D,W,{minContains:Q,maxContains:G}=b;if(X.opts.next)D=Q===void 0?1:Q,W=G;else D=1;let Y=I.const("len",z6._`${w}.length`);if($.setParams({min:D,max:W}),W===void 0&&D===0){gb.checkStrictMode(X,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&D>W){gb.checkStrictMode(X,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(gb.alwaysValidSchema(X,U)){let O=z6._`${Y} >= ${D}`;if(W!==void 0)O=z6._`${O} && ${Y} <= ${W}`;$.pass(O);return}X.items=!0;let J=I.name("valid");if(W===void 0&&D===1)B(J,()=>I.if(J,()=>I.break()));else if(D===0){if(I.let(J,!0),W!==void 0)I.if(z6._`${w}.length > 0`,H)}else I.let(J,!1),H();$.result(J,()=>$.reset());function H(){let O=I.name("_valid"),V=I.let("count",0);B(O,()=>I.if(O,()=>A(V)))}function B(O,V){I.forRange("i",0,Y,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:gb.Type.Num,compositeRule:!0},O),V()})}function A(O){if(I.code(z6._`${O}++`),W===void 0)I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0).break());else if(I.if(z6._`${O} > ${W}`,()=>I.assign(J,!1).break()),D===1)I.assign(J,!0);else I.if(z6._`${O} >= ${D}`,()=>I.assign(J,!0))}}};hK.default=kC});var rK=Z((lK)=>{Object.defineProperty(lK,"__esModule",{value:!0});lK.validateSchemaDeps=lK.validatePropertyDeps=lK.error=void 0;var SQ=a(),TC=W$(),TU=O6();lK.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let b=I===1?"property":"properties";return SQ.str`must have ${b} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:b}})=>SQ._`{property: ${$},
7
7
  missingProperty: ${b},
8
8
  depsCount: ${I},
9
- deps: ${U}}`};var HC={keyword:"dependencies",type:"object",schemaType:"object",error:jK.error,code($){let[I,U]=AC($);FK($,I),MK($,U)}};function AC({schema:$}){let I={},U={};for(let b in $){if(b==="__proto__")continue;let w=Array.isArray($[b])?I:U;w[b]=$[b]}return[I,U]}function FK($,I=$.schema){let{gen:U,data:b,it:w}=$;if(Object.keys(I).length===0)return;let X=U.let("missing");for(let D in I){let W=I[D];if(W.length===0)continue;let Q=kU.propertyInData(U,b,D,w.opts.ownProperties);if($.setParams({property:D,depsCount:W.length,deps:W.join(", ")}),w.allErrors)U.if(Q,()=>{for(let G of W)kU.checkReportMissingProp($,G)});else U.if(zQ._`${Q} && (${kU.checkMissingProp($,W,X)})`),kU.reportMissingProp($,X),U.else()}}jK.validatePropertyDeps=FK;function MK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(JC.alwaysValidSchema(X,I[W]))continue;U.if(kU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}jK.validateSchemaDeps=MK;jK.default=HC});var TK=Z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});var kK=a(),LC=W$(),KC={message:"property name must be valid",params:({params:$})=>kK._`{propertyName: ${$.propertyName}}`},vC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(LC.alwaysValidSchema(w,U))return;let X=I.name("valid");I.forIn("key",b,(D)=>{$.setParams({propertyName:D}),$.subschema({keyword:"propertyNames",data:D,dataTypes:["string"],propertyName:D,compositeRule:!0},X),I.if(kK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};RK.default=vC});var LQ=Z((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var Rb=O6(),k6=a(),qC=s6(),Tb=W$(),FC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},MC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FC,code($){let{gen:I,schema:U,parentSchema:b,data:w,errsCount:X,it:D}=$;if(!X)throw new Error("ajv implementation error");let{allErrors:W,opts:Q}=D;if(D.props=!0,Q.removeAdditional!=="all"&&Tb.alwaysValidSchema(D,U))return;let G=Rb.allSchemaProperties(b.properties),N=Rb.allSchemaProperties(b.patternProperties);B(),$.ok(k6._`${X} === ${qC.default.errors}`);function B(){I.forIn("key",w,(V)=>{if(!G.length&&!N.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=Tb.schemaRefOrVal(D,b.properties,"properties");q=Rb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(N.length)q=k6.or(q,...N.map((k)=>k6._`${Rb.usePattern($,k)}.test(${V})`));return k6.not(q)}function J(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){J(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!Tb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),J(V)});else if(O(V,q),!W)I.if(k6.not(q),()=>I.break())}}function O(V,q,k){let P={keyword:"additionalProperties",dataProp:V,dataPropType:Tb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};_K.default=MC});var xK=Z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});var EC=zU(),ZK=O6(),KQ=W$(),CK=LQ(),SC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$;if(X.opts.removeAdditional==="all"&&b.additionalProperties===void 0)CK.default.code(new EC.KeywordCxt(X,CK.default,"additionalProperties"));let D=ZK.allSchemaProperties(U);for(let B of D)X.definedProperties.add(B);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=KQ.mergeEvaluated.props(I,KQ.toHash(D),X.props);let W=D.filter((B)=>!KQ.alwaysValidSchema(X,U[B]));if(W.length===0)return;let Q=I.name("valid");for(let B of W){if(G(B))N(B);else{if(I.if(ZK.propertyInData(I,w,B,X.opts.ownProperties)),N(B),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(B),$.ok(Q)}function G(B){return X.opts.useDefaults&&!X.compositeRule&&U[B].default!==void 0}function N(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},Q)}}};gK.default=SC});var lK=Z((uK)=>{Object.defineProperty(uK,"__esModule",{value:!0});var hK=O6(),_b=a(),fK=W$(),yK=W$(),kC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=hK.allSchemaProperties(U),Q=W.filter((O)=>fK.alwaysValidSchema(X,U[O]));if(W.length===0||Q.length===W.length&&(!X.opts.unevaluated||X.props===!0))return;let G=D.strictSchema&&!D.allowMatchingProperties&&w.properties,N=I.name("valid");if(X.props!==!0&&!(X.props instanceof _b.Name))X.props=yK.evaluatedPropsToName(I,X.props);let{props:B}=X;H();function H(){for(let O of W){if(G)J(O);if(X.allErrors)A(O);else I.var(N,!0),A(O),I.if(N)}}function J(O){for(let V in G)if(new RegExp(O).test(V))fK.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(_b._`${hK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:yK.Type.Str},N);if(X.opts.unevaluated&&B!==!0)I.assign(_b._`${B}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(_b.not(N),()=>I.break())})})}}};uK.default=kC});var mK=Z((cK)=>{Object.defineProperty(cK,"__esModule",{value:!0});var TC=W$(),_C={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(TC.alwaysValidSchema(b,U)){$.fail();return}let w=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},w),$.failResult(w,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};cK.default=_C});var nK=Z((rK)=>{Object.defineProperty(rK,"__esModule",{value:!0});var CC=O6(),gC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:CC.validateUnion,error:{message:"must match a schema in anyOf"}};rK.default=gC});var oK=Z((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var Zb=a(),hC=W$(),fC={message:"must match exactly one schema in oneOf",params:({params:$})=>Zb._`{passingSchemas: ${$.passing}}`},yC={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:fC,code($){let{gen:I,schema:U,parentSchema:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(w.opts.discriminator&&b.discriminator)return;let X=U,D=I.let("valid",!1),W=I.let("passing",null),Q=I.name("_valid");$.setParams({passing:W}),I.block(G),$.result(D,()=>$.reset(),()=>$.error(!0));function G(){X.forEach((N,B)=>{let H;if(hC.alwaysValidSchema(w,N))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},Q);if(B>0)I.if(Zb._`${Q} && ${D}`).assign(D,!1).assign(W,Zb._`[${W}, ${B}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,B),H)$.mergeEvaluated(H,Zb.Name)})})}}};iK.default=yC});var pK=Z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var lC=W$(),cC={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let w=I.name("valid");U.forEach((X,D)=>{if(lC.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};dK.default=cC});var sK=Z((eK)=>{Object.defineProperty(eK,"__esModule",{value:!0});var Cb=a(),aK=W$(),rC={message:({params:$})=>Cb.str`must match "${$.ifClause}" schema`,params:({params:$})=>Cb._`{failingKeyword: ${$.ifClause}}`},nC={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rC,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)aK.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=tK(b,"then"),X=tK(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let N=I.let("ifClause");$.setParams({ifClause:N}),I.if(W,G("then",N),G("else",N))}else if(w)I.if(W,G("then"));else I.if(Cb.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let N=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(N)}function G(N,B){return()=>{let H=$.subschema({keyword:N},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),B)I.assign(B,Cb._`${N}`);else $.setParams({ifClause:N})}}}};function tK($,I){let U=$.schema[I];return U!==void 0&&!aK.alwaysValidSchema($,U)}eK.default=nC});var Iv=Z(($v)=>{Object.defineProperty($v,"__esModule",{value:!0});var oC=W$(),dC={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)oC.checkStrictMode(U,`"${$}" without "if" is ignored`)}};$v.default=dC});var wv=Z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var tC=AQ(),aC=zK(),eC=OQ(),sC=vK(),$g=qK(),Ig=PK(),Ug=TK(),wg=LQ(),bg=xK(),Xg=lK(),Dg=mK(),Wg=nK(),Qg=oK(),Gg=pK(),Ng=sK(),Yg=Iv();function Bg($=!1){let I=[Dg.default,Wg.default,Qg.default,Gg.default,Ng.default,Yg.default,Ug.default,wg.default,Ig.default,bg.default,Xg.default];if($)I.push(aC.default,sC.default);else I.push(tC.default,eC.default);return I.push($g.default),I}Uv.default=Bg});var Xv=Z((bv)=>{Object.defineProperty(bv,"__esModule",{value:!0});var S$=a(),Hg={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},Ag={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Hg,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:N,self:B}=W;if(!Q.validateFormats)return;if(w)H();else J();function H(){let A=U.scopeValue("formats",{ref:B.formats,code:Q.code.formats}),O=U.const("fDef",S$._`${A}[${D}]`),V=U.let("fType"),q=U.let("format");U.if(S$._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>U.assign(V,S$._`${O}.type || "string"`).assign(q,S$._`${O}.validate`),()=>U.assign(V,S$._`"string"`).assign(q,O)),$.fail$data(S$.or(k(),P()));function k(){if(Q.strictSchema===!1)return S$.nil;return S$._`${D} && !${q}`}function P(){let x=N.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${x} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function J(){let A=B.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(x());function k(){if(Q.strictSchema===!1){B.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${X}" ignored in schema at path "${G}"`}}function P(l){let l$=l instanceof RegExp?S$.regexpCode(l):Q.code.formats?S$._`${Q.code.formats}${S$.getProperty(X)}`:void 0,Y6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${Y6}.validate`];return["string",l,Y6]}function x(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!N.$async)throw new Error("async format in sync schema");return S$._`await ${q}(${b})`}return typeof V=="function"?S$._`${q}(${b})`:S$._`${q}.test(${b})`}}}};bv.default=Ag});var Wv=Z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var zg=Xv(),Lg=[zg.default];Dv.default=Lg});var Nv=Z((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});Qv.contentVocabulary=Qv.metadataVocabulary=void 0;Qv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Qv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Jv=Z((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});var Vg=gL(),qg=QK(),Fg=wv(),Mg=Wv(),Yv=Nv(),jg=[Vg.default,qg.default,Fg.default(),Mg.default,Yv.metadataVocabulary,Yv.contentVocabulary];Bv.default=jg});var zv=Z((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});Av.DiscrError=void 0;var Hv;(function($){$.Tag="tag",$.Mapping="mapping"})(Hv||(Av.DiscrError=Hv={}))});var vv=Z((Kv)=>{Object.defineProperty(Kv,"__esModule",{value:!0});var g1=a(),vQ=zv(),Lv=Ab(),Sg=LU(),Pg=W$(),kg={message:({params:{discrError:$,tagName:I}})=>$===vQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>g1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},Rg={keyword:"discriminator",type:"object",schemaType:"object",error:kg,code($){let{gen:I,data:U,schema:b,parentSchema:w,it:X}=$,{oneOf:D}=w;if(!X.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=b.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!D)throw new Error("discriminator: requires oneOf keyword");let Q=I.let("valid",!1),G=I.const("tag",g1._`${U}${g1.getProperty(W)}`);I.if(g1._`typeof ${G} == "string"`,()=>N(),()=>$.error(!1,{discrError:vQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function N(){let J=H();I.if(!1);for(let A in J)I.elseIf(g1._`${G} === ${A}`),I.assign(Q,B(J[A]));I.else(),$.error(!1,{discrError:vQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function B(J){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:J},A);return $.mergeEvaluated(O,g1.Name),A}function H(){var J;let A={},O=q(w),V=!0;for(let x=0;x<D.length;x++){let l=D[x];if((l===null||l===void 0?void 0:l.$ref)&&!Pg.schemaHasRulesButRef(l,X.self.RULES)){let Y6=l.$ref;if(l=Lv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,Y6),l instanceof Lv.SchemaEnv)l=l.schema;if(l===void 0)throw new Sg.default(X.opts.uriResolver,X.baseId,Y6)}let l$=(J=l===null||l===void 0?void 0:l.properties)===null||J===void 0?void 0:J[W];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);V=V&&(O||q(l)),k(l$,x)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:x}){return Array.isArray(x)&&x.includes(W)}function k(x,l){if(x.const)P(x.const,l);else if(x.enum)for(let l$ of x.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(x,l){if(typeof x!="string"||x in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[x]=l}}}};Kv.default=Rg});var Vv=Z((fo,_g)=>{_g.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var qQ=Z((I6,VQ)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.MissingRefError=I6.ValidationError=I6.CodeGen=I6.Name=I6.nil=I6.stringify=I6.str=I6._=I6.KeywordCxt=I6.Ajv=void 0;var Zg=jL(),Cg=Jv(),gg=vv(),qv=Vv(),xg=["/properties"],gb="http://json-schema.org/draft-07/schema";class RU extends Zg.default{_addVocabularies(){if(super._addVocabularies(),Cg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(gg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(qv,xg):qv;this.addMetaSchema($,gb,!1),this.refs["http://json-schema.org/schema"]=gb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gb)?gb:void 0)}}I6.Ajv=RU;VQ.exports=I6=RU;VQ.exports.Ajv=RU;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=RU;var hg=zU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return hg.KeywordCxt}});var x1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return x1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return x1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return x1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return x1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return x1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return x1.CodeGen}});var fg=Jb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return fg.default}});var yg=LU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return yg.default}})});var _v=Z((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv.formatNames=Rv.fastFormats=Rv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}Rv.fullFormats={date:y6(Ev,EQ),time:y6(MQ(!0),SQ),"date-time":y6(Fv(!0),Pv),"iso-time":y6(MQ(),Sv),"iso-date-time":y6(Fv(),kv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:og,"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:$x,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:dg,int32:{type:"number",validate:ag},int64:{type:"number",validate:eg},float:{type:"number",validate:jv},double:{type:"number",validate:jv},password:!0,binary:!0};Rv.fastFormats={...Rv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,EQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,SQ),"date-time":y6(/^\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,Pv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Sv),"iso-date-time":y6(/^\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,kv),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};Rv.formatNames=Object.keys(Rv.fullFormats);function cg($){return $%4===0&&($%100!==0||$%400===0)}var mg=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rg=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ev($){let I=mg.exec($);if(!I)return!1;let U=+I[1],b=+I[2],w=+I[3];return b>=1&&b<=12&&w>=1&&w<=(b===2&&cg(U)?29:rg[b])}function EQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var FQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function MQ($){return function I(U){let b=FQ.exec(U);if(!b)return!1;let w=+b[1],X=+b[2],D=+b[3],W=b[4],Q=b[5]==="-"?-1:1,G=+(b[6]||0),N=+(b[7]||0);if(G>23||N>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let B=X-N*Q,H=w-G*Q-(B<0?1:0);return(H===23||H===-1)&&(B===59||B===-1)&&D<61}}function SQ($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),b=new Date("2020-01-01T"+I).valueOf();if(!(U&&b))return;return U-b}function Sv($,I){if(!($&&I))return;let U=FQ.exec($),b=FQ.exec(I);if(!(U&&b))return;if($=U[1]+U[2]+U[3],I=b[1]+b[2]+b[3],$>I)return 1;if($<I)return-1;return 0}var jQ=/t|\s/i;function Fv($){let I=MQ($);return function U(b){let w=b.split(jQ);return w.length===2&&Ev(w[0])&&I(w[1])}}function Pv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function kv($,I){if(!($&&I))return;let[U,b]=$.split(jQ),[w,X]=I.split(jQ),D=EQ(U,w);if(D===void 0)return;return D||SQ(b,X)}var ng=/\/|:/,ig=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function og($){return ng.test($)&&ig.test($)}var Mv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function dg($){return Mv.lastIndex=0,Mv.test($)}var pg=-2147483648,tg=2147483647;function ag($){return Number.isInteger($)&&$<=tg&&$>=pg}function eg($){return Number.isInteger($)}function jv(){return!0}var sg=/[^\\]\\Z/;function $x($){if(sg.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var Cv=Z((Zv)=>{Object.defineProperty(Zv,"__esModule",{value:!0});Zv.formatLimitDefinition=void 0;var Ux=qQ(),R6=a(),q4=R6.operators,xb={formatMaximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},formatMinimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},formatExclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},formatExclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},wx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${xb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${xb[$].okStr}, limit: ${I}}`};Zv.formatLimitDefinition={keyword:Object.keys(xb),type:"string",schemaType:"string",$data:!0,error:wx,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new Ux.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else N();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),J=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${J} != "object"`,R6._`${J} instanceof RegExp`,R6._`typeof ${J}.compare != "function"`,B(J)))}function N(){let H=Q.schema,J=W.formats[H];if(!J||J===!0)return;if(typeof J!="object"||J instanceof RegExp||typeof J.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:J,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(B(A))}function B(H){return R6._`${H}.compare(${U}, ${b}) ${xb[w].fail} 0`}},dependencies:["format"]};var bx=($)=>{return $.addKeyword(Zv.formatLimitDefinition),$};Zv.default=bx});var fv=Z((TU,hv)=>{Object.defineProperty(TU,"__esModule",{value:!0});var h1=_v(),Dx=Cv(),RQ=a(),gv=new RQ.Name("fullFormats"),Wx=new RQ.Name("fastFormats"),TQ=($,I={keywords:!0})=>{if(Array.isArray(I))return xv($,I,h1.fullFormats,gv),$;let[U,b]=I.mode==="fast"?[h1.fastFormats,Wx]:[h1.fullFormats,gv],w=I.formats||h1.formatNames;if(xv($,w,U,b),I.keywords)Dx.default($);return $};TQ.get=($,I="full")=>{let b=(I==="fast"?h1.fastFormats:h1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function xv($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=RQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}hv.exports=TU=TQ;Object.defineProperty(TU,"__esModule",{value:!0});TU.default=TQ});var $$;(function($){$.assertEqual=(w)=>{};function I(w){}$.assertIs=I;function U(w){throw new Error}$.assertNever=U,$.arrayToEnum=(w)=>{let X={};for(let D of w)X[D]=D;return X},$.getValidEnumValues=(w)=>{let X=$.objectKeys(w).filter((W)=>typeof w[w[W]]!=="number"),D={};for(let W of X)D[W]=w[W];return $.objectValues(D)},$.objectValues=(w)=>{return $.objectKeys(w).map(function(X){return w[X]})},$.objectKeys=typeof Object.keys==="function"?(w)=>Object.keys(w):(w)=>{let X=[];for(let D in w)if(Object.prototype.hasOwnProperty.call(w,D))X.push(D);return X},$.find=(w,X)=>{for(let D of w)if(X(D))return D;return},$.isInteger=typeof Number.isInteger==="function"?(w)=>Number.isInteger(w):(w)=>typeof w==="number"&&Number.isFinite(w)&&Math.floor(w)===w;function b(w,X=" | "){return w.map((D)=>typeof D==="string"?`'${D}'`:D).join(X)}$.joinValues=b,$.jsonStringifyReplacer=(w,X)=>{if(typeof X==="bigint")return X.toString();return X}})($$||($$={}));var KH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(KH||(KH={}));var R=$$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o6=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return R.map;if(typeof Set!=="undefined"&&$ instanceof Set)return R.set;if(typeof Date!=="undefined"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}};var F=$$.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 X6 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(w){return w.message},U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union")X.unionErrors.map(b);else if(X.code==="invalid_return_type")b(X.returnTypeError);else if(X.code==="invalid_arguments")b(X.argumentsError);else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b(this),U}static assert($){if(!($ instanceof X6))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I={},U=[];for(let b of this.issues)if(b.path.length>0){let w=b.path[0];I[w]=I[w]||[],I[w].push($(b))}else U.push($(b));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}X6.create=($)=>{return new X6($)};var lM=($,I)=>{let U;switch($.code){case F.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case F.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case F.invalid_union:U="Invalid input";break;case F.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case F.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case F.invalid_arguments:U="Invalid function arguments";break;case F.invalid_return_type:U="Invalid function return type";break;case F.invalid_date:U="Invalid date";break;case F.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else $$.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case F.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case F.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case F.custom:U="Invalid input";break;case F.invalid_intersection_types:U="Intersection results could not be merged";break;case F.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case F.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},W4=lM;var cM=W4;function EI(){return cM}var t0=($)=>{let{data:I,path:U,errorMaps:b,issueData:w}=$,X=[...U,...w.path||[]],D={...w,path:X};if(w.message!==void 0)return{...w,path:X,message:w.message};let W="",Q=b.filter((G)=>!!G).slice().reverse();for(let G of Q)W=G(D,{data:I,defaultError:W}).message;return{...w,path:X,message:W}};function T($,I){let U=EI(),b=t0({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===W4?void 0:W4].filter((w)=>!!w)});$.common.issues.push(b)}class f${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let b of I){if(b.status==="aborted")return r;if(b.status==="dirty")$.dirty();U.push(b.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let b of I){let w=await b.key,X=await b.value;U.push({key:w,value:X})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let b of I){let{key:w,value:X}=b;if(w.status==="aborted")return r;if(X.status==="aborted")return r;if(w.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(w.value!=="__proto__"&&(typeof X.value!=="undefined"||b.alwaysSet))U[w.value]=X.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),J1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),mD=($)=>$.status==="aborted",rD=($)=>$.status==="dirty",f4=($)=>$.status==="valid",SI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var g;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(g||(g={}));class V6{constructor($,I,U,b){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=b}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var vH=($,I)=>{if(f4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new X6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:b,description:w}=$;if(I&&(U||b))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:w};return{errorMap:(D,W)=>{let{message:Q}=$;if(D.code==="invalid_enum_value")return{message:Q??W.defaultError};if(typeof W.data==="undefined")return{message:Q??b??W.defaultError};if(D.code!=="invalid_type")return{message:W.defaultError};return{message:Q??U??W.defaultError}},description:w}}class e{get description(){return this._def.description}_getType($){return o6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new f$,ctx:{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(SI(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parseSync({data:$,path:U.path,parent:U});return vH(U,b)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return f4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>f4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parse({data:$,path:U.path,parent:U}),w=await(SI(b)?b:Promise.resolve(b));return vH(U,w)}refine($,I){let U=(b)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(b);else return I};return this._refinement((b,w)=>{let X=$(b),D=()=>w.addIssue({code:F.custom,...U(b)});if(typeof Promise!=="undefined"&&X instanceof Promise)return X.then((W)=>{if(!W)return D(),!1;else return!0});if(!X)return D(),!1;else return!0})}refinement($,I){return this._refinement((U,b)=>{if(!$(U))return b.addIssue(typeof I==="function"?I(U,b):I),!1;else return!0})}_refinement($){return new g6({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return B6.create(this,this._def)}nullable(){return Q4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return L1.create(this,this._def)}or($){return _I.create([this,$],this._def)}and($){return ZI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new hI({...d(this._def),innerType:this,defaultValue:I,typeName:M.ZodDefault})}brand(){return new dD({typeName:M.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new fI({...d(this._def),innerType:this,catchValue:I,typeName:M.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return bw.create(this,$)}readonly(){return yI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var mM=/^c[^\s-]{8,}$/i,rM=/^[0-9a-z]+$/,nM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,iM=/^[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,oM=/^[a-z0-9_-]{21}$/i,dM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pM=/^[-+]?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)?)??$/,tM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",nD,eM=/^(?:(?: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])$/,sM=/^(?:(?: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]))$/,Ij=/^(([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])$/,Uj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VH="((\\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])))",bj=new RegExp(`^${VH}$`);function qH($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function Xj($){return new RegExp(`^${qH($)}$`)}function Dj($){let I=`${VH}T${qH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function Wj($,I){if((I==="v4"||!I)&&eM.test($))return!0;if((I==="v6"||!I)&&$j.test($))return!0;return!1}function Qj($,I){if(!dM.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let b=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),w=JSON.parse(atob(b));if(typeof w!=="object"||w===null)return!1;if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&w.alg!==I)return!1;return!0}catch{return!1}}function Gj($,I){if((I==="v4"||!I)&&sM.test($))return!0;if((I==="v6"||!I)&&Ij.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.string,received:w.parsedType}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.length<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="max"){if($.data.length>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="length"){let X=$.data.length>w.value,D=$.data.length<w.value;if(X||D){if(b=this._getOrReturnCtx($,b),X)T(b,{code:F.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:F.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!tM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!nD)nD=new RegExp(aM,"u");if(!nD.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!iM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!oM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!mM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!rM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!nM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="url")try{new URL($.data)}catch{b=this._getOrReturnCtx($,b),T(b,{validation:"url",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="regex"){if(w.regex.lastIndex=0,!w.regex.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"regex",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="trim")$.data=$.data.trim();else if(w.kind==="includes"){if(!$.data.includes(w.value,w.position))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),U.dirty()}else if(w.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(w.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(w.kind==="startsWith"){if(!$.data.startsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{startsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="endsWith"){if(!$.data.endsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Dj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!bj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!Xj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:F.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!pM.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!Wj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!Qj($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Gj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!Uj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:F.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:F.invalid_string,message:w.message}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((b)=>$.test(b),{validation:I,code:F.invalid_string,...g.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...g.errToObj($)})}url($){return this._addCheck({kind:"url",...g.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...g.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...g.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...g.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...g.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...g.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...g.errToObj($)})}base64($){return this._addCheck({kind:"base64",...g.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...g.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...g.errToObj($)})}ip($){return this._addCheck({kind:"ip",...g.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...g.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...g.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...g.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...g.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...g.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...g.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...g.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...g.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...g.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...g.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...g.errToObj(I)})}nonempty($){return this.min(1,g.errToObj($))}trim(){return new p6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}p6.create=($)=>{return new p6({checks:[],typeName:M.ZodString,coerce:$?.coerce??!1,...d($)})};function Nj($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}class A1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==R.number){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.number,received:w.parsedType}),r}let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.invalid_type,expected:"integer",received:"float",message:w.message}),b.dirty()}else if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Nj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else if(w.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:F.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new A1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new A1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:g.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}finite($){return this._addCheck({kind:"finite",message:g.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&$$.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}A1.create=($)=>{return new A1({checks:[],typeName:M.ZodNumber,coerce:$?.coerce||!1,...d($)})};class O1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==R.bigint)return this._getInvalidInput($);let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:F.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if($.data%w.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:F.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,g.toString(I))}gt($,I){return this.setLimit("min",$,!1,g.toString(I))}lte($,I){return this.setLimit("max",$,!0,g.toString(I))}lt($,I){return this.setLimit("max",$,!1,g.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:g.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:g.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}O1.create=($)=>{return new O1({checks:[],typeName:M.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class a0 extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}a0.create=($)=>{return new a0({typeName:M.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class kI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:F.invalid_date}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.getTime()<w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),U.dirty()}else if(w.kind==="max"){if($.data.getTime()>w.value)b=this._getOrReturnCtx($,b),T(b,{code:F.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new kI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:g.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:g.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}kI.create=($)=>{return new kI({checks:[],coerce:$?.coerce||!1,typeName:M.ZodDate,...d($)})};class e0 extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}e0.create=($)=>{return new e0({typeName:M.ZodSymbol,...d($)})};class RI extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}RI.create=($)=>{return new RI({typeName:M.ZodUndefined,...d($)})};class TI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}TI.create=($)=>{return new TI({typeName:M.ZodNull,...d($)})};class s0 extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}s0.create=($)=>{return new s0({typeName:M.ZodAny,...d($)})};class y4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}y4.create=($)=>{return new y4({typeName:M.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:F.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:M.ZodNever,...d($)})};class $w extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}$w.create=($)=>{return new $w({typeName:M.ZodVoid,...d($)})};class C6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),b=this._def;if(I.parsedType!==R.array)return T(I,{code:F.invalid_type,expected:R.array,received:I.parsedType}),r;if(b.exactLength!==null){let X=I.data.length>b.exactLength.value,D=I.data.length<b.exactLength.value;if(X||D)T(I,{code:X?F.too_big:F.too_small,minimum:D?b.exactLength.value:void 0,maximum:X?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),U.dirty()}if(b.minLength!==null){if(I.data.length<b.minLength.value)T(I,{code:F.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),U.dirty()}if(b.maxLength!==null){if(I.data.length>b.maxLength.value)T(I,{code:F.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((X,D)=>{return b.type._parseAsync(new V6(I,X,I.path,D))})).then((X)=>{return f$.mergeArray(U,X)});let w=[...I.data].map((X,D)=>{return b.type._parseSync(new V6(I,X,I.path,D))});return f$.mergeArray(U,w)}get element(){return this._def.type}min($,I){return new C6({...this._def,minLength:{value:$,message:g.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:g.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:g.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...d(I)})};function H1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=B6.create(H1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:H1($.element)});else if($ instanceof B6)return B6.create(H1($.unwrap()));else if($ instanceof Q4)return Q4.create(H1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>H1(I)));else return $}class E$ extends e{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=$$.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==R.object){let Q=this._getOrReturnCtx($);return T(Q,{code:F.invalid_type,expected:R.object,received:Q.parsedType}),r}let{status:U,ctx:b}=this._processInputParams($),{shape:w,keys:X}=this._getCached(),D=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let Q in b.data)if(!X.includes(Q))D.push(Q)}let W=[];for(let Q of X){let G=w[Q],N=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,N,b.path,Q)),alwaysSet:Q in b.data})}if(this._def.catchall instanceof t6){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let G of D)W.push({key:{status:"valid",value:G},value:{status:"valid",value:b.data[G]}});else if(Q==="strict"){if(D.length>0)T(b,{code:F.unrecognized_keys,keys:D}),U.dirty()}else if(Q==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let G of D){let N=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,N,b.path,G)),alwaysSet:G in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let G of W){let N=await G.key,B=await G.value;Q.push({key:N,value:B,alwaysSet:G.alwaysSet})}return Q}).then((Q)=>{return f$.mergeObjectSync(U,Q)});else return f$.mergeObjectSync(U,W)}get shape(){return this._def.shape()}strict($){return g.errToObj,new E$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let b=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:g.errToObj($).message??b};return{message:b}}}:{}})}strip(){return new E$({...this._def,unknownKeys:"strip"})}passthrough(){return new E$({...this._def,unknownKeys:"passthrough"})}extend($){return new E$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new E$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:M.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new E$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}deepPartial(){return H1(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let b=this.shape[U];if($&&!$[U])I[U]=b;else I[U]=b.optional()}return new E$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let w=this.shape[U];while(w instanceof B6)w=w._def.innerType;I[U]=w}return new E$({...this._def,shape:()=>I})}keyof(){return FH($$.objectKeys(this.shape))}}E$.create=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:M.ZodObject,...d(I)})};class _I extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function b(w){for(let D of w)if(D.result.status==="valid")return D.result;for(let D of w)if(D.result.status==="dirty")return I.common.issues.push(...D.ctx.common.issues),D.result;let X=w.map((D)=>new X6(D.ctx.common.issues));return T(I,{code:F.invalid_union,unionErrors:X}),r}if(I.common.async)return Promise.all(U.map(async(w)=>{let X={...I,common:{...I.common,issues:[]},parent:null};return{result:await w._parseAsync({data:I.data,path:I.path,parent:X}),ctx:X}})).then(b);else{let w=void 0,X=[];for(let W of U){let Q={...I,common:{...I.common,issues:[]},parent:null},G=W._parseSync({data:I.data,path:I.path,parent:Q});if(G.status==="valid")return G;else if(G.status==="dirty"&&!w)w={result:G,ctx:Q};if(Q.common.issues.length)X.push(Q.common.issues)}if(w)return I.common.issues.push(...w.ctx.common.issues),w.result;let D=X.map((W)=>new X6(W));return T(I,{code:F.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}_I.create=($,I)=>{return new _I({options:$,typeName:M.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof CI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof gI)return[$.value];else if($ instanceof u4)return $.options;else if($ instanceof xI)return $$.objectValues($.enum);else if($ instanceof hI)return d6($._def.innerType);else if($ instanceof RI)return[void 0];else if($ instanceof TI)return[null];else if($ instanceof B6)return[void 0,...d6($.unwrap())];else if($ instanceof Q4)return[null,...d6($.unwrap())];else if($ instanceof dD)return d6($.unwrap());else if($ instanceof yI)return d6($.unwrap());else if($ instanceof fI)return d6($._def.innerType);else return[]};class oD extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:F.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,b=I.data[U],w=this.optionsMap.get(b);if(!w)return T(I,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return w._parseAsync({data:I.data,path:I.path,parent:I});else return w._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let b=new Map;for(let w of I){let X=d6(w.shape[$]);if(!X.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let D of X){if(b.has(D))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(D)}`);b.set(D,w)}}return new oD({typeName:M.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function iD($,I){let U=o6($),b=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&b===R.object){let w=$$.objectKeys(I),X=$$.objectKeys($).filter((W)=>w.indexOf(W)!==-1),D={...$,...I};for(let W of X){let Q=iD($[W],I[W]);if(!Q.valid)return{valid:!1};D[W]=Q.data}return{valid:!0,data:D}}else if(U===R.array&&b===R.array){if($.length!==I.length)return{valid:!1};let w=[];for(let X=0;X<$.length;X++){let D=$[X],W=I[X],Q=iD(D,W);if(!Q.valid)return{valid:!1};w.push(Q.data)}return{valid:!0,data:w}}else if(U===R.date&&b===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class ZI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(mD(w)||mD(X))return r;let D=iD(w.value,X.value);if(!D.valid)return T(U,{code:F.invalid_intersection_types}),r;if(rD(w)||rD(X))I.dirty();return{status:I.value,value:D.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([w,X])=>b(w,X));else return b(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}ZI.create=($,I,U)=>{return new ZI({left:$,right:I,typeName:M.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:F.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&U.data.length>this._def.items.length)T(U,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let w=[...U.data].map((X,D)=>{let W=this._def.items[D]||this._def.rest;if(!W)return null;return W._parse(new V6(U,X,U.path,D))}).filter((X)=>!!X);if(U.common.async)return Promise.all(w).then((X)=>{return f$.mergeArray(I,X)});else return f$.mergeArray(I,w)}get items(){return this._def.items}rest($){return new a6({...this._def,rest:$})}}a6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new a6({items:$,typeName:M.ZodTuple,rest:null,...d(I)})};class Iw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.object)return T(U,{code:F.invalid_type,expected:R.object,received:U.parsedType}),r;let b=[],w=this._def.keyType,X=this._def.valueType;for(let D in U.data)b.push({key:w._parse(new V6(U,D,U.path,D)),value:X._parse(new V6(U,U.data[D],U.path,D)),alwaysSet:D in U.data});if(U.common.async)return f$.mergeObjectAsync(I,b);else return f$.mergeObjectSync(I,b)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new Iw({keyType:$,valueType:I,typeName:M.ZodRecord,...d(U)});return new Iw({keyType:p6.create(),valueType:$,typeName:M.ZodRecord,...d(I)})}}class Uw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.map)return T(U,{code:F.invalid_type,expected:R.map,received:U.parsedType}),r;let b=this._def.keyType,w=this._def.valueType,X=[...U.data.entries()].map(([D,W],Q)=>{return{key:b._parse(new V6(U,D,U.path,[Q,"key"])),value:w._parse(new V6(U,W,U.path,[Q,"value"]))}});if(U.common.async){let D=new Map;return Promise.resolve().then(async()=>{for(let W of X){let Q=await W.key,G=await W.value;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}})}else{let D=new Map;for(let W of X){let{key:Q,value:G}=W;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}}}}Uw.create=($,I,U)=>{return new Uw({valueType:I,keyType:$,typeName:M.ZodMap,...d(U)})};class z1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:F.invalid_type,expected:R.set,received:U.parsedType}),r;let b=this._def;if(b.minSize!==null){if(U.data.size<b.minSize.value)T(U,{code:F.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),I.dirty()}if(b.maxSize!==null){if(U.data.size>b.maxSize.value)T(U,{code:F.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),I.dirty()}let w=this._def.valueType;function X(W){let Q=new Set;for(let G of W){if(G.status==="aborted")return r;if(G.status==="dirty")I.dirty();Q.add(G.value)}return{status:I.value,value:Q}}let D=[...U.data.values()].map((W,Q)=>w._parse(new V6(U,W,U.path,Q)));if(U.common.async)return Promise.all(D).then((W)=>X(W));else return X(D)}min($,I){return new z1({...this._def,minSize:{value:$,message:g.toString(I)}})}max($,I){return new z1({...this._def,maxSize:{value:$,message:g.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}z1.create=($,I)=>{return new z1({valueType:$,minSize:null,maxSize:null,typeName:M.ZodSet,...d(I)})};class PI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:F.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_arguments,argumentsError:W}})}function b(D,W){return t0({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,EI(),W4].filter((Q)=>!!Q),issueData:{code:F.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof L1){let D=this;return c$(async function(...W){let Q=new X6([]),G=await D._def.args.parseAsync(W,w).catch((H)=>{throw Q.addIssue(U(W,H)),Q}),N=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(N,w).catch((H)=>{throw Q.addIssue(b(N,H)),Q})})}else{let D=this;return c$(function(...W){let Q=D._def.args.safeParse(W,w);if(!Q.success)throw new X6([U(W,Q.error)]);let G=Reflect.apply(X,this,Q.data),N=D._def.returns.safeParse(G,w);if(!N.success)throw new X6([b(G,N.error)]);return N.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new PI({...this._def,args:a6.create($).rest(y4.create())})}returns($){return new PI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new PI({args:$?$:a6.create([]).rest(y4.create()),returns:I||y4.create(),typeName:M.ZodFunction,...d(U)})}}class CI extends e{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}CI.create=($,I)=>{return new CI({getter:$,typeName:M.ZodLazy,...d(I)})};class gI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:F.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}gI.create=($,I)=>{return new gI({value:$,typeName:M.ZodLiteral,...d(I)})};function FH($,I){return new u4({values:$,typeName:M.ZodEnum,...d(I)})}class u4 extends e{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{expected:$$.joinValues(U),received:I.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{received:I.data,code:F.invalid_enum_value,options:U}),r}return c$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return u4.create($,{...this._def,...I})}exclude($,I=this._def){return u4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}u4.create=FH;class xI extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let b=$$.objectValues(I);return T(U,{expected:$$.joinValues(b),received:U.parsedType,code:F.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let b=$$.objectValues(I);return T(U,{received:U.data,code:F.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}xI.create=($,I)=>{return new xI({values:$,typeName:M.ZodNativeEnum,...d(I)})};class L1 extends e{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.promise&&I.common.async===!1)return T(I,{code:F.invalid_type,expected:R.promise,received:I.parsedType}),r;let U=I.parsedType===R.promise?I.data:Promise.resolve(I.data);return c$(U.then((b)=>{return this._def.type.parseAsync(b,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}L1.create=($,I)=>{return new L1({type:$,typeName:M.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),b=this._def.effect||null,w={addIssue:(X)=>{if(T(U,X),X.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(w.addIssue=w.addIssue.bind(w),b.type==="preprocess"){let X=b.transform(U.data,w);if(U.common.async)return Promise.resolve(X).then(async(D)=>{if(I.value==="aborted")return r;let W=await this._def.schema._parseAsync({data:D,path:U.path,parent:U});if(W.status==="aborted")return r;if(W.status==="dirty")return J1(W.value);if(I.value==="dirty")return J1(W.value);return W});else{if(I.value==="aborted")return r;let D=this._def.schema._parseSync({data:X,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")return J1(D.value);if(I.value==="dirty")return J1(D.value);return D}}if(b.type==="refinement"){let X=(D)=>{let W=b.refinement(D,w);if(U.common.async)return Promise.resolve(W);if(W instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return D};if(U.common.async===!1){let D=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value),{status:I.value,value:D.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((D)=>{if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value).then(()=>{return{status:I.value,value:D.value}})})}if(b.type==="transform")if(U.common.async===!1){let X=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!f4(X))return r;let D=b.transform(X.value,w);if(D instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:D}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((X)=>{if(!f4(X))return r;return Promise.resolve(b.transform(X.value,w)).then((D)=>({status:I.value,value:D}))});$$.assertNever(b)}}g6.create=($,I,U)=>{return new g6({schema:$,typeName:M.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:M.ZodEffects,...d(U)})};class B6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}B6.create=($,I)=>{return new B6({innerType:$,typeName:M.ZodOptional,...d(I)})};class Q4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q4.create=($,I)=>{return new Q4({innerType:$,typeName:M.ZodNullable,...d(I)})};class hI extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===R.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}hI.create=($,I)=>{return new hI({innerType:$,typeName:M.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class fI extends e{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},b=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(SI(b))return b.then((w)=>{return{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}fI.create=($,I)=>{return new fI({innerType:$,typeName:M.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class ww extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:F.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}ww.create=($)=>{return new ww({typeName:M.ZodNaN,...d($)})};var pu=Symbol("zod_brand");class dD extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class bw extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let w=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(w.status==="aborted")return r;if(w.status==="dirty")return I.dirty(),J1(w.value);else return this._def.out._parseAsync({data:w.value,path:U.path,parent:U})})();else{let b=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return I.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:U.path,parent:U})}}static create($,I){return new bw({in:$,out:I,typeName:M.ZodPipeline})}}class yI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(f4(b))b.value=Object.freeze(b.value);return b};return SI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}yI.create=($,I)=>{return new yI({innerType:$,typeName:M.ZodReadonly,...d(I)})};var tu={object:E$.lazycreate},M;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(M||(M={}));var au=p6.create,eu=A1.create,su=ww.create,$l=O1.create,Il=a0.create,Ul=kI.create,wl=e0.create,bl=RI.create,Xl=TI.create,Dl=s0.create,Wl=y4.create,Ql=t6.create,Gl=$w.create,Nl=C6.create,MH=E$.create,Yl=E$.strictCreate,Bl=_I.create,Jl=oD.create,Hl=ZI.create,Al=a6.create,Ol=Iw.create,zl=Uw.create,Ll=z1.create,Kl=PI.create,vl=CI.create,Vl=gI.create,ql=u4.create,Fl=xI.create,Ml=L1.create,jl=g6.create,El=B6.create,Sl=Q4.create,Pl=g6.createWithPreprocess,kl=bw.create;var Yj=Object.freeze({status:"aborted"});function v($,I,U){function b(W,Q){var G;Object.defineProperty(W,"_zod",{value:W._zod??{},enumerable:!1}),(G=W._zod).traits??(G.traits=new Set),W._zod.traits.add($),I(W,Q);for(let N in D.prototype)if(!(N in W))Object.defineProperty(W,N,{value:D.prototype[N].bind(W)});W._zod.constr=D,W._zod.def=Q}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var Bj=Symbol("zod_brand");class G4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Xw={};function D6($){if($)Object.assign(Xw,$);return Xw}var I$={};v6(I$,{unwrapMessage:()=>uI,stringifyPrimitive:()=>Qw,required:()=>kj,randomString:()=>vj,propertyKeyTypes:()=>$W,promiseAllObject:()=>Kj,primitiveTypes:()=>jH,prefixIssues:()=>x6,pick:()=>Mj,partial:()=>Pj,optionalKeys:()=>IW,omit:()=>jj,numKeys:()=>Vj,nullish:()=>mI,normalizeParams:()=>m,merge:()=>Sj,jsonStringifyReplacer:()=>tD,joinValues:()=>Dw,issue:()=>wW,isPlainObject:()=>v1,isObject:()=>K1,getSizableOrigin:()=>SH,getParsedType:()=>qj,getLengthableOrigin:()=>nI,getEnumValues:()=>lI,getElementAtPath:()=>Lj,floatSafeRemainder:()=>aD,finalizeIssue:()=>q6,extend:()=>Ej,escapeRegex:()=>N4,esc:()=>l4,defineLazy:()=>O$,createTransparentProxy:()=>Fj,clone:()=>W6,cleanRegex:()=>rI,cleanEnum:()=>Rj,captureStackTrace:()=>Ww,cached:()=>cI,assignProp:()=>eD,assertNotEqual:()=>Hj,assertNever:()=>Oj,assertIs:()=>Aj,assertEqual:()=>Jj,assert:()=>zj,allowsEval:()=>sD,aborted:()=>c4,NUMBER_FORMAT_RANGES:()=>UW,Class:()=>PH,BIGINT_FORMAT_RANGES:()=>EH});function Jj($){return $}function Hj($){return $}function Aj($){}function Oj($){throw new Error}function zj($){}function lI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Dw($,I="|"){return $.map((U)=>Qw(U)).join(I)}function tD($,I){if(typeof I==="bigint")return I.toString();return I}function cI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function mI($){return $===null||$===void 0}function rI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function aD($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}function O$($,I,U){Object.defineProperty($,I,{get(){{let w=U();return $[I]=w,w}throw new Error("cached value already set")},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function eD($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function Lj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function Kj($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function vj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function l4($){return JSON.stringify($)}var Ww=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function K1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var sD=cI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function v1($){if(K1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(K1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function Vj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var qj=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},$W=new Set(["string","number","symbol"]),jH=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W6($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function m($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function Fj($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function Qw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function IW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var UW={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},EH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Mj($,I){let U={},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;U[w]=b.shape[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function jj($,I){let U={...$._zod.def.shape},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete U[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function Ej($,I){if(!v1(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return eD(this,"shape",b),b},checks:[]};return W6($,U)}function Sj($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return eD(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function Pj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in b))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=$?new $({type:"optional",innerType:b[X]}):b[X]}else for(let X in b)w[X]=$?new $({type:"optional",innerType:b[X]}):b[X];return W6(I,{...I._zod.def,shape:w,checks:[]})}function kj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in w))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=new $({type:"nonoptional",innerType:b[X]})}else for(let X in b)w[X]=new $({type:"nonoptional",innerType:b[X]});return W6(I,{...I._zod.def,shape:w,checks:[]})}function c4($,I=0){for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function x6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function uI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uI($.inst?._zod.def?.error?.($))??uI(I?.error?.($))??uI(U.customError?.($))??uI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function SH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function wW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function Rj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class PH{constructor(...$){}}var kH=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(I,tD,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Gw=v("$ZodError",kH),iI=v("$ZodError",kH,{Parent:Error});function bW($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function XW($,I){let U=I||function(X){return X.message},b={_errors:[]},w=(X)=>{for(let D of X.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((W)=>w({issues:W}));else if(D.code==="invalid_key")w({issues:D.issues});else if(D.code==="invalid_element")w({issues:D.issues});else if(D.path.length===0)b._errors.push(U(D));else{let W=b,Q=0;while(Q<D.path.length){let G=D.path[Q];if(Q!==D.path.length-1)W[G]=W[G]||{_errors:[]};else W[G]=W[G]||{_errors:[]},W[G]._errors.push(U(D));W=W[G],Q++}}};return w($),b}var DW=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new G4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},WW=DW(iI),QW=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Ww(W,w?.callee),W}return D.value},GW=QW(iI),NW=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new G4;return X.issues.length?{success:!1,error:new($??Gw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},m4=NW(iI),YW=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=YW(iI);var RH=/^[cC][^\s-]{8,}$/,TH=/^[0-9a-z]+$/,_H=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZH=/^[0-9a-vA-V]{20}$/,CH=/^[A-Za-z0-9]{27}$/,gH=/^[a-zA-Z0-9_-]{21}$/,xH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var hH=/^([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})$/,BW=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var fH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function yH(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var uH=/^(?:(?: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])$/,lH=/^(([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})$/,cH=/^((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])$/,mH=/^(([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])$/,rH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JW=/^[A-Za-z0-9_-]*$/,nH=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var iH=/^\+(?:[0-9]){6,14}[0-9]$/,oH="(?:(?:\\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])))",dH=new RegExp(`^${oH}$`);function pH($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function tH($){return new RegExp(`^${pH($)}$`)}function aH($){let I=pH({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${oH}T(?:${b})$`)}var eH=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var sH=/^\d+$/,$A=/^-?\d+(?:\.\d+)?/i,IA=/true|false/i,UA=/null/i;var wA=/^[^A-Z]*$/,bA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),XA={number:"number",bigint:"bigint",object:"date"},HW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=XA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),AW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=XA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),DA=v("$ZodCheckMultipleOf",($,I)=>{Z$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):aD(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),WA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=UW[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=sH}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}});var QA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=nI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=nI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),NA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!mI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=nI(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),oI=v("$ZodCheckStringFormat",($,I)=>{var U,b;if(Z$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),YA=v("$ZodCheckRegex",($,I)=>{oI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),BA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=wA),oI.init($,I)}),JA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=bA),oI.init($,I)}),HA=v("$ZodCheckIncludes",($,I)=>{Z$.init($,I);let U=N4(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),AA=v("$ZodCheckStartsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`^${N4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),OA=v("$ZodCheckEndsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`.*${N4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});var zA=v("$ZodCheckOverwrite",($,I)=>{Z$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class OW{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
9
+ deps: ${U}}`};var _C={keyword:"dependencies",type:"object",schemaType:"object",error:lK.error,code($){let[I,U]=ZC($);yK($,I),uK($,U)}};function ZC({schema:$}){let I={},U={};for(let b in $){if(b==="__proto__")continue;let w=Array.isArray($[b])?I:U;w[b]=$[b]}return[I,U]}function yK($,I=$.schema){let{gen:U,data:b,it:w}=$;if(Object.keys(I).length===0)return;let X=U.let("missing");for(let D in I){let W=I[D];if(W.length===0)continue;let Q=TU.propertyInData(U,b,D,w.opts.ownProperties);if($.setParams({property:D,depsCount:W.length,deps:W.join(", ")}),w.allErrors)U.if(Q,()=>{for(let G of W)TU.checkReportMissingProp($,G)});else U.if(SQ._`${Q} && (${TU.checkMissingProp($,W,X)})`),TU.reportMissingProp($,X),U.else()}}lK.validatePropertyDeps=yK;function uK($,I=$.schema){let{gen:U,data:b,keyword:w,it:X}=$,D=U.name("valid");for(let W in I){if(TC.alwaysValidSchema(X,I[W]))continue;U.if(TU.propertyInData(U,b,W,X.opts.ownProperties),()=>{let Q=$.subschema({keyword:w,schemaProp:W},D);$.mergeValidEvaluated(Q,D)},()=>U.var(D,!0)),$.ok(D)}}lK.validateSchemaDeps=uK;lK.default=_C});var oK=Z((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var nK=a(),xC=W$(),hC={message:"property name must be valid",params:({params:$})=>nK._`{propertyName: ${$.propertyName}}`},fC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:hC,code($){let{gen:I,schema:U,data:b,it:w}=$;if(xC.alwaysValidSchema(w,U))return;let X=I.name("valid");I.forIn("key",b,(D)=>{$.setParams({propertyName:D}),$.subschema({keyword:"propertyNames",data:D,dataTypes:["string"],propertyName:D,compositeRule:!0},X),I.if(nK.not(X),()=>{if($.error(!0),!w.allErrors)I.break()})}),$.ok(X)}};iK.default=fC});var PQ=Z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var xb=O6(),k6=a(),uC=s6(),hb=W$(),lC={message:"must NOT have additional properties",params:({params:$})=>k6._`{additionalProperty: ${$.additionalProperty}}`},cC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lC,code($){let{gen:I,schema:U,parentSchema:b,data:w,errsCount:X,it:D}=$;if(!X)throw new Error("ajv implementation error");let{allErrors:W,opts:Q}=D;if(D.props=!0,Q.removeAdditional!=="all"&&hb.alwaysValidSchema(D,U))return;let G=xb.allSchemaProperties(b.properties),Y=xb.allSchemaProperties(b.patternProperties);J(),$.ok(k6._`${X} === ${uC.default.errors}`);function J(){I.forIn("key",w,(V)=>{if(!G.length&&!Y.length)A(V);else I.if(H(V),()=>A(V))})}function H(V){let q;if(G.length>8){let k=hb.schemaRefOrVal(D,b.properties,"properties");q=xb.isOwnProperty(I,k,V)}else if(G.length)q=k6.or(...G.map((k)=>k6._`${V} === ${k}`));else q=k6.nil;if(Y.length)q=k6.or(q,...Y.map((k)=>k6._`${xb.usePattern($,k)}.test(${V})`));return k6.not(q)}function B(V){I.code(k6._`delete ${w}[${V}]`)}function A(V){if(Q.removeAdditional==="all"||Q.removeAdditional&&U===!1){B(V);return}if(U===!1){if($.setParams({additionalProperty:V}),$.error(),!W)I.break();return}if(typeof U=="object"&&!hb.alwaysValidSchema(D,U)){let q=I.name("valid");if(Q.removeAdditional==="failing")O(V,q,!1),I.if(k6.not(q),()=>{$.reset(),B(V)});else if(O(V,q),!W)I.if(k6.not(q),()=>I.break())}}function O(V,q,k){let P={keyword:"additionalProperties",dataProp:V,dataPropType:hb.Type.Str};if(k===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,q)}}};dK.default=cC});var eK=Z((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});var rC=KU(),pK=O6(),kQ=W$(),tK=PQ(),nC={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:b,data:w,it:X}=$;if(X.opts.removeAdditional==="all"&&b.additionalProperties===void 0)tK.default.code(new rC.KeywordCxt(X,tK.default,"additionalProperties"));let D=pK.allSchemaProperties(U);for(let J of D)X.definedProperties.add(J);if(X.opts.unevaluated&&D.length&&X.props!==!0)X.props=kQ.mergeEvaluated.props(I,kQ.toHash(D),X.props);let W=D.filter((J)=>!kQ.alwaysValidSchema(X,U[J]));if(W.length===0)return;let Q=I.name("valid");for(let J of W){if(G(J))Y(J);else{if(I.if(pK.propertyInData(I,w,J,X.opts.ownProperties)),Y(J),!X.allErrors)I.else().var(Q,!0);I.endIf()}$.it.definedProperties.add(J),$.ok(Q)}function G(J){return X.opts.useDefaults&&!X.compositeRule&&U[J].default!==void 0}function Y(J){$.subschema({keyword:"properties",schemaProp:J,dataProp:J},Q)}}};aK.default=nC});var wv=Z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var sK=O6(),fb=a(),$v=W$(),Iv=W$(),oC={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:b,parentSchema:w,it:X}=$,{opts:D}=X,W=sK.allSchemaProperties(U),Q=W.filter((O)=>$v.alwaysValidSchema(X,U[O]));if(W.length===0||Q.length===W.length&&(!X.opts.unevaluated||X.props===!0))return;let G=D.strictSchema&&!D.allowMatchingProperties&&w.properties,Y=I.name("valid");if(X.props!==!0&&!(X.props instanceof fb.Name))X.props=Iv.evaluatedPropsToName(I,X.props);let{props:J}=X;H();function H(){for(let O of W){if(G)B(O);if(X.allErrors)A(O);else I.var(Y,!0),A(O),I.if(Y)}}function B(O){for(let V in G)if(new RegExp(O).test(V))$v.checkStrictMode(X,`property ${V} matches pattern ${O} (use allowMatchingProperties)`)}function A(O){I.forIn("key",b,(V)=>{I.if(fb._`${sK.usePattern($,O)}.test(${V})`,()=>{let q=Q.includes(O);if(!q)$.subschema({keyword:"patternProperties",schemaProp:O,dataProp:V,dataPropType:Iv.Type.Str},Y);if(X.opts.unevaluated&&J!==!0)I.assign(fb._`${J}[${V}]`,!0);else if(!q&&!X.allErrors)I.if(fb.not(Y),()=>I.break())})})}}};Uv.default=oC});var Xv=Z((bv)=>{Object.defineProperty(bv,"__esModule",{value:!0});var pC=W$(),tC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:b}=$;if(pC.alwaysValidSchema(b,U)){$.fail();return}let w=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},w),$.failResult(w,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};bv.default=tC});var Wv=Z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var eC=O6(),sC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eC.validateUnion,error:{message:"must match a schema in anyOf"}};Dv.default=sC});var Gv=Z((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});var yb=a(),Ig=W$(),Ug={message:"must match exactly one schema in oneOf",params:({params:$})=>yb._`{passingSchemas: ${$.passing}}`},wg={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ug,code($){let{gen:I,schema:U,parentSchema:b,it:w}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(w.opts.discriminator&&b.discriminator)return;let X=U,D=I.let("valid",!1),W=I.let("passing",null),Q=I.name("_valid");$.setParams({passing:W}),I.block(G),$.result(D,()=>$.reset(),()=>$.error(!0));function G(){X.forEach((Y,J)=>{let H;if(Ig.alwaysValidSchema(w,Y))I.var(Q,!0);else H=$.subschema({keyword:"oneOf",schemaProp:J,compositeRule:!0},Q);if(J>0)I.if(yb._`${Q} && ${D}`).assign(D,!1).assign(W,yb._`[${W}, ${J}]`).else();I.if(Q,()=>{if(I.assign(D,!0),I.assign(W,J),H)$.mergeEvaluated(H,yb.Name)})})}}};Qv.default=wg});var Nv=Z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});var Xg=W$(),Dg={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let w=I.name("valid");U.forEach((X,D)=>{if(Xg.alwaysValidSchema(b,X))return;let W=$.subschema({keyword:"allOf",schemaProp:D},w);$.ok(w),$.mergeEvaluated(W)})}};Yv.default=Dg});var Av=Z((Hv)=>{Object.defineProperty(Hv,"__esModule",{value:!0});var ub=a(),Bv=W$(),Qg={message:({params:$})=>ub.str`must match "${$.ifClause}" schema`,params:({params:$})=>ub._`{failingKeyword: ${$.ifClause}}`},Gg={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qg,code($){let{gen:I,parentSchema:U,it:b}=$;if(U.then===void 0&&U.else===void 0)Bv.checkStrictMode(b,'"if" without "then" and "else" is ignored');let w=Jv(b,"then"),X=Jv(b,"else");if(!w&&!X)return;let D=I.let("valid",!0),W=I.name("_valid");if(Q(),$.reset(),w&&X){let Y=I.let("ifClause");$.setParams({ifClause:Y}),I.if(W,G("then",Y),G("else",Y))}else if(w)I.if(W,G("then"));else I.if(ub.not(W),G("else"));$.pass(D,()=>$.error(!0));function Q(){let Y=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);$.mergeEvaluated(Y)}function G(Y,J){return()=>{let H=$.subschema({keyword:Y},W);if(I.assign(D,W),$.mergeValidEvaluated(H,D),J)I.assign(J,ub._`${Y}`);else $.setParams({ifClause:Y})}}}};function Jv($,I){let U=$.schema[I];return U!==void 0&&!Bv.alwaysValidSchema($,U)}Hv.default=Gg});var zv=Z((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});var Ng=W$(),Jg={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)Ng.checkStrictMode(U,`"${$}" without "if" is ignored`)}};Ov.default=Jg});var Kv=Z((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});var Hg=jQ(),Ag=ZK(),Og=EQ(),zg=xK(),Lg=fK(),Kg=rK(),vg=oK(),Vg=PQ(),qg=eK(),Mg=wv(),Fg=Xv(),jg=Wv(),Eg=Gv(),Sg=Nv(),Pg=Av(),kg=zv();function Rg($=!1){let I=[Fg.default,jg.default,Eg.default,Sg.default,Pg.default,kg.default,vg.default,Vg.default,Kg.default,qg.default,Mg.default];if($)I.push(Ag.default,zg.default);else I.push(Hg.default,Og.default);return I.push(Lg.default),I}Lv.default=Rg});var Vv=Z((vv)=>{Object.defineProperty(vv,"__esModule",{value:!0});var S$=a(),_g={message:({schemaCode:$})=>S$.str`must match format "${$}"`,params:({schemaCode:$})=>S$._`{format: ${$}}`},Zg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_g,code($,I){let{gen:U,data:b,$data:w,schema:X,schemaCode:D,it:W}=$,{opts:Q,errSchemaPath:G,schemaEnv:Y,self:J}=W;if(!Q.validateFormats)return;if(w)H();else B();function H(){let A=U.scopeValue("formats",{ref:J.formats,code:Q.code.formats}),O=U.const("fDef",S$._`${A}[${D}]`),V=U.let("fType"),q=U.let("format");U.if(S$._`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>U.assign(V,S$._`${O}.type || "string"`).assign(q,S$._`${O}.validate`),()=>U.assign(V,S$._`"string"`).assign(q,O)),$.fail$data(S$.or(k(),P()));function k(){if(Q.strictSchema===!1)return S$.nil;return S$._`${D} && !${q}`}function P(){let h=Y.$async?S$._`(${O}.async ? await ${q}(${b}) : ${q}(${b}))`:S$._`${q}(${b})`,l=S$._`(typeof ${q} == "function" ? ${h} : ${q}.test(${b}))`;return S$._`${q} && ${q} !== true && ${V} === ${I} && !${l}`}}function B(){let A=J.formats[X];if(!A){k();return}if(A===!0)return;let[O,V,q]=P(A);if(O===I)$.pass(h());function k(){if(Q.strictSchema===!1){J.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${X}" ignored in schema at path "${G}"`}}function P(l){let l$=l instanceof RegExp?S$.regexpCode(l):Q.code.formats?S$._`${Q.code.formats}${S$.getProperty(X)}`:void 0,N6=U.scopeValue("formats",{key:X,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,S$._`${N6}.validate`];return["string",l,N6]}function h(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!Y.$async)throw new Error("async format in sync schema");return S$._`await ${q}(${b})`}return typeof V=="function"?S$._`${q}(${b})`:S$._`${q}.test(${b})`}}}};vv.default=Zg});var Mv=Z((qv)=>{Object.defineProperty(qv,"__esModule",{value:!0});var gg=Vv(),xg=[gg.default];qv.default=xg});var Ev=Z((Fv)=>{Object.defineProperty(Fv,"__esModule",{value:!0});Fv.contentVocabulary=Fv.metadataVocabulary=void 0;Fv.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fv.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kv=Z((Pv)=>{Object.defineProperty(Pv,"__esModule",{value:!0});var yg=aL(),ug=FK(),lg=Kv(),cg=Mv(),Sv=Ev(),mg=[yg.default,ug.default,lg.default(),cg.default,Sv.metadataVocabulary,Sv.contentVocabulary];Pv.default=mg});var Zv=Z((Tv)=>{Object.defineProperty(Tv,"__esModule",{value:!0});Tv.DiscrError=void 0;var Rv;(function($){$.Tag="tag",$.Mapping="mapping"})(Rv||(Tv.DiscrError=Rv={}))});var xv=Z((gv)=>{Object.defineProperty(gv,"__esModule",{value:!0});var x1=a(),RQ=Zv(),Cv=Vb(),ng=vU(),ig=W$(),og={message:({params:{discrError:$,tagName:I}})=>$===RQ.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>x1._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},dg={keyword:"discriminator",type:"object",schemaType:"object",error:og,code($){let{gen:I,data:U,schema:b,parentSchema:w,it:X}=$,{oneOf:D}=w;if(!X.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=b.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!D)throw new Error("discriminator: requires oneOf keyword");let Q=I.let("valid",!1),G=I.const("tag",x1._`${U}${x1.getProperty(W)}`);I.if(x1._`typeof ${G} == "string"`,()=>Y(),()=>$.error(!1,{discrError:RQ.DiscrError.Tag,tag:G,tagName:W})),$.ok(Q);function Y(){let B=H();I.if(!1);for(let A in B)I.elseIf(x1._`${G} === ${A}`),I.assign(Q,J(B[A]));I.else(),$.error(!1,{discrError:RQ.DiscrError.Mapping,tag:G,tagName:W}),I.endIf()}function J(B){let A=I.name("valid"),O=$.subschema({keyword:"oneOf",schemaProp:B},A);return $.mergeEvaluated(O,x1.Name),A}function H(){var B;let A={},O=q(w),V=!0;for(let h=0;h<D.length;h++){let l=D[h];if((l===null||l===void 0?void 0:l.$ref)&&!ig.schemaHasRulesButRef(l,X.self.RULES)){let N6=l.$ref;if(l=Cv.resolveRef.call(X.self,X.schemaEnv.root,X.baseId,N6),l instanceof Cv.SchemaEnv)l=l.schema;if(l===void 0)throw new ng.default(X.opts.uriResolver,X.baseId,N6)}let l$=(B=l===null||l===void 0?void 0:l.properties)===null||B===void 0?void 0:B[W];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);V=V&&(O||q(l)),k(l$,h)}if(!V)throw new Error(`discriminator: "${W}" must be required`);return A;function q({required:h}){return Array.isArray(h)&&h.includes(W)}function k(h,l){if(h.const)P(h.const,l);else if(h.enum)for(let l$ of h.enum)P(l$,l);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function P(h,l){if(typeof h!="string"||h in A)throw new Error(`discriminator: "${W}" values must be unique strings`);A[h]=l}}}};gv.default=dg});var hv=Z((Xd,tg)=>{tg.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var _Q=Z((I6,TQ)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.MissingRefError=I6.ValidationError=I6.CodeGen=I6.Name=I6.nil=I6.stringify=I6.str=I6._=I6.KeywordCxt=I6.Ajv=void 0;var ag=lL(),eg=kv(),sg=xv(),fv=hv(),$x=["/properties"],lb="http://json-schema.org/draft-07/schema";class _U extends ag.default{_addVocabularies(){if(super._addVocabularies(),eg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(sg.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(fv,$x):fv;this.addMetaSchema($,lb,!1),this.refs["http://json-schema.org/schema"]=lb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(lb)?lb:void 0)}}I6.Ajv=_U;TQ.exports=I6=_U;TQ.exports.Ajv=_U;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=_U;var Ix=KU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return Ix.KeywordCxt}});var h1=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return h1._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return h1.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return h1.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return h1.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return h1.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return h1.CodeGen}});var Ux=Kb();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return Ux.default}});var wx=vU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return wx.default}})});var dv=Z((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});iv.formatNames=iv.fastFormats=iv.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}iv.fullFormats={date:y6(cv,xQ),time:y6(CQ(!0),hQ),"date-time":y6(yv(!0),rv),"iso-time":y6(CQ(),mv),"iso-date-time":y6(yv(),nv),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Nx,"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:Lx,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:Jx,int32:{type:"number",validate:Ax},int64:{type:"number",validate:Ox},float:{type:"number",validate:lv},double:{type:"number",validate:lv},password:!0,binary:!0};iv.fastFormats={...iv.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xQ),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hQ),"date-time":y6(/^\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,rv),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,mv),"iso-date-time":y6(/^\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,nv),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};iv.formatNames=Object.keys(iv.fullFormats);function Dx($){return $%4===0&&($%100!==0||$%400===0)}var Wx=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function cv($){let I=Wx.exec($);if(!I)return!1;let U=+I[1],b=+I[2],w=+I[3];return b>=1&&b<=12&&w>=1&&w<=(b===2&&Dx(U)?29:Qx[b])}function xQ($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var ZQ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function CQ($){return function I(U){let b=ZQ.exec(U);if(!b)return!1;let w=+b[1],X=+b[2],D=+b[3],W=b[4],Q=b[5]==="-"?-1:1,G=+(b[6]||0),Y=+(b[7]||0);if(G>23||Y>59||$&&!W)return!1;if(w<=23&&X<=59&&D<60)return!0;let J=X-Y*Q,H=w-G*Q-(J<0?1:0);return(H===23||H===-1)&&(J===59||J===-1)&&D<61}}function hQ($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),b=new Date("2020-01-01T"+I).valueOf();if(!(U&&b))return;return U-b}function mv($,I){if(!($&&I))return;let U=ZQ.exec($),b=ZQ.exec(I);if(!(U&&b))return;if($=U[1]+U[2]+U[3],I=b[1]+b[2]+b[3],$>I)return 1;if($<I)return-1;return 0}var gQ=/t|\s/i;function yv($){let I=CQ($);return function U(b){let w=b.split(gQ);return w.length===2&&cv(w[0])&&I(w[1])}}function rv($,I){if(!($&&I))return;let U=new Date($).valueOf(),b=new Date(I).valueOf();if(!(U&&b))return;return U-b}function nv($,I){if(!($&&I))return;let[U,b]=$.split(gQ),[w,X]=I.split(gQ),D=xQ(U,w);if(D===void 0)return;return D||hQ(b,X)}var Gx=/\/|:/,Yx=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Nx($){return Gx.test($)&&Yx.test($)}var uv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Jx($){return uv.lastIndex=0,uv.test($)}var Bx=-2147483648,Hx=2147483647;function Ax($){return Number.isInteger($)&&$<=Hx&&$>=Bx}function Ox($){return Number.isInteger($)}function lv(){return!0}var zx=/[^\\]\\Z/;function Lx($){if(zx.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var tv=Z((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.formatLimitDefinition=void 0;var vx=_Q(),R6=a(),M4=R6.operators,cb={formatMaximum:{okStr:"<=",ok:M4.LTE,fail:M4.GT},formatMinimum:{okStr:">=",ok:M4.GTE,fail:M4.LT},formatExclusiveMaximum:{okStr:"<",ok:M4.LT,fail:M4.GTE},formatExclusiveMinimum:{okStr:">",ok:M4.GT,fail:M4.LTE}},Vx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${cb[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${cb[$].okStr}, limit: ${I}}`};pv.formatLimitDefinition={keyword:Object.keys(cb),type:"string",schemaType:"string",$data:!0,error:Vx,code($){let{gen:I,data:U,schemaCode:b,keyword:w,it:X}=$,{opts:D,self:W}=X;if(!D.validateFormats)return;let Q=new vx.KeywordCxt(X,W.RULES.all.format.definition,"format");if(Q.$data)G();else Y();function G(){let H=I.scopeValue("formats",{ref:W.formats,code:D.code.formats}),B=I.const("fmt",R6._`${H}[${Q.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${B} != "object"`,R6._`${B} instanceof RegExp`,R6._`typeof ${B}.compare != "function"`,J(B)))}function Y(){let H=Q.schema,B=W.formats[H];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw new Error(`"${w}": format "${H}" does not define "compare" function`);let A=I.scopeValue("formats",{key:H,ref:B,code:D.code.formats?R6._`${D.code.formats}${R6.getProperty(H)}`:void 0});$.fail$data(J(A))}function J(H){return R6._`${H}.compare(${U}, ${b}) ${cb[w].fail} 0`}},dependencies:["format"]};var qx=($)=>{return $.addKeyword(pv.formatLimitDefinition),$};pv.default=qx});var $V=Z((ZU,sv)=>{Object.defineProperty(ZU,"__esModule",{value:!0});var f1=dv(),Fx=tv(),uQ=a(),av=new uQ.Name("fullFormats"),jx=new uQ.Name("fastFormats"),lQ=($,I={keywords:!0})=>{if(Array.isArray(I))return ev($,I,f1.fullFormats,av),$;let[U,b]=I.mode==="fast"?[f1.fastFormats,jx]:[f1.fullFormats,av],w=I.formats||f1.formatNames;if(ev($,w,U,b),I.keywords)Fx.default($);return $};lQ.get=($,I="full")=>{let b=(I==="fast"?f1.fastFormats:f1.fullFormats)[$];if(!b)throw new Error(`Unknown format "${$}"`);return b};function ev($,I,U,b){var w,X;(w=(X=$.opts.code).formats)!==null&&w!==void 0||(X.formats=uQ._`require("ajv-formats/dist/formats").${b}`);for(let D of I)$.addFormat(D,U[D])}sv.exports=ZU=lQ;Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=lQ});var $$;(function($){$.assertEqual=(w)=>{};function I(w){}$.assertIs=I;function U(w){throw new Error}$.assertNever=U,$.arrayToEnum=(w)=>{let X={};for(let D of w)X[D]=D;return X},$.getValidEnumValues=(w)=>{let X=$.objectKeys(w).filter((W)=>typeof w[w[W]]!=="number"),D={};for(let W of X)D[W]=w[W];return $.objectValues(D)},$.objectValues=(w)=>{return $.objectKeys(w).map(function(X){return w[X]})},$.objectKeys=typeof Object.keys==="function"?(w)=>Object.keys(w):(w)=>{let X=[];for(let D in w)if(Object.prototype.hasOwnProperty.call(w,D))X.push(D);return X},$.find=(w,X)=>{for(let D of w)if(X(D))return D;return},$.isInteger=typeof Number.isInteger==="function"?(w)=>Number.isInteger(w):(w)=>typeof w==="number"&&Number.isFinite(w)&&Math.floor(w)===w;function b(w,X=" | "){return w.map((D)=>typeof D==="string"?`'${D}'`:D).join(X)}$.joinValues=b,$.jsonStringifyReplacer=(w,X)=>{if(typeof X==="bigint")return X.toString();return X}})($$||($$={}));var gH;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(gH||(gH={}));var R=$$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o6=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return R.map;if(typeof Set!=="undefined"&&$ instanceof Set)return R.set;if(typeof Date!=="undefined"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}};var M=$$.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 X6 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(w){return w.message},U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union")X.unionErrors.map(b);else if(X.code==="invalid_return_type")b(X.returnTypeError);else if(X.code==="invalid_arguments")b(X.argumentsError);else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b(this),U}static assert($){if(!($ instanceof X6))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I={},U=[];for(let b of this.issues)if(b.path.length>0){let w=b.path[0];I[w]=I[w]||[],I[w].push($(b))}else U.push($(b));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}X6.create=($)=>{return new X6($)};var Xj=($,I)=>{let U;switch($.code){case M.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case M.invalid_union:U="Invalid input";break;case M.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case M.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:U="Invalid function arguments";break;case M.invalid_return_type:U="Invalid function return type";break;case M.invalid_date:U="Invalid date";break;case M.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else $$.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case M.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case M.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case M.custom:U="Invalid input";break;case M.invalid_intersection_types:U="Intersection results could not be merged";break;case M.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},Q4=Xj;var Dj=Q4;function PI(){return Dj}var Uw=($)=>{let{data:I,path:U,errorMaps:b,issueData:w}=$,X=[...U,...w.path||[]],D={...w,path:X};if(w.message!==void 0)return{...w,path:X,message:w.message};let W="",Q=b.filter((G)=>!!G).slice().reverse();for(let G of Q)W=G(D,{data:I,defaultError:W}).message;return{...w,path:X,message:W}};function T($,I){let U=PI(),b=Uw({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===Q4?void 0:Q4].filter((w)=>!!w)});$.common.issues.push(b)}class f${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let b of I){if(b.status==="aborted")return r;if(b.status==="dirty")$.dirty();U.push(b.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let b of I){let w=await b.key,X=await b.value;U.push({key:w,value:X})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let b of I){let{key:w,value:X}=b;if(w.status==="aborted")return r;if(X.status==="aborted")return r;if(w.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(w.value!=="__proto__"&&(typeof X.value!=="undefined"||b.alwaysSet))U[w.value]=X.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),H1=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),sD=($)=>$.status==="aborted",$W=($)=>$.status==="dirty",y4=($)=>$.status==="valid",kI=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var x;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(x||(x={}));class V6{constructor($,I,U,b){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=b}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var xH=($,I)=>{if(y4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new X6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:b,description:w}=$;if(I&&(U||b))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:w};return{errorMap:(D,W)=>{let{message:Q}=$;if(D.code==="invalid_enum_value")return{message:Q??W.defaultError};if(typeof W.data==="undefined")return{message:Q??b??W.defaultError};if(D.code!=="invalid_type")return{message:W.defaultError};return{message:Q??U??W.defaultError}},description:w}}class e{get description(){return this._def.description}_getType($){return o6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new f$,ctx:{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(kI(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parseSync({data:$,path:U.path,parent:U});return xH(U,b)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return y4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>y4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)},b=this._parse({data:$,path:U.path,parent:U}),w=await(kI(b)?b:Promise.resolve(b));return xH(U,w)}refine($,I){let U=(b)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(b);else return I};return this._refinement((b,w)=>{let X=$(b),D=()=>w.addIssue({code:M.custom,...U(b)});if(typeof Promise!=="undefined"&&X instanceof Promise)return X.then((W)=>{if(!W)return D(),!1;else return!0});if(!X)return D(),!1;else return!0})}refinement($,I){return this._refinement((U,b)=>{if(!$(U))return b.addIssue(typeof I==="function"?I(U,b):I),!1;else return!0})}_refinement($){return new g6({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return J6.create(this,this._def)}nullable(){return G4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C6.create(this)}promise(){return K1.create(this,this._def)}or($){return CI.create([this,$],this._def)}and($){return gI.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new yI({...d(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new bW({typeName:F.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new uI({...d(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return Yw.create(this,$)}readonly(){return lI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Wj=/^c[^\s-]{8,}$/i,Qj=/^[0-9a-z]+$/,Gj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yj=/^[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,Nj=/^[a-z0-9_-]{21}$/i,Jj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bj=/^[-+]?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)?)??$/,Hj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Aj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",IW,Oj=/^(?:(?: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])$/,zj=/^(?:(?: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])$/,Lj=/^(([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]))$/,Kj=/^(([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])$/,vj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hH="((\\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])))",qj=new RegExp(`^${hH}$`);function fH($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function Mj($){return new RegExp(`^${fH($)}$`)}function Fj($){let I=`${hH}T${fH($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function jj($,I){if((I==="v4"||!I)&&Oj.test($))return!0;if((I==="v6"||!I)&&Lj.test($))return!0;return!1}function Ej($,I){if(!Jj.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let b=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),w=JSON.parse(atob(b));if(typeof w!=="object"||w===null)return!1;if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&w.alg!==I)return!1;return!0}catch{return!1}}function Sj($,I){if((I==="v4"||!I)&&zj.test($))return!0;if((I==="v6"||!I)&&Kj.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_type,expected:R.string,received:w.parsedType}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.length<w.value)b=this._getOrReturnCtx($,b),T(b,{code:M.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="max"){if($.data.length>w.value)b=this._getOrReturnCtx($,b),T(b,{code:M.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),U.dirty()}else if(w.kind==="length"){let X=$.data.length>w.value,D=$.data.length<w.value;if(X||D){if(b=this._getOrReturnCtx($,b),X)T(b,{code:M.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});else if(D)T(b,{code:M.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message});U.dirty()}}else if(w.kind==="email"){if(!Hj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"email",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="emoji"){if(!IW)IW=new RegExp(Aj,"u");if(!IW.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"emoji",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="uuid"){if(!Yj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"uuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="nanoid"){if(!Nj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"nanoid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid"){if(!Wj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cuid2"){if(!Qj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"cuid2",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ulid"){if(!Gj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"ulid",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="url")try{new URL($.data)}catch{b=this._getOrReturnCtx($,b),T(b,{validation:"url",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="regex"){if(w.regex.lastIndex=0,!w.regex.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"regex",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="trim")$.data=$.data.trim();else if(w.kind==="includes"){if(!$.data.includes(w.value,w.position))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),U.dirty()}else if(w.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(w.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(w.kind==="startsWith"){if(!$.data.startsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:{startsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="endsWith"){if(!$.data.endsWith(w.value))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:{endsWith:w.value},message:w.message}),U.dirty()}else if(w.kind==="datetime"){if(!Fj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"datetime",message:w.message}),U.dirty()}else if(w.kind==="date"){if(!qj.test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"date",message:w.message}),U.dirty()}else if(w.kind==="time"){if(!Mj(w).test($.data))b=this._getOrReturnCtx($,b),T(b,{code:M.invalid_string,validation:"time",message:w.message}),U.dirty()}else if(w.kind==="duration"){if(!Bj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"duration",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="ip"){if(!jj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"ip",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="jwt"){if(!Ej($.data,w.alg))b=this._getOrReturnCtx($,b),T(b,{validation:"jwt",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="cidr"){if(!Sj($.data,w.version))b=this._getOrReturnCtx($,b),T(b,{validation:"cidr",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64"){if(!vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64",code:M.invalid_string,message:w.message}),U.dirty()}else if(w.kind==="base64url"){if(!Vj.test($.data))b=this._getOrReturnCtx($,b),T(b,{validation:"base64url",code:M.invalid_string,message:w.message}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((b)=>$.test(b),{validation:I,code:M.invalid_string,...x.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...x.errToObj($)})}url($){return this._addCheck({kind:"url",...x.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...x.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...x.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...x.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...x.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...x.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...x.errToObj($)})}base64($){return this._addCheck({kind:"base64",...x.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...x.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...x.errToObj($)})}ip($){return this._addCheck({kind:"ip",...x.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...x.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...x.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...x.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...x.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...x.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...x.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...x.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...x.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...x.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...x.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...x.errToObj(I)})}nonempty($){return this.min(1,x.errToObj($))}trim(){return new p6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}p6.create=($)=>{return new p6({checks:[],typeName:F.ZodString,coerce:$?.coerce??!1,...d($)})};function Pj($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}class O1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==R.number){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_type,expected:R.number,received:w.parsedType}),r}let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:M.invalid_type,expected:"integer",received:"float",message:w.message}),b.dirty()}else if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:M.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:M.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if(Pj($.data,w.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:M.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else if(w.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:M.not_finite,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new O1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:x.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.toString(I)})}finite($){return this._addCheck({kind:"finite",message:x.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&$$.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}O1.create=($)=>{return new O1({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...d($)})};class z1 extends e{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==R.bigint)return this._getInvalidInput($);let U=void 0,b=new f$;for(let w of this._def.checks)if(w.kind==="min"){if(w.inclusive?$.data<w.value:$.data<=w.value)U=this._getOrReturnCtx($,U),T(U,{code:M.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="max"){if(w.inclusive?$.data>w.value:$.data>=w.value)U=this._getOrReturnCtx($,U),T(U,{code:M.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),b.dirty()}else if(w.kind==="multipleOf"){if($.data%w.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:M.not_multiple_of,multipleOf:w.value,message:w.message}),b.dirty()}else $$.assertNever(w);return{status:b.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:M.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,b){return new z1({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(b)}]})}_addCheck($){return new z1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}z1.create=($)=>{return new z1({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class ww extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}ww.create=($)=>{return new ww({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class TI extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_type,expected:R.date,received:w.parsedType}),r}if(Number.isNaN($.data.getTime())){let w=this._getOrReturnCtx($);return T(w,{code:M.invalid_date}),r}let U=new f$,b=void 0;for(let w of this._def.checks)if(w.kind==="min"){if($.data.getTime()<w.value)b=this._getOrReturnCtx($,b),T(b,{code:M.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),U.dirty()}else if(w.kind==="max"){if($.data.getTime()>w.value)b=this._getOrReturnCtx($,b),T(b,{code:M.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),U.dirty()}else $$.assertNever(w);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new TI({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:x.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:x.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}TI.create=($)=>{return new TI({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...d($)})};class bw extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}bw.create=($)=>{return new bw({typeName:F.ZodSymbol,...d($)})};class _I extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}_I.create=($)=>{return new _I({typeName:F.ZodUndefined,...d($)})};class ZI extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}ZI.create=($)=>{return new ZI({typeName:F.ZodNull,...d($)})};class Xw extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}Xw.create=($)=>{return new Xw({typeName:F.ZodAny,...d($)})};class u4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}u4.create=($)=>{return new u4({typeName:F.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:M.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:F.ZodNever,...d($)})};class Dw extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}Dw.create=($)=>{return new Dw({typeName:F.ZodVoid,...d($)})};class C6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),b=this._def;if(I.parsedType!==R.array)return T(I,{code:M.invalid_type,expected:R.array,received:I.parsedType}),r;if(b.exactLength!==null){let X=I.data.length>b.exactLength.value,D=I.data.length<b.exactLength.value;if(X||D)T(I,{code:X?M.too_big:M.too_small,minimum:D?b.exactLength.value:void 0,maximum:X?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),U.dirty()}if(b.minLength!==null){if(I.data.length<b.minLength.value)T(I,{code:M.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),U.dirty()}if(b.maxLength!==null){if(I.data.length>b.maxLength.value)T(I,{code:M.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((X,D)=>{return b.type._parseAsync(new V6(I,X,I.path,D))})).then((X)=>{return f$.mergeArray(U,X)});let w=[...I.data].map((X,D)=>{return b.type._parseSync(new V6(I,X,I.path,D))});return f$.mergeArray(U,w)}get element(){return this._def.type}min($,I){return new C6({...this._def,minLength:{value:$,message:x.toString(I)}})}max($,I){return new C6({...this._def,maxLength:{value:$,message:x.toString(I)}})}length($,I){return new C6({...this._def,exactLength:{value:$,message:x.toString(I)}})}nonempty($){return this.min(1,$)}}C6.create=($,I)=>{return new C6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...d(I)})};function A1($){if($ instanceof E$){let I={};for(let U in $.shape){let b=$.shape[U];I[U]=J6.create(A1(b))}return new E$({...$._def,shape:()=>I})}else if($ instanceof C6)return new C6({...$._def,type:A1($.element)});else if($ instanceof J6)return J6.create(A1($.unwrap()));else if($ instanceof G4)return G4.create(A1($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>A1(I)));else return $}class E$ extends e{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=$$.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==R.object){let Q=this._getOrReturnCtx($);return T(Q,{code:M.invalid_type,expected:R.object,received:Q.parsedType}),r}let{status:U,ctx:b}=this._processInputParams($),{shape:w,keys:X}=this._getCached(),D=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let Q in b.data)if(!X.includes(Q))D.push(Q)}let W=[];for(let Q of X){let G=w[Q],Y=b.data[Q];W.push({key:{status:"valid",value:Q},value:G._parse(new V6(b,Y,b.path,Q)),alwaysSet:Q in b.data})}if(this._def.catchall instanceof t6){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let G of D)W.push({key:{status:"valid",value:G},value:{status:"valid",value:b.data[G]}});else if(Q==="strict"){if(D.length>0)T(b,{code:M.unrecognized_keys,keys:D}),U.dirty()}else if(Q==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let G of D){let Y=b.data[G];W.push({key:{status:"valid",value:G},value:Q._parse(new V6(b,Y,b.path,G)),alwaysSet:G in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let G of W){let Y=await G.key,J=await G.value;Q.push({key:Y,value:J,alwaysSet:G.alwaysSet})}return Q}).then((Q)=>{return f$.mergeObjectSync(U,Q)});else return f$.mergeObjectSync(U,W)}get shape(){return this._def.shape()}strict($){return x.errToObj,new E$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let b=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:x.errToObj($).message??b};return{message:b}}}:{}})}strip(){return new E$({...this._def,unknownKeys:"strip"})}passthrough(){return new E$({...this._def,unknownKeys:"passthrough"})}extend($){return new E$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new E$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:F.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new E$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new E$({...this._def,shape:()=>I})}deepPartial(){return A1(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let b=this.shape[U];if($&&!$[U])I[U]=b;else I[U]=b.optional()}return new E$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let w=this.shape[U];while(w instanceof J6)w=w._def.innerType;I[U]=w}return new E$({...this._def,shape:()=>I})}keyof(){return yH($$.objectKeys(this.shape))}}E$.create=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};E$.strictCreate=($,I)=>{return new E$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};E$.lazycreate=($,I)=>{return new E$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:F.ZodObject,...d(I)})};class CI extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function b(w){for(let D of w)if(D.result.status==="valid")return D.result;for(let D of w)if(D.result.status==="dirty")return I.common.issues.push(...D.ctx.common.issues),D.result;let X=w.map((D)=>new X6(D.ctx.common.issues));return T(I,{code:M.invalid_union,unionErrors:X}),r}if(I.common.async)return Promise.all(U.map(async(w)=>{let X={...I,common:{...I.common,issues:[]},parent:null};return{result:await w._parseAsync({data:I.data,path:I.path,parent:X}),ctx:X}})).then(b);else{let w=void 0,X=[];for(let W of U){let Q={...I,common:{...I.common,issues:[]},parent:null},G=W._parseSync({data:I.data,path:I.path,parent:Q});if(G.status==="valid")return G;else if(G.status==="dirty"&&!w)w={result:G,ctx:Q};if(Q.common.issues.length)X.push(Q.common.issues)}if(w)return I.common.issues.push(...w.ctx.common.issues),w.result;let D=X.map((W)=>new X6(W));return T(I,{code:M.invalid_union,unionErrors:D}),r}}get options(){return this._def.options}}CI.create=($,I)=>{return new CI({options:$,typeName:F.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof xI)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof hI)return[$.value];else if($ instanceof l4)return $.options;else if($ instanceof fI)return $$.objectValues($.enum);else if($ instanceof yI)return d6($._def.innerType);else if($ instanceof _I)return[void 0];else if($ instanceof ZI)return[null];else if($ instanceof J6)return[void 0,...d6($.unwrap())];else if($ instanceof G4)return[null,...d6($.unwrap())];else if($ instanceof bW)return d6($.unwrap());else if($ instanceof lI)return d6($.unwrap());else if($ instanceof uI)return d6($._def.innerType);else return[]};class wW extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:M.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,b=I.data[U],w=this.optionsMap.get(b);if(!w)return T(I,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return w._parseAsync({data:I.data,path:I.path,parent:I});else return w._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let b=new Map;for(let w of I){let X=d6(w.shape[$]);if(!X.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let D of X){if(b.has(D))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(D)}`);b.set(D,w)}}return new wW({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:b,...d(U)})}}function UW($,I){let U=o6($),b=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&b===R.object){let w=$$.objectKeys(I),X=$$.objectKeys($).filter((W)=>w.indexOf(W)!==-1),D={...$,...I};for(let W of X){let Q=UW($[W],I[W]);if(!Q.valid)return{valid:!1};D[W]=Q.data}return{valid:!0,data:D}}else if(U===R.array&&b===R.array){if($.length!==I.length)return{valid:!1};let w=[];for(let X=0;X<$.length;X++){let D=$[X],W=I[X],Q=UW(D,W);if(!Q.valid)return{valid:!1};w.push(Q.data)}return{valid:!0,data:w}}else if(U===R.date&&b===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class gI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),b=(w,X)=>{if(sD(w)||sD(X))return r;let D=UW(w.value,X.value);if(!D.valid)return T(U,{code:M.invalid_intersection_types}),r;if($W(w)||$W(X))I.dirty();return{status:I.value,value:D.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([w,X])=>b(w,X));else return b(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}gI.create=($,I,U)=>{return new gI({left:$,right:I,typeName:F.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:M.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&U.data.length>this._def.items.length)T(U,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let w=[...U.data].map((X,D)=>{let W=this._def.items[D]||this._def.rest;if(!W)return null;return W._parse(new V6(U,X,U.path,D))}).filter((X)=>!!X);if(U.common.async)return Promise.all(w).then((X)=>{return f$.mergeArray(I,X)});else return f$.mergeArray(I,w)}get items(){return this._def.items}rest($){return new a6({...this._def,rest:$})}}a6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new a6({items:$,typeName:F.ZodTuple,rest:null,...d(I)})};class Ww extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.object)return T(U,{code:M.invalid_type,expected:R.object,received:U.parsedType}),r;let b=[],w=this._def.keyType,X=this._def.valueType;for(let D in U.data)b.push({key:w._parse(new V6(U,D,U.path,D)),value:X._parse(new V6(U,U.data[D],U.path,D)),alwaysSet:D in U.data});if(U.common.async)return f$.mergeObjectAsync(I,b);else return f$.mergeObjectSync(I,b)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new Ww({keyType:$,valueType:I,typeName:F.ZodRecord,...d(U)});return new Ww({keyType:p6.create(),valueType:$,typeName:F.ZodRecord,...d(I)})}}class Qw extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.map)return T(U,{code:M.invalid_type,expected:R.map,received:U.parsedType}),r;let b=this._def.keyType,w=this._def.valueType,X=[...U.data.entries()].map(([D,W],Q)=>{return{key:b._parse(new V6(U,D,U.path,[Q,"key"])),value:w._parse(new V6(U,W,U.path,[Q,"value"]))}});if(U.common.async){let D=new Map;return Promise.resolve().then(async()=>{for(let W of X){let Q=await W.key,G=await W.value;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}})}else{let D=new Map;for(let W of X){let{key:Q,value:G}=W;if(Q.status==="aborted"||G.status==="aborted")return r;if(Q.status==="dirty"||G.status==="dirty")I.dirty();D.set(Q.value,G.value)}return{status:I.value,value:D}}}}Qw.create=($,I,U)=>{return new Qw({valueType:I,keyType:$,typeName:F.ZodMap,...d(U)})};class L1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:M.invalid_type,expected:R.set,received:U.parsedType}),r;let b=this._def;if(b.minSize!==null){if(U.data.size<b.minSize.value)T(U,{code:M.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),I.dirty()}if(b.maxSize!==null){if(U.data.size>b.maxSize.value)T(U,{code:M.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),I.dirty()}let w=this._def.valueType;function X(W){let Q=new Set;for(let G of W){if(G.status==="aborted")return r;if(G.status==="dirty")I.dirty();Q.add(G.value)}return{status:I.value,value:Q}}let D=[...U.data.values()].map((W,Q)=>w._parse(new V6(U,W,U.path,Q)));if(U.common.async)return Promise.all(D).then((W)=>X(W));else return X(D)}min($,I){return new L1({...this._def,minSize:{value:$,message:x.toString(I)}})}max($,I){return new L1({...this._def,maxSize:{value:$,message:x.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}L1.create=($,I)=>{return new L1({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...d(I)})};class RI extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:M.invalid_type,expected:R.function,received:I.parsedType}),r;function U(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_arguments,argumentsError:W}})}function b(D,W){return Uw({data:D,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,PI(),Q4].filter((Q)=>!!Q),issueData:{code:M.invalid_return_type,returnTypeError:W}})}let w={errorMap:I.common.contextualErrorMap},X=I.data;if(this._def.returns instanceof K1){let D=this;return c$(async function(...W){let Q=new X6([]),G=await D._def.args.parseAsync(W,w).catch((H)=>{throw Q.addIssue(U(W,H)),Q}),Y=await Reflect.apply(X,this,G);return await D._def.returns._def.type.parseAsync(Y,w).catch((H)=>{throw Q.addIssue(b(Y,H)),Q})})}else{let D=this;return c$(function(...W){let Q=D._def.args.safeParse(W,w);if(!Q.success)throw new X6([U(W,Q.error)]);let G=Reflect.apply(X,this,Q.data),Y=D._def.returns.safeParse(G,w);if(!Y.success)throw new X6([b(G,Y.error)]);return Y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new RI({...this._def,args:a6.create($).rest(u4.create())})}returns($){return new RI({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new RI({args:$?$:a6.create([]).rest(u4.create()),returns:I||u4.create(),typeName:F.ZodFunction,...d(U)})}}class xI extends e{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}xI.create=($,I)=>{return new xI({getter:$,typeName:F.ZodLazy,...d(I)})};class hI extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:M.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}hI.create=($,I)=>{return new hI({value:$,typeName:F.ZodLiteral,...d(I)})};function yH($,I){return new l4({values:$,typeName:F.ZodEnum,...d(I)})}class l4 extends e{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{expected:$$.joinValues(U),received:I.parsedType,code:M.invalid_type}),r}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{received:I.data,code:M.invalid_enum_value,options:U}),r}return c$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return l4.create($,{...this._def,...I})}exclude($,I=this._def){return l4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}l4.create=yH;class fI extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let b=$$.objectValues(I);return T(U,{expected:$$.joinValues(b),received:U.parsedType,code:M.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let b=$$.objectValues(I);return T(U,{received:U.data,code:M.invalid_enum_value,options:b}),r}return c$($.data)}get enum(){return this._def.values}}fI.create=($,I)=>{return new fI({values:$,typeName:F.ZodNativeEnum,...d(I)})};class K1 extends e{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.promise&&I.common.async===!1)return T(I,{code:M.invalid_type,expected:R.promise,received:I.parsedType}),r;let U=I.parsedType===R.promise?I.data:Promise.resolve(I.data);return c$(U.then((b)=>{return this._def.type.parseAsync(b,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}K1.create=($,I)=>{return new K1({type:$,typeName:F.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),b=this._def.effect||null,w={addIssue:(X)=>{if(T(U,X),X.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(w.addIssue=w.addIssue.bind(w),b.type==="preprocess"){let X=b.transform(U.data,w);if(U.common.async)return Promise.resolve(X).then(async(D)=>{if(I.value==="aborted")return r;let W=await this._def.schema._parseAsync({data:D,path:U.path,parent:U});if(W.status==="aborted")return r;if(W.status==="dirty")return H1(W.value);if(I.value==="dirty")return H1(W.value);return W});else{if(I.value==="aborted")return r;let D=this._def.schema._parseSync({data:X,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")return H1(D.value);if(I.value==="dirty")return H1(D.value);return D}}if(b.type==="refinement"){let X=(D)=>{let W=b.refinement(D,w);if(U.common.async)return Promise.resolve(W);if(W instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return D};if(U.common.async===!1){let D=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value),{status:I.value,value:D.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((D)=>{if(D.status==="aborted")return r;if(D.status==="dirty")I.dirty();return X(D.value).then(()=>{return{status:I.value,value:D.value}})})}if(b.type==="transform")if(U.common.async===!1){let X=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!y4(X))return r;let D=b.transform(X.value,w);if(D instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:D}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((X)=>{if(!y4(X))return r;return Promise.resolve(b.transform(X.value,w)).then((D)=>({status:I.value,value:D}))});$$.assertNever(b)}}g6.create=($,I,U)=>{return new g6({schema:$,typeName:F.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...d(U)})};class J6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}J6.create=($,I)=>{return new J6({innerType:$,typeName:F.ZodOptional,...d(I)})};class G4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}G4.create=($,I)=>{return new G4({innerType:$,typeName:F.ZodNullable,...d(I)})};class yI extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===R.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}yI.create=($,I)=>{return new yI({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class uI extends e{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},b=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(kI(b))return b.then((w)=>{return{status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new X6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}uI.create=($,I)=>{return new uI({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class Gw extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:M.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}Gw.create=($)=>{return new Gw({typeName:F.ZodNaN,...d($)})};var Al=Symbol("zod_brand");class bW extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class Yw extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let w=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(w.status==="aborted")return r;if(w.status==="dirty")return I.dirty(),H1(w.value);else return this._def.out._parseAsync({data:w.value,path:U.path,parent:U})})();else{let b=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return I.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:U.path,parent:U})}}static create($,I){return new Yw({in:$,out:I,typeName:F.ZodPipeline})}}class lI extends e{_parse($){let I=this._def.innerType._parse($),U=(b)=>{if(y4(b))b.value=Object.freeze(b.value);return b};return kI(I)?I.then((b)=>U(b)):U(I)}unwrap(){return this._def.innerType}}lI.create=($,I)=>{return new lI({innerType:$,typeName:F.ZodReadonly,...d(I)})};var Ol={object:E$.lazycreate},F;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(F||(F={}));var zl=p6.create,Ll=O1.create,Kl=Gw.create,vl=z1.create,Vl=ww.create,ql=TI.create,Ml=bw.create,Fl=_I.create,jl=ZI.create,El=Xw.create,Sl=u4.create,Pl=t6.create,kl=Dw.create,Rl=C6.create,uH=E$.create,Tl=E$.strictCreate,_l=CI.create,Zl=wW.create,Cl=gI.create,gl=a6.create,xl=Ww.create,hl=Qw.create,fl=L1.create,yl=RI.create,ul=xI.create,ll=hI.create,cl=l4.create,ml=fI.create,rl=K1.create,nl=g6.create,il=J6.create,ol=G4.create,dl=g6.createWithPreprocess,pl=Yw.create;var kj=Object.freeze({status:"aborted"});function v($,I,U){function b(W,Q){var G;Object.defineProperty(W,"_zod",{value:W._zod??{},enumerable:!1}),(G=W._zod).traits??(G.traits=new Set),W._zod.traits.add($),I(W,Q);for(let Y in D.prototype)if(!(Y in W))Object.defineProperty(W,Y,{value:D.prototype[Y].bind(W)});W._zod.constr=D,W._zod.def=Q}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let Y of G._zod.deferred)Y();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var Rj=Symbol("zod_brand");class Y4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Nw={};function D6($){if($)Object.assign(Nw,$);return Nw}var I$={};v6(I$,{unwrapMessage:()=>cI,stringifyPrimitive:()=>Hw,required:()=>oj,randomString:()=>fj,propertyKeyTypes:()=>YW,promiseAllObject:()=>hj,primitiveTypes:()=>lH,prefixIssues:()=>x6,pick:()=>cj,partial:()=>ij,optionalKeys:()=>NW,omit:()=>mj,numKeys:()=>yj,nullish:()=>nI,normalizeParams:()=>m,merge:()=>nj,jsonStringifyReplacer:()=>DW,joinValues:()=>Jw,issue:()=>BW,isPlainObject:()=>V1,isObject:()=>v1,getSizableOrigin:()=>mH,getParsedType:()=>uj,getLengthableOrigin:()=>oI,getEnumValues:()=>mI,getElementAtPath:()=>xj,floatSafeRemainder:()=>WW,finalizeIssue:()=>q6,extend:()=>rj,escapeRegex:()=>N4,esc:()=>c4,defineLazy:()=>O$,createTransparentProxy:()=>lj,clone:()=>W6,cleanRegex:()=>iI,cleanEnum:()=>dj,captureStackTrace:()=>Bw,cached:()=>rI,assignProp:()=>QW,assertNotEqual:()=>_j,assertNever:()=>Cj,assertIs:()=>Zj,assertEqual:()=>Tj,assert:()=>gj,allowsEval:()=>GW,aborted:()=>m4,NUMBER_FORMAT_RANGES:()=>JW,Class:()=>rH,BIGINT_FORMAT_RANGES:()=>cH});function Tj($){return $}function _j($){return $}function Zj($){}function Cj($){throw new Error}function gj($){}function mI($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function Jw($,I="|"){return $.map((U)=>Hw(U)).join(I)}function DW($,I){if(typeof I==="bigint")return I.toString();return I}function rI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function nI($){return $===null||$===void 0}function iI($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function WW($,I){let U=($.toString().split(".")[1]||"").length,b=(I.toString().split(".")[1]||"").length,w=U>b?U:b,X=Number.parseInt($.toFixed(w).replace(".","")),D=Number.parseInt(I.toFixed(w).replace(".",""));return X%D/10**w}function O$($,I,U){Object.defineProperty($,I,{get(){{let w=U();return $[I]=w,w}throw new Error("cached value already set")},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function QW($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function xj($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function hj($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function fj($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function c4($){return JSON.stringify($)}var Bw=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function v1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var GW=rI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function V1($){if(v1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(v1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function yj($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var uj=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},YW=new Set(["string","number","symbol"]),lH=new Set(["string","number","bigint","boolean","symbol","undefined"]);function N4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W6($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function m($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function lj($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function Hw($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function NW($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var JW={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},cH={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cj($,I){let U={},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;U[w]=b.shape[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function mj($,I){let U={...$._zod.def.shape},b=$._zod.def;for(let w in I){if(!(w in b.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete U[w]}return W6($,{...$._zod.def,shape:U,checks:[]})}function rj($,I){if(!V1(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return QW(this,"shape",b),b},checks:[]};return W6($,U)}function nj($,I){return W6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return QW(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function ij($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in b))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=$?new $({type:"optional",innerType:b[X]}):b[X]}else for(let X in b)w[X]=$?new $({type:"optional",innerType:b[X]}):b[X];return W6(I,{...I._zod.def,shape:w,checks:[]})}function oj($,I,U){let b=I._zod.def.shape,w={...b};if(U)for(let X in U){if(!(X in w))throw new Error(`Unrecognized key: "${X}"`);if(!U[X])continue;w[X]=new $({type:"nonoptional",innerType:b[X]})}else for(let X in b)w[X]=new $({type:"nonoptional",innerType:b[X]});return W6(I,{...I._zod.def,shape:w,checks:[]})}function m4($,I=0){for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function x6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function cI($){return typeof $==="string"?$:$?.message}function q6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=cI($.inst?._zod.def?.error?.($))??cI(I?.error?.($))??cI(U.customError?.($))??cI(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function mH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function oI($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function BW(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function dj($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class rH{constructor(...$){}}var nH=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(I,DW,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Aw=v("$ZodError",nH),dI=v("$ZodError",nH,{Parent:Error});function HW($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function AW($,I){let U=I||function(X){return X.message},b={_errors:[]},w=(X)=>{for(let D of X.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((W)=>w({issues:W}));else if(D.code==="invalid_key")w({issues:D.issues});else if(D.code==="invalid_element")w({issues:D.issues});else if(D.path.length===0)b._errors.push(U(D));else{let W=b,Q=0;while(Q<D.path.length){let G=D.path[Q];if(Q!==D.path.length-1)W[G]=W[G]||{_errors:[]};else W[G]=W[G]||{_errors:[]},W[G]._errors.push(U(D));W=W[G],Q++}}};return w($),b}var OW=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new Y4;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Bw(W,w?.callee),W}return D.value},zW=OW(dI),LW=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>q6(Q,X,D6())));throw Bw(W,w?.callee),W}return D.value},KW=LW(dI),vW=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new Y4;return X.issues.length?{success:!1,error:new($??Aw)(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},r4=vW(dI),VW=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>q6(D,w,D6())))}:{success:!0,data:X.value}},n4=VW(dI);var iH=/^[cC][^\s-]{8,}$/,oH=/^[0-9a-z]+$/,dH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pH=/^[0-9a-vA-V]{20}$/,tH=/^[A-Za-z0-9]{27}$/,aH=/^[a-zA-Z0-9_-]{21}$/,eH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var sH=/^([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})$/,qW=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var $A=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function IA(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var UA=/^(?:(?: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])$/,wA=/^(([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})$/,bA=/^((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])$/,XA=/^(([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])$/,DA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,MW=/^[A-Za-z0-9_-]*$/,WA=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var QA=/^\+(?:[0-9]){6,14}[0-9]$/,GA="(?:(?:\\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])))",YA=new RegExp(`^${GA}$`);function NA($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function JA($){return new RegExp(`^${NA($)}$`)}function BA($){let I=NA({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${GA}T(?:${b})$`)}var HA=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var AA=/^\d+$/,OA=/^-?\d+(?:\.\d+)?/i,zA=/true|false/i,LA=/null/i;var KA=/^[^A-Z]*$/,vA=/^[^a-z]*$/;var Z$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),VA={number:"number",bigint:"bigint",object:"date"},FW=v("$ZodCheckLessThan",($,I)=>{Z$.init($,I);let U=VA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),jW=v("$ZodCheckGreaterThan",($,I)=>{Z$.init($,I);let U=VA[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),qA=v("$ZodCheckMultipleOf",($,I)=>{Z$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):WW(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),MA=v("$ZodCheckNumberFormat",($,I)=>{Z$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=JW[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=AA}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}});var FA=v("$ZodCheckMaxLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=oI(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),jA=v("$ZodCheckMinLength",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=oI(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),EA=v("$ZodCheckLengthEquals",($,I)=>{var U;Z$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!nI(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=oI(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),pI=v("$ZodCheckStringFormat",($,I)=>{var U,b;if(Z$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),SA=v("$ZodCheckRegex",($,I)=>{pI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),PA=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=KA),pI.init($,I)}),kA=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=vA),pI.init($,I)}),RA=v("$ZodCheckIncludes",($,I)=>{Z$.init($,I);let U=N4(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),TA=v("$ZodCheckStartsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`^${N4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),_A=v("$ZodCheckEndsWith",($,I)=>{Z$.init($,I);let U=new RegExp(`.*${N4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});var ZA=v("$ZodCheckOverwrite",($,I)=>{Z$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class EW{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
10
10
  `).filter((X)=>X),b=Math.min(...U.map((X)=>X.length-X.trimStart().length)),w=U.map((X)=>X.slice(b)).map((X)=>" ".repeat(this.indent*2)+X);for(let X of w)this.content.push(X)}compile(){let $=Function,I=this?.args,b=[...(this?.content??[""]).map((w)=>` ${w}`)];return new $(...I,b.join(`
11
- `))}}var KA={major:4,minor:0,patch:0};var N$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=KA;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(X,D,W)=>{let Q=c4(X),G;for(let N of D){if(N._zod.def.when){if(!N._zod.def.when(X))continue}else if(Q)continue;let B=X.issues.length,H=N._zod.check(X);if(H instanceof Promise&&W?.async===!1)throw new G4;if(G||H instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await H,X.issues.length===B)return;if(!Q)Q=c4(X,B)});else{if(X.issues.length===B)continue;if(!Q)Q=c4(X,B)}}if(G)return G.then(()=>{return X});return X};$._zod.run=(X,D)=>{let W=$._zod.parse(X,D);if(W instanceof Promise){if(D.async===!1)throw new G4;return W.then((Q)=>w(Q,b,D))}return w(W,b,D)}}$["~standard"]={validate:(w)=>{try{let X=m4($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return r4($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),dI=v("$ZodString",($,I)=>{N$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??eH($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),z$=v("$ZodStringFormat",($,I)=>{oI.init($,I),dI.init($,I)}),LW=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=hH),z$.init($,I)}),KW=v("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=BW(b))}else I.pattern??(I.pattern=BW());z$.init($,I)}),vW=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=fH),z$.init($,I)}),VW=v("$ZodURL",($,I)=>{z$.init($,I),$._zod.check=(U)=>{try{let b=U.value,w=new URL(b),X=w.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:nH.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!b.endsWith("/")&&X.endsWith("/"))U.value=X.slice(0,-1);else U.value=X;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),qW=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=yH()),z$.init($,I)}),FW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=gH),z$.init($,I)}),MW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=RH),z$.init($,I)}),jW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=TH),z$.init($,I)}),EW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=_H),z$.init($,I)}),SW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=ZH),z$.init($,I)}),PW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=CH),z$.init($,I)}),kA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=aH(I)),z$.init($,I)}),RA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=dH),z$.init($,I)}),TA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=tH(I)),z$.init($,I)}),_A=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=xH),z$.init($,I)}),kW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=uH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),RW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=lH),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv6"}),$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),TW=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=cH),z$.init($,I)}),_W=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=mH),z$.init($,I),$._zod.check=(U)=>{let[b,w]=U.value.split("/");try{if(!w)throw new Error;let X=Number(w);if(`${X}`!==w)throw new Error;if(X<0||X>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function ZA($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var ZW=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=rH),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(ZA(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function _j($){if(!JW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return ZA(U)}var CW=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=JW),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(_j(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),gW=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=iH),z$.init($,I)});function Zj($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var xW=v("$ZodJWT",($,I)=>{z$.init($,I),$._zod.check=(U)=>{if(Zj(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var Bw=v("$ZodNumber",($,I)=>{N$.init($,I),$._zod.pattern=$._zod.bag.pattern??$A,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),hW=v("$ZodNumber",($,I)=>{WA.init($,I),Bw.init($,I)}),fW=v("$ZodBoolean",($,I)=>{N$.init($,I),$._zod.pattern=IA,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}});var yW=v("$ZodNull",($,I)=>{N$.init($,I),$._zod.pattern=UA,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}});var uW=v("$ZodUnknown",($,I)=>{N$.init($,I),$._zod.parse=(U)=>U}),lW=v("$ZodNever",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function vA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var cW=v("$ZodArray",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>vA(G,U,D)));else vA(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Yw($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function VA($,I,U,b){if($.issues.length)if(b[U]===void 0)if(U in b)I.value[U]=void 0;else I.value[U]=$.value;else I.issues.push(...x6(U,$.issues));else if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}var Jw=v("$ZodObject",($,I)=>{N$.init($,I);let U=cI(()=>{let B=Object.keys(I.shape);for(let J of B)if(!(I.shape[J]instanceof N$))throw new Error(`Invalid element at key "${J}": expected a Zod schema`);let H=IW(I.shape);return{shape:I.shape,keys:B,keySet:new Set(B),numKeys:B.length,optionalKeys:new Set(H)}});O$($._zod,"propValues",()=>{let B=I.shape,H={};for(let J in B){let A=B[J]._zod;if(A.values){H[J]??(H[J]=new Set);for(let O of A.values)H[J].add(O)}}return H});let b=(B)=>{let H=new OW(["shape","payload","ctx"]),J=U.value,A=(k)=>{let P=l4(k);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};H.write("const input = payload.value;");let O=Object.create(null),V=0;for(let k of J.keys)O[k]=`key_${V++}`;H.write("const newResult = {}");for(let k of J.keys)if(J.optionalKeys.has(k)){let P=O[k];H.write(`const ${P} = ${A(k)};`);let x=l4(k);H.write(`
11
+ `))}}var gA={major:4,minor:0,patch:0};var Y$=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=gA;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(X,D,W)=>{let Q=m4(X),G;for(let Y of D){if(Y._zod.def.when){if(!Y._zod.def.when(X))continue}else if(Q)continue;let J=X.issues.length,H=Y._zod.check(X);if(H instanceof Promise&&W?.async===!1)throw new Y4;if(G||H instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await H,X.issues.length===J)return;if(!Q)Q=m4(X,J)});else{if(X.issues.length===J)continue;if(!Q)Q=m4(X,J)}}if(G)return G.then(()=>{return X});return X};$._zod.run=(X,D)=>{let W=$._zod.parse(X,D);if(W instanceof Promise){if(D.async===!1)throw new Y4;return W.then((Q)=>w(Q,b,D))}return w(W,b,D)}}$["~standard"]={validate:(w)=>{try{let X=r4($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return n4($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),tI=v("$ZodString",($,I)=>{Y$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??HA($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),z$=v("$ZodStringFormat",($,I)=>{pI.init($,I),tI.init($,I)}),PW=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=sH),z$.init($,I)}),kW=v("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=qW(b))}else I.pattern??(I.pattern=qW());z$.init($,I)}),RW=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=$A),z$.init($,I)}),TW=v("$ZodURL",($,I)=>{z$.init($,I),$._zod.check=(U)=>{try{let b=U.value,w=new URL(b),X=w.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:WA.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!b.endsWith("/")&&X.endsWith("/"))U.value=X.slice(0,-1);else U.value=X;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),_W=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=IA()),z$.init($,I)}),ZW=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=aH),z$.init($,I)}),CW=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=iH),z$.init($,I)}),gW=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=oH),z$.init($,I)}),xW=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=dH),z$.init($,I)}),hW=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=pH),z$.init($,I)}),fW=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=tH),z$.init($,I)}),nA=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=BA(I)),z$.init($,I)}),iA=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=YA),z$.init($,I)}),oA=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=JA(I)),z$.init($,I)}),dA=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=eH),z$.init($,I)}),yW=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=UA),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv4"})}),uW=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=wA),z$.init($,I),$._zod.onattach.push((U)=>{let b=U._zod.bag;b.format="ipv6"}),$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),lW=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=bA),z$.init($,I)}),cW=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=XA),z$.init($,I),$._zod.check=(U)=>{let[b,w]=U.value.split("/");try{if(!w)throw new Error;let X=Number(w);if(`${X}`!==w)throw new Error;if(X<0||X>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function pA($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mW=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=DA),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(pA(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function tj($){if(!MW.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return pA(U)}var rW=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=MW),z$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(tj(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nW=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=QA),z$.init($,I)});function aj($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var iW=v("$ZodJWT",($,I)=>{z$.init($,I),$._zod.check=(U)=>{if(aj(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var Lw=v("$ZodNumber",($,I)=>{Y$.init($,I),$._zod.pattern=$._zod.bag.pattern??OA,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),oW=v("$ZodNumber",($,I)=>{MA.init($,I),Lw.init($,I)}),dW=v("$ZodBoolean",($,I)=>{Y$.init($,I),$._zod.pattern=zA,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}});var pW=v("$ZodNull",($,I)=>{Y$.init($,I),$._zod.pattern=LA,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}});var tW=v("$ZodUnknown",($,I)=>{Y$.init($,I),$._zod.parse=(U)=>U}),aW=v("$ZodNever",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function xA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var eW=v("$ZodArray",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>xA(G,U,D)));else xA(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function zw($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function hA($,I,U,b){if($.issues.length)if(b[U]===void 0)if(U in b)I.value[U]=void 0;else I.value[U]=$.value;else I.issues.push(...x6(U,$.issues));else if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}var Kw=v("$ZodObject",($,I)=>{Y$.init($,I);let U=rI(()=>{let J=Object.keys(I.shape);for(let B of J)if(!(I.shape[B]instanceof Y$))throw new Error(`Invalid element at key "${B}": expected a Zod schema`);let H=NW(I.shape);return{shape:I.shape,keys:J,keySet:new Set(J),numKeys:J.length,optionalKeys:new Set(H)}});O$($._zod,"propValues",()=>{let J=I.shape,H={};for(let B in J){let A=J[B]._zod;if(A.values){H[B]??(H[B]=new Set);for(let O of A.values)H[B].add(O)}}return H});let b=(J)=>{let H=new EW(["shape","payload","ctx"]),B=U.value,A=(k)=>{let P=c4(k);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};H.write("const input = payload.value;");let O=Object.create(null),V=0;for(let k of B.keys)O[k]=`key_${V++}`;H.write("const newResult = {}");for(let k of B.keys)if(B.optionalKeys.has(k)){let P=O[k];H.write(`const ${P} = ${A(k)};`);let h=c4(k);H.write(`
12
12
  if (${P}.issues.length) {
13
- if (input[${x}] === undefined) {
14
- if (${x} in input) {
15
- newResult[${x}] = undefined;
13
+ if (input[${h}] === undefined) {
14
+ if (${h} in input) {
15
+ newResult[${h}] = undefined;
16
16
  }
17
17
  } else {
18
18
  payload.issues = payload.issues.concat(
19
19
  ${P}.issues.map((iss) => ({
20
20
  ...iss,
21
- path: iss.path ? [${x}, ...iss.path] : [${x}],
21
+ path: iss.path ? [${h}, ...iss.path] : [${h}],
22
22
  }))
23
23
  );
24
24
  }
25
25
  } else if (${P}.value === undefined) {
26
- if (${x} in input) newResult[${x}] = undefined;
26
+ if (${h} in input) newResult[${h}] = undefined;
27
27
  } else {
28
- newResult[${x}] = ${P}.value;
28
+ newResult[${h}] = ${P}.value;
29
29
  }
30
30
  `)}else{let P=O[k];H.write(`const ${P} = ${A(k)};`),H.write(`
31
31
  if (${P}.issues.length) payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
32
32
  ...iss,
33
- path: iss.path ? [${l4(k)}, ...iss.path] : [${l4(k)}]
34
- })));`),H.write(`newResult[${l4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(B,k,P)},w,X=K1,D=!Xw.jitless,Q=D&&sD.value,G=I.catchall,N;$._zod.parse=(B,H)=>{N??(N=U.value);let J=B.value;if(!X(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),B;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);B=w(B,H)}else{B.value={};let P=N.shape;for(let x of N.keys){let l=P[x],l$=l._zod.run({value:J[x],issues:[]},H),Y6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>Y6?VA(B1,B,x,J):Yw(B1,B,x)));else if(Y6)VA(l$,B,x,J);else Yw(l$,B,x)}}if(!G)return A.length?Promise.all(A).then(()=>B):B;let O=[],V=N.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(J)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let x=q.run({value:J[P],issues:[]},H);if(x instanceof Promise)A.push(x.then((l)=>Yw(l,B,P)));else Yw(x,B,P)}if(O.length)B.issues.push({code:"unrecognized_keys",keys:O,input:J,inst:$});if(!A.length)return B;return Promise.all(A).then(()=>{return B})}});function qA($,I,U,b){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((X)=>q6(X,b,D6())))}),I}var Hw=v("$ZodUnion",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),O$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),O$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),O$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((b)=>b._zod.pattern);return new RegExp(`^(${U.map((b)=>rI(b.source)).join("|")})$`)}return}),$._zod.parse=(U,b)=>{let w=!1,X=[];for(let D of I.options){let W=D._zod.run({value:U.value,issues:[]},b);if(W instanceof Promise)X.push(W),w=!0;else{if(W.issues.length===0)return W;X.push(W)}}if(!w)return qA(X,U,$,b);return Promise.all(X).then((D)=>{return qA(D,U,$,b)})}}),mW=v("$ZodDiscriminatedUnion",($,I)=>{Hw.init($,I);let U=$._zod.parse;O$($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=cI(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!K1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:D,path:[I.discriminator],inst:$}),w}}),rW=v("$ZodIntersection",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return FA(U,Q,G)});return FA(U,X,D)}});function zW($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(v1($)&&v1(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=zW($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=zW(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function FA($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(c4($))return $;let b=zW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var nW=v("$ZodRecord",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!v1(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[];if(I.keyType._zod.values){let D=I.keyType._zod.values;U.value={};for(let Q of D)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){let G=I.valueType._zod.run({value:w[Q],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...x6(Q,N.issues));U.value[Q]=N.value}));else{if(G.issues.length)U.issues.push(...x6(Q,G.issues));U.value[Q]=G.value}}let W;for(let Q in w)if(!D.has(Q))W=W??[],W.push(Q);if(W&&W.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:W})}else{U.value={};for(let D of Reflect.ownKeys(w)){if(D==="__proto__")continue;let W=I.keyType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(W.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:W.issues.map((G)=>q6(G,b,D6())),input:D,path:[D],inst:$}),U.value[W.value]=W.value;continue}let Q=I.valueType._zod.run({value:w[D],issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>{if(G.issues.length)U.issues.push(...x6(D,G.issues));U.value[W.value]=G.value}));else{if(Q.issues.length)U.issues.push(...x6(D,Q.issues));U.value[W.value]=Q.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}});var iW=v("$ZodEnum",($,I)=>{N$.init($,I);let U=lI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>$W.has(typeof b)).map((b)=>typeof b==="string"?N4(b):b.toString()).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if($._zod.values.has(X))return b;return b.issues.push({code:"invalid_value",values:U,input:X,inst:$}),b}}),oW=v("$ZodLiteral",($,I)=>{N$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?N4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,b)=>{let w=U.value;if($._zod.values.has(w))return U;return U.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),U}});var dW=v("$ZodTransform",($,I)=>{N$.init($,I),$._zod.parse=(U,b)=>{let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new G4;return U.value=w,U}}),pW=v("$ZodOptional",($,I)=>{N$.init($,I),$._zod.optin="optional",$._zod.optout="optional",O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,b);if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),tW=v("$ZodNullable",($,I)=>{N$.init($,I),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${rI(U.source)}|null)$`):void 0}),O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),aW=v("$ZodDefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>MA(X,I));return MA(w,I)}});function MA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var eW=v("$ZodPrefault",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),sW=v("$ZodNonOptional",($,I)=>{N$.init($,I),O$($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>jA(X,$));return jA(w,$)}});function jA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var $9=v("$ZodCatch",($,I)=>{N$.init($,I),$._zod.optin="optional",O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>q6(D,b,D6()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>q6(X,b,D6()))},input:U.value}),U.issues=[];return U}});var I9=v("$ZodPipe",($,I)=>{N$.init($,I),O$($._zod,"values",()=>I.in._zod.values),O$($._zod,"optin",()=>I.in._zod.optin),O$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,b)=>{let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>EA(X,I,b));return EA(w,I,b)}});function EA($,I,U){if(c4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var U9=v("$ZodReadonly",($,I)=>{N$.init($,I),O$($._zod,"propValues",()=>I.innerType._zod.propValues),O$($._zod,"values",()=>I.innerType._zod.values),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(SA);return SA(w)}});function SA($){return $.value=Object.freeze($.value),$}var w9=v("$ZodCustom",($,I)=>{Z$.init($,I),N$.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>PA(X,U,b,$));PA(w,U,b,$);return}});function PA($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(wW(w))}}var Cj=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},gj=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Cj(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Qw(b.values[0])}`;return`Invalid option: expected one of ${Dw(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${Dw(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function b9(){return{localeError:gj()}}var xj=Symbol("ZodOutput"),hj=Symbol("ZodInput");class Aw{constructor(){this._map=new Map,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};return delete U.id,{...U,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function CA(){return new Aw}var Y4=CA();function X9($,I){return new $({type:"string",...m(I)})}function D9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function Ow($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function W9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function Q9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function G9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function N9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function Y9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function B9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function J9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function H9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function A9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function O9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function K9($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function v9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function V9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function gA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function xA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function hA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function fA($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function S9($,I){return new $({type:"number",checks:[],...m(I)})}function P9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function k9($,I){return new $({type:"boolean",...m(I)})}function R9($,I){return new $({type:"null",...m(I)})}function T9($){return new $({type:"unknown"})}function _9($,I){return new $({type:"never",...m(I)})}function zw($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!1})}function pI($,I){return new HW({check:"less_than",...m(I),value:$,inclusive:!0})}function Lw($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!1})}function tI($,I){return new AW({check:"greater_than",...m(I),value:$,inclusive:!0})}function Kw($,I){return new DA({check:"multiple_of",...m(I),value:$})}function vw($,I){return new QA({check:"max_length",...m(I),maximum:$})}function V1($,I){return new GA({check:"min_length",...m(I),minimum:$})}function Vw($,I){return new NA({check:"length_equals",...m(I),length:$})}function Z9($,I){return new YA({check:"string_format",format:"regex",...m(I),pattern:$})}function C9($){return new BA({check:"string_format",format:"lowercase",...m($)})}function g9($){return new JA({check:"string_format",format:"uppercase",...m($)})}function x9($,I){return new HA({check:"string_format",format:"includes",...m(I),includes:$})}function h9($,I){return new AA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function f9($,I){return new OA({check:"string_format",format:"ends_with",...m(I),suffix:$})}function n4($){return new zA({check:"overwrite",tx:$})}function y9($){return n4((I)=>I.normalize($))}function u9(){return n4(($)=>$.trim())}function l9(){return n4(($)=>$.toLowerCase())}function c9(){return n4(($)=>$.toUpperCase())}function yA($,I,U){return new $({type:"array",element:I,...m(U)})}function m9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function r9($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class n9{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??Y4,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,I={path:[],schemaPath:[]}){var U;let b=$._zod.def,w={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X=this.seen.get($);if(X){if(X.count++,I.schemaPath.includes($))X.cycle=I.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...I,schemaPath:[...I.schemaPath,$],path:I.path},B=$._zod.parent;if(B)D.ref=B,this.process(B,N),this.seen.get(B).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let J=H;J.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")J.minLength=A;if(typeof O==="number")J.maxLength=O;if(V){if(J.format=w[V]??V,J.format==="")delete J.format}if(k)J.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)J.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((x)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:x.source}))]}break}case"number":{let J=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))J.type="integer";else J.type="number";if(typeof P==="number")J.exclusiveMinimum=P;if(typeof A==="number"){if(J.minimum=A,typeof P==="number")if(P>=A)delete J.minimum;else delete J.exclusiveMinimum}if(typeof k==="number")J.exclusiveMaximum=k;if(typeof O==="number"){if(J.maximum=O,typeof k==="number")if(k<=O)delete J.maximum;else delete J.exclusiveMaximum}if(typeof q==="number")J.multipleOf=q;break}case"boolean":{let J=H;J.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{H.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{H.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let J=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")J.minItems=A;if(typeof O==="number")J.maxItems=O;J.type="array",J.items=this.process(b.element,{...N,path:[...N.path,"items"]});break}case"object":{let J=H;J.type="object",J.properties={};let A=b.shape;for(let q in A)J.properties[q]=this.process(A[q],{...N,path:[...N.path,"properties",q]});let O=new Set(Object.keys(A)),V=new Set([...O].filter((q)=>{let k=b.shape[q]._zod;if(this.io==="input")return k.optin===void 0;else return k.optout===void 0}));if(V.size>0)J.required=Array.from(V);if(b.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")J.additionalProperties=!1}else if(b.catchall)J.additionalProperties=this.process(b.catchall,{...N,path:[...N.path,"additionalProperties"]});break}case"union":{let J=H;J.anyOf=b.options.map((A,O)=>this.process(A,{...N,path:[...N.path,"anyOf",O]}));break}case"intersection":{let J=H,A=this.process(b.left,{...N,path:[...N.path,"allOf",0]}),O=this.process(b.right,{...N,path:[...N.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];J.allOf=q;break}case"tuple":{let J=H;J.type="array";let A=b.items.map((q,k)=>this.process(q,{...N,path:[...N.path,"prefixItems",k]}));if(this.target==="draft-2020-12")J.prefixItems=A;else J.items=A;if(b.rest){let q=this.process(b.rest,{...N,path:[...N.path,"items"]});if(this.target==="draft-2020-12")J.items=q;else J.additionalItems=q}if(b.rest)J.items=this.process(b.rest,{...N,path:[...N.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")J.minItems=O;if(typeof V==="number")J.maxItems=V;break}case"record":{let J=H;J.type="object",J.propertyNames=this.process(b.keyType,{...N,path:[...N.path,"propertyNames"]}),J.additionalProperties=this.process(b.valueType,{...N,path:[...N.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let J=H,A=lI(b.entries);if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";J.enum=A;break}case"literal":{let J=H,A=[];for(let O of b.values)if(O===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof O==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(O));else A.push(O);if(A.length===0);else if(A.length===1){let O=A[0];J.type=O===null?"null":typeof O,J.const=O}else{if(A.every((O)=>typeof O==="number"))J.type="number";if(A.every((O)=>typeof O==="string"))J.type="string";if(A.every((O)=>typeof O==="boolean"))J.type="string";if(A.every((O)=>O===null))J.type="null";J.enum=A}break}case"file":{let J=H,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:O,maximum:V,mime:q}=$._zod.bag;if(O!==void 0)A.minLength=O;if(V!==void 0)A.maxLength=V;if(q)if(q.length===1)A.contentMediaType=q[0],Object.assign(J,A);else J.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(J,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let J=this.process(b.innerType,N);H.anyOf=[J,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"success":{let J=H;J.type="boolean";break}case"default":{this.process(b.innerType,N),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,N),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,N),D.ref=b.innerType;let J;try{J=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=J;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let J=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");J.type="string",J.pattern=A.source;break}case"pipe":{let J=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(J,N),D.ref=J;break}case"readonly":{this.process(b.innerType,N),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,N),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,N),D.ref=b.innerType;break}case"lazy":{let J=$._zod.innerType;this.process(J,N),D.ref=J;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let Q=this.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(this.io==="input"&&R$($))delete D.schema.examples,delete D.schema.default;if(this.io==="input"&&D.schema._prefault)(U=D.schema).default??(U.default=D.schema._prefault);return delete D.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},b=this.seen.get($);if(!b)throw new Error("Unprocessed schema. This is a bug in Zod.");let w=(G)=>{let N=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let A=U.external.registry.get(G[0])?.id,O=U.external.uri??((q)=>q);if(A)return{ref:O(A)};let V=G[1].defId??G[1].schema.id??`schema${this.counter++}`;return G[1].defId=V,{defId:V,ref:`${O("__shared")}#/${N}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${N}/`,J=G[1].schema.id??`__schema${this.counter++}`;return{defId:J,ref:H+J}},X=(G)=>{if(G[1].schema.$ref)return;let N=G[1],{ref:B,defId:H}=w(G);if(N.def={...N.schema},H)N.defId=H;let J=N.schema;for(let A in J)delete J[A];J.$ref=B};if(U.cycles==="throw")for(let G of this.seen.entries()){let N=G[1];if(N.cycle)throw new Error(`Cycle detected: #/${N.cycle?.join("/")}/<root>
33
+ path: iss.path ? [${c4(k)}, ...iss.path] : [${c4(k)}]
34
+ })));`),H.write(`newResult[${c4(k)}] = ${P}.value`)}H.write("payload.value = newResult;"),H.write("return payload;");let q=H.compile();return(k,P)=>q(J,k,P)},w,X=v1,D=!Nw.jitless,Q=D&&GW.value,G=I.catchall,Y;$._zod.parse=(J,H)=>{Y??(Y=U.value);let B=J.value;if(!X(B))return J.issues.push({expected:"object",code:"invalid_type",input:B,inst:$}),J;let A=[];if(D&&Q&&H?.async===!1&&H.jitless!==!0){if(!w)w=b(I.shape);J=w(J,H)}else{J.value={};let P=Y.shape;for(let h of Y.keys){let l=P[h],l$=l._zod.run({value:B[h],issues:[]},H),N6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)A.push(l$.then((B1)=>N6?hA(B1,J,h,B):zw(B1,J,h)));else if(N6)hA(l$,J,h,B);else zw(l$,J,h)}}if(!G)return A.length?Promise.all(A).then(()=>J):J;let O=[],V=Y.keySet,q=G._zod,k=q.def.type;for(let P of Object.keys(B)){if(V.has(P))continue;if(k==="never"){O.push(P);continue}let h=q.run({value:B[P],issues:[]},H);if(h instanceof Promise)A.push(h.then((l)=>zw(l,J,P)));else zw(h,J,P)}if(O.length)J.issues.push({code:"unrecognized_keys",keys:O,input:B,inst:$});if(!A.length)return J;return Promise.all(A).then(()=>{return J})}});function fA($,I,U,b){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((X)=>q6(X,b,D6())))}),I}var vw=v("$ZodUnion",($,I)=>{Y$.init($,I),O$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),O$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),O$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),O$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((b)=>b._zod.pattern);return new RegExp(`^(${U.map((b)=>iI(b.source)).join("|")})$`)}return}),$._zod.parse=(U,b)=>{let w=!1,X=[];for(let D of I.options){let W=D._zod.run({value:U.value,issues:[]},b);if(W instanceof Promise)X.push(W),w=!0;else{if(W.issues.length===0)return W;X.push(W)}}if(!w)return fA(X,U,$,b);return Promise.all(X).then((D)=>{return fA(D,U,$,b)})}}),sW=v("$ZodDiscriminatedUnion",($,I)=>{vw.init($,I);let U=$._zod.parse;O$($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=rI(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!v1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:D,path:[I.discriminator],inst:$}),w}}),$9=v("$ZodIntersection",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return yA(U,Q,G)});return yA(U,X,D)}});function SW($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(V1($)&&V1(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=SW($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=SW(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function yA($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(m4($))return $;let b=SW(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var I9=v("$ZodRecord",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!V1(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[];if(I.keyType._zod.values){let D=I.keyType._zod.values;U.value={};for(let Q of D)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){let G=I.valueType._zod.run({value:w[Q],issues:[]},b);if(G instanceof Promise)X.push(G.then((Y)=>{if(Y.issues.length)U.issues.push(...x6(Q,Y.issues));U.value[Q]=Y.value}));else{if(G.issues.length)U.issues.push(...x6(Q,G.issues));U.value[Q]=G.value}}let W;for(let Q in w)if(!D.has(Q))W=W??[],W.push(Q);if(W&&W.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:W})}else{U.value={};for(let D of Reflect.ownKeys(w)){if(D==="__proto__")continue;let W=I.keyType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(W.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:W.issues.map((G)=>q6(G,b,D6())),input:D,path:[D],inst:$}),U.value[W.value]=W.value;continue}let Q=I.valueType._zod.run({value:w[D],issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>{if(G.issues.length)U.issues.push(...x6(D,G.issues));U.value[W.value]=G.value}));else{if(Q.issues.length)U.issues.push(...x6(D,Q.issues));U.value[W.value]=Q.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}});var U9=v("$ZodEnum",($,I)=>{Y$.init($,I);let U=mI(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((b)=>YW.has(typeof b)).map((b)=>typeof b==="string"?N4(b):b.toString()).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if($._zod.values.has(X))return b;return b.issues.push({code:"invalid_value",values:U,input:X,inst:$}),b}}),w9=v("$ZodLiteral",($,I)=>{Y$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?N4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,b)=>{let w=U.value;if($._zod.values.has(w))return U;return U.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),U}});var b9=v("$ZodTransform",($,I)=>{Y$.init($,I),$._zod.parse=(U,b)=>{let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new Y4;return U.value=w,U}}),X9=v("$ZodOptional",($,I)=>{Y$.init($,I),$._zod.optin="optional",$._zod.optout="optional",O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${iI(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,b);if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),D9=v("$ZodNullable",($,I)=>{Y$.init($,I),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${iI(U.source)}|null)$`):void 0}),O$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),W9=v("$ZodDefault",($,I)=>{Y$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>uA(X,I));return uA(w,I)}});function uA($,I){if($.value===void 0)$.value=I.defaultValue;return $}var Q9=v("$ZodPrefault",($,I)=>{Y$.init($,I),$._zod.optin="optional",O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),G9=v("$ZodNonOptional",($,I)=>{Y$.init($,I),O$($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>lA(X,$));return lA(w,$)}});function lA($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var Y9=v("$ZodCatch",($,I)=>{Y$.init($,I),$._zod.optin="optional",O$($._zod,"optout",()=>I.innerType._zod.optout),O$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>q6(D,b,D6()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>q6(X,b,D6()))},input:U.value}),U.issues=[];return U}});var N9=v("$ZodPipe",($,I)=>{Y$.init($,I),O$($._zod,"values",()=>I.in._zod.values),O$($._zod,"optin",()=>I.in._zod.optin),O$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,b)=>{let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>cA(X,I,b));return cA(w,I,b)}});function cA($,I,U){if(m4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var J9=v("$ZodReadonly",($,I)=>{Y$.init($,I),O$($._zod,"propValues",()=>I.innerType._zod.propValues),O$($._zod,"values",()=>I.innerType._zod.values),O$($._zod,"optin",()=>I.innerType._zod.optin),O$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(mA);return mA(w)}});function mA($){return $.value=Object.freeze($.value),$}var B9=v("$ZodCustom",($,I)=>{Z$.init($,I),Y$.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>rA(X,U,b,$));rA(w,U,b,$);return}});function rA($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(BW(w))}}var ej=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},sj=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${ej(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${Hw(b.values[0])}`;return`Invalid option: expected one of ${Jw(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${Jw(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function H9(){return{localeError:sj()}}var $E=Symbol("ZodOutput"),IE=Symbol("ZodInput");class Vw{constructor(){this._map=new Map,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};return delete U.id,{...U,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function tA(){return new Vw}var J4=tA();function A9($,I){return new $({type:"string",...m(I)})}function O9($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function qw($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function z9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function L9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function K9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function v9($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function V9($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function q9($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function M9($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function F9($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function j9($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function E9($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function S9($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function P9($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function k9($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function R9($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function T9($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function _9($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function Z9($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function C9($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function g9($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function x9($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function aA($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function eA($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function sA($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function $O($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function h9($,I){return new $({type:"number",checks:[],...m(I)})}function f9($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function y9($,I){return new $({type:"boolean",...m(I)})}function u9($,I){return new $({type:"null",...m(I)})}function l9($){return new $({type:"unknown"})}function c9($,I){return new $({type:"never",...m(I)})}function Mw($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!1})}function aI($,I){return new FW({check:"less_than",...m(I),value:$,inclusive:!0})}function Fw($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!1})}function eI($,I){return new jW({check:"greater_than",...m(I),value:$,inclusive:!0})}function jw($,I){return new qA({check:"multiple_of",...m(I),value:$})}function Ew($,I){return new FA({check:"max_length",...m(I),maximum:$})}function q1($,I){return new jA({check:"min_length",...m(I),minimum:$})}function Sw($,I){return new EA({check:"length_equals",...m(I),length:$})}function m9($,I){return new SA({check:"string_format",format:"regex",...m(I),pattern:$})}function r9($){return new PA({check:"string_format",format:"lowercase",...m($)})}function n9($){return new kA({check:"string_format",format:"uppercase",...m($)})}function i9($,I){return new RA({check:"string_format",format:"includes",...m(I),includes:$})}function o9($,I){return new TA({check:"string_format",format:"starts_with",...m(I),prefix:$})}function d9($,I){return new _A({check:"string_format",format:"ends_with",...m(I),suffix:$})}function i4($){return new ZA({check:"overwrite",tx:$})}function p9($){return i4((I)=>I.normalize($))}function t9(){return i4(($)=>$.trim())}function a9(){return i4(($)=>$.toLowerCase())}function e9(){return i4(($)=>$.toUpperCase())}function IO($,I,U){return new $({type:"array",element:I,...m(U)})}function s9($,I,U){let b=m(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function $8($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class I8{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??J4,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,I={path:[],schemaPath:[]}){var U;let b=$._zod.def,w={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X=this.seen.get($);if(X){if(X.count++,I.schemaPath.includes($))X.cycle=I.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let Y={...I,schemaPath:[...I.schemaPath,$],path:I.path},J=$._zod.parent;if(J)D.ref=J,this.process(J,Y),this.seen.get(J).isParent=!0;else{let H=D.schema;switch(b.type){case"string":{let B=H;B.type="string";let{minimum:A,maximum:O,format:V,patterns:q,contentEncoding:k}=$._zod.bag;if(typeof A==="number")B.minLength=A;if(typeof O==="number")B.maxLength=O;if(V){if(B.format=w[V]??V,B.format==="")delete B.format}if(k)B.contentEncoding=k;if(q&&q.size>0){let P=[...q];if(P.length===1)B.pattern=P[0].source;else if(P.length>1)D.schema.allOf=[...P.map((h)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:h.source}))]}break}case"number":{let B=H,{minimum:A,maximum:O,format:V,multipleOf:q,exclusiveMaximum:k,exclusiveMinimum:P}=$._zod.bag;if(typeof V==="string"&&V.includes("int"))B.type="integer";else B.type="number";if(typeof P==="number")B.exclusiveMinimum=P;if(typeof A==="number"){if(B.minimum=A,typeof P==="number")if(P>=A)delete B.minimum;else delete B.exclusiveMinimum}if(typeof k==="number")B.exclusiveMaximum=k;if(typeof O==="number"){if(B.maximum=O,typeof k==="number")if(k<=O)delete B.maximum;else delete B.exclusiveMaximum}if(typeof q==="number")B.multipleOf=q;break}case"boolean":{let B=H;B.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{H.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{H.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let B=H,{minimum:A,maximum:O}=$._zod.bag;if(typeof A==="number")B.minItems=A;if(typeof O==="number")B.maxItems=O;B.type="array",B.items=this.process(b.element,{...Y,path:[...Y.path,"items"]});break}case"object":{let B=H;B.type="object",B.properties={};let A=b.shape;for(let q in A)B.properties[q]=this.process(A[q],{...Y,path:[...Y.path,"properties",q]});let O=new Set(Object.keys(A)),V=new Set([...O].filter((q)=>{let k=b.shape[q]._zod;if(this.io==="input")return k.optin===void 0;else return k.optout===void 0}));if(V.size>0)B.required=Array.from(V);if(b.catchall?._zod.def.type==="never")B.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")B.additionalProperties=!1}else if(b.catchall)B.additionalProperties=this.process(b.catchall,{...Y,path:[...Y.path,"additionalProperties"]});break}case"union":{let B=H;B.anyOf=b.options.map((A,O)=>this.process(A,{...Y,path:[...Y.path,"anyOf",O]}));break}case"intersection":{let B=H,A=this.process(b.left,{...Y,path:[...Y.path,"allOf",0]}),O=this.process(b.right,{...Y,path:[...Y.path,"allOf",1]}),V=(k)=>("allOf"in k)&&Object.keys(k).length===1,q=[...V(A)?A.allOf:[A],...V(O)?O.allOf:[O]];B.allOf=q;break}case"tuple":{let B=H;B.type="array";let A=b.items.map((q,k)=>this.process(q,{...Y,path:[...Y.path,"prefixItems",k]}));if(this.target==="draft-2020-12")B.prefixItems=A;else B.items=A;if(b.rest){let q=this.process(b.rest,{...Y,path:[...Y.path,"items"]});if(this.target==="draft-2020-12")B.items=q;else B.additionalItems=q}if(b.rest)B.items=this.process(b.rest,{...Y,path:[...Y.path,"items"]});let{minimum:O,maximum:V}=$._zod.bag;if(typeof O==="number")B.minItems=O;if(typeof V==="number")B.maxItems=V;break}case"record":{let B=H;B.type="object",B.propertyNames=this.process(b.keyType,{...Y,path:[...Y.path,"propertyNames"]}),B.additionalProperties=this.process(b.valueType,{...Y,path:[...Y.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let B=H,A=mI(b.entries);if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";B.enum=A;break}case"literal":{let B=H,A=[];for(let O of b.values)if(O===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof O==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(O));else A.push(O);if(A.length===0);else if(A.length===1){let O=A[0];B.type=O===null?"null":typeof O,B.const=O}else{if(A.every((O)=>typeof O==="number"))B.type="number";if(A.every((O)=>typeof O==="string"))B.type="string";if(A.every((O)=>typeof O==="boolean"))B.type="string";if(A.every((O)=>O===null))B.type="null";B.enum=A}break}case"file":{let B=H,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:O,maximum:V,mime:q}=$._zod.bag;if(O!==void 0)A.minLength=O;if(V!==void 0)A.maxLength=V;if(q)if(q.length===1)A.contentMediaType=q[0],Object.assign(B,A);else B.anyOf=q.map((k)=>{return{...A,contentMediaType:k}});else Object.assign(B,A);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let B=this.process(b.innerType,Y);H.anyOf=[B,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"success":{let B=H;B.type="boolean";break}case"default":{this.process(b.innerType,Y),D.ref=b.innerType,H.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,Y),D.ref=b.innerType,this.io==="input")H._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,Y),D.ref=b.innerType;let B;try{B=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}H.default=B;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let B=H,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");B.type="string",B.pattern=A.source;break}case"pipe":{let B=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(B,Y),D.ref=B;break}case"readonly":{this.process(b.innerType,Y),D.ref=b.innerType,H.readOnly=!0;break}case"promise":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"optional":{this.process(b.innerType,Y),D.ref=b.innerType;break}case"lazy":{let B=$._zod.innerType;this.process(B,Y),D.ref=B;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let Q=this.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(this.io==="input"&&R$($))delete D.schema.examples,delete D.schema.default;if(this.io==="input"&&D.schema._prefault)(U=D.schema).default??(U.default=D.schema._prefault);return delete D.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},b=this.seen.get($);if(!b)throw new Error("Unprocessed schema. This is a bug in Zod.");let w=(G)=>{let Y=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let A=U.external.registry.get(G[0])?.id,O=U.external.uri??((q)=>q);if(A)return{ref:O(A)};let V=G[1].defId??G[1].schema.id??`schema${this.counter++}`;return G[1].defId=V,{defId:V,ref:`${O("__shared")}#/${Y}/${V}`}}if(G[1]===b)return{ref:"#"};let H=`${"#"}/${Y}/`,B=G[1].schema.id??`__schema${this.counter++}`;return{defId:B,ref:H+B}},X=(G)=>{if(G[1].schema.$ref)return;let Y=G[1],{ref:J,defId:H}=w(G);if(Y.def={...Y.schema},H)Y.defId=H;let B=Y.schema;for(let A in B)delete B[A];B.$ref=J};if(U.cycles==="throw")for(let G of this.seen.entries()){let Y=G[1];if(Y.cycle)throw new Error(`Cycle detected: #/${Y.cycle?.join("/")}/<root>
35
35
 
36
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of this.seen.entries()){let N=G[1];if($===G[0]){X(G);continue}if(U.external){let H=U.external.registry.get(G[0])?.id;if($!==G[0]&&H){X(G);continue}}if(this.metadataRegistry.get(G[0])?.id){X(G);continue}if(N.cycle){X(G);continue}if(N.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,N)=>{let B=this.seen.get(G),H=B.def??B.schema,J={...H};if(B.ref===null)return;let A=B.ref;if(B.ref=null,A){D(A,N);let O=this.seen.get(A).schema;if(O.$ref&&N.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,J)}if(!B.isParent)this.override({zodSchema:G,jsonSchema:H,path:B.path??[]})};for(let G of[...this.seen.entries()].reverse())D(G[0],{target:this.target});let W={};if(this.target==="draft-2020-12")W.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")W.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let G=U.external.registry.get($)?.id;if(!G)throw new Error("Schema is missing an `id` property");W.$id=U.external.uri(G)}Object.assign(W,b.def);let Q=U.external?.defs??{};for(let G of this.seen.entries()){let N=G[1];if(N.def&&N.defId)Q[N.defId]=N.def}if(U.external);else if(Object.keys(Q).length>0)if(this.target==="draft-2020-12")W.$defs=Q;else W.definitions=Q;try{return JSON.parse(JSON.stringify(W))}catch(G){throw new Error("Error converting schema to JSON.")}}}function i9($,I){if($ instanceof Aw){let b=new n9(I),w={};for(let W of $._idmap.entries()){let[Q,G]=W;b.process(G)}let X={},D={registry:$,uri:I?.uri,defs:w};for(let W of $._idmap.entries()){let[Q,G]=W;X[Q]=b.emit(G,{...I,external:D})}if(Object.keys(w).length>0){let W=b.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[W]:w}}return{schemas:X}}let U=new n9(I);return U.process($),U.emit($,I)}function R$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let w=$._zod.def;switch(w.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return R$(w.element,U);case"object":{for(let X in w.shape)if(R$(w.shape[X],U))return!0;return!1}case"union":{for(let X of w.options)if(R$(X,U))return!0;return!1}case"intersection":return R$(w.left,U)||R$(w.right,U);case"tuple":{for(let X of w.items)if(R$(X,U))return!0;if(w.rest&&R$(w.rest,U))return!0;return!1}case"record":return R$(w.keyType,U)||R$(w.valueType,U);case"map":return R$(w.keyType,U)||R$(w.valueType,U);case"set":return R$(w.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(w.innerType,U);case"lazy":return R$(w.getter(),U);case"default":return R$(w.innerType,U);case"prefault":return R$(w.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(w.in,U)||R$(w.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${w.type}`)}var LE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");N$.init($,I),$.def=I,$.parse=(U,b)=>WW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>m4($,U,b),$.parseAsync=async(U,b)=>GW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>r4($,U,b),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$}});var KE=v("ZodMiniObject",($,I)=>{Jw.init($,I),LE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function o9($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new KE(U)}function J6($){return!!$._zod}function o4($){let I=Object.values($);if(I.length===0)return o9({});let U=I.every(J6),b=I.every((w)=>!J6(w));if(U)return o9($);if(b)return MH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(J6($))return m4($,I);return $.safeParse(I)}async function qw($,I){if(J6($))return await r4($,I);return await $.safeParseAsync(I)}function J4($){if(!$)return;let I;if(J6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function q1($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let b=Object.values($);if(b.length>0&&b.every((w)=>typeof w==="object"&&w!==null&&(w._def!==void 0||w._zod!==void 0||typeof w.parse==="function")))return o4($)}}if(J6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function Fw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function lA($){return $.description}function cA($){if(J6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Mw($){if(J6($)){let X=$._zod?.def;if(X){if(X.value!==void 0)return X.value;if(Array.isArray(X.values)&&X.values.length>0)return X.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let b=$.value;if(b!==void 0)return b;return}var aI={};v6(aI,{time:()=>t9,duration:()=>a9,datetime:()=>d9,date:()=>p9,ZodISOTime:()=>nA,ZodISODuration:()=>iA,ZodISODateTime:()=>mA,ZodISODate:()=>rA});var mA=v("ZodISODateTime",($,I)=>{kA.init($,I),v$.init($,I)});function d9($){return gA(mA,$)}var rA=v("ZodISODate",($,I)=>{RA.init($,I),v$.init($,I)});function p9($){return xA(rA,$)}var nA=v("ZodISOTime",($,I)=>{TA.init($,I),v$.init($,I)});function t9($){return hA(nA,$)}var iA=v("ZodISODuration",($,I)=>{_A.init($,I),v$.init($,I)});function a9($){return fA(iA,$)}var oA=($,I)=>{Gw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>XW($,U)},flatten:{value:(U)=>bW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},gc=v("ZodError",oA),eI=v("ZodError",oA,{Parent:Error});var dA=DW(eI),pA=QW(eI),tA=NW(eI),aA=YW(eI);var j$=v("ZodType",($,I)=>{return N$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>dA($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>tA($,U,b),$.parseAsync=async(U,b)=>pA($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>aA($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(OS(U,b)),$.superRefine=(U)=>$.check(zS(U)),$.overwrite=(U)=>$.check(n4(U)),$.optional=()=>M$($),$.nullable=()=>$O($),$.nullish=()=>M$($O($)),$.nonoptional=(U)=>GS($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>Ew($,U),$.transform=(U)=>s9($,XO(U)),$.default=(U)=>DS($,U),$.prefault=(U)=>QS($,U),$.catch=(U)=>YS($,U),$.pipe=(U)=>s9($,U),$.readonly=()=>HS($),$.describe=(U)=>{let b=$.clone();return Y4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return Y4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Y4.get($);let b=$.clone();return Y4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),IO=v("_ZodString",($,I)=>{dI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(Z9(...b)),$.includes=(...b)=>$.check(x9(...b)),$.startsWith=(...b)=>$.check(h9(...b)),$.endsWith=(...b)=>$.check(f9(...b)),$.min=(...b)=>$.check(V1(...b)),$.max=(...b)=>$.check(vw(...b)),$.length=(...b)=>$.check(Vw(...b)),$.nonempty=(...b)=>$.check(V1(1,...b)),$.lowercase=(b)=>$.check(C9(b)),$.uppercase=(b)=>$.check(g9(b)),$.trim=()=>$.check(u9()),$.normalize=(...b)=>$.check(y9(...b)),$.toLowerCase=()=>$.check(l9()),$.toUpperCase=()=>$.check(c9())}),PE=v("ZodString",($,I)=>{dI.init($,I),IO.init($,I),$.email=(U)=>$.check(D9(kE,U)),$.url=(U)=>$.check(Y9(RE,U)),$.jwt=(U)=>$.check(E9(nE,U)),$.emoji=(U)=>$.check(B9(TE,U)),$.guid=(U)=>$.check(Ow(eA,U)),$.uuid=(U)=>$.check(W9(jw,U)),$.uuidv4=(U)=>$.check(Q9(jw,U)),$.uuidv6=(U)=>$.check(G9(jw,U)),$.uuidv7=(U)=>$.check(N9(jw,U)),$.nanoid=(U)=>$.check(J9(_E,U)),$.guid=(U)=>$.check(Ow(eA,U)),$.cuid=(U)=>$.check(H9(ZE,U)),$.cuid2=(U)=>$.check(A9(CE,U)),$.ulid=(U)=>$.check(O9(gE,U)),$.base64=(U)=>$.check(F9(cE,U)),$.base64url=(U)=>$.check(M9(mE,U)),$.xid=(U)=>$.check(z9(xE,U)),$.ksuid=(U)=>$.check(L9(hE,U)),$.ipv4=(U)=>$.check(K9(fE,U)),$.ipv6=(U)=>$.check(v9(yE,U)),$.cidrv4=(U)=>$.check(V9(uE,U)),$.cidrv6=(U)=>$.check(q9(lE,U)),$.e164=(U)=>$.check(j9(rE,U)),$.datetime=(U)=>$.check(d9(U)),$.date=(U)=>$.check(p9(U)),$.time=(U)=>$.check(t9(U)),$.duration=(U)=>$.check(a9(U))});function K($){return X9(PE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),IO.init($,I)}),kE=v("ZodEmail",($,I)=>{vW.init($,I),v$.init($,I)});var eA=v("ZodGUID",($,I)=>{LW.init($,I),v$.init($,I)});var jw=v("ZodUUID",($,I)=>{KW.init($,I),v$.init($,I)});var RE=v("ZodURL",($,I)=>{VW.init($,I),v$.init($,I)});var TE=v("ZodEmoji",($,I)=>{qW.init($,I),v$.init($,I)});var _E=v("ZodNanoID",($,I)=>{FW.init($,I),v$.init($,I)});var ZE=v("ZodCUID",($,I)=>{MW.init($,I),v$.init($,I)});var CE=v("ZodCUID2",($,I)=>{jW.init($,I),v$.init($,I)});var gE=v("ZodULID",($,I)=>{EW.init($,I),v$.init($,I)});var xE=v("ZodXID",($,I)=>{SW.init($,I),v$.init($,I)});var hE=v("ZodKSUID",($,I)=>{PW.init($,I),v$.init($,I)});var fE=v("ZodIPv4",($,I)=>{kW.init($,I),v$.init($,I)});var yE=v("ZodIPv6",($,I)=>{RW.init($,I),v$.init($,I)});var uE=v("ZodCIDRv4",($,I)=>{TW.init($,I),v$.init($,I)});var lE=v("ZodCIDRv6",($,I)=>{_W.init($,I),v$.init($,I)});var cE=v("ZodBase64",($,I)=>{ZW.init($,I),v$.init($,I)});var mE=v("ZodBase64URL",($,I)=>{CW.init($,I),v$.init($,I)});var rE=v("ZodE164",($,I)=>{gW.init($,I),v$.init($,I)});var nE=v("ZodJWT",($,I)=>{xW.init($,I),v$.init($,I)});var UO=v("ZodNumber",($,I)=>{Bw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Lw(b,w)),$.gte=(b,w)=>$.check(tI(b,w)),$.min=(b,w)=>$.check(tI(b,w)),$.lt=(b,w)=>$.check(zw(b,w)),$.lte=(b,w)=>$.check(pI(b,w)),$.max=(b,w)=>$.check(pI(b,w)),$.int=(b)=>$.check(sA(b)),$.safe=(b)=>$.check(sA(b)),$.positive=(b)=>$.check(Lw(0,b)),$.nonnegative=(b)=>$.check(tI(0,b)),$.negative=(b)=>$.check(zw(0,b)),$.nonpositive=(b)=>$.check(pI(0,b)),$.multipleOf=(b,w)=>$.check(Kw(b,w)),$.step=(b,w)=>$.check(Kw(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function Q$($){return S9(UO,$)}var iE=v("ZodNumberFormat",($,I)=>{hW.init($,I),UO.init($,I)});function sA($){return P9(iE,$)}var oE=v("ZodBoolean",($,I)=>{fW.init($,I),j$.init($,I)});function T$($){return k9(oE,$)}var dE=v("ZodNull",($,I)=>{yW.init($,I),j$.init($,I)});function $8($){return R9(dE,$)}var pE=v("ZodUnknown",($,I)=>{uW.init($,I),j$.init($,I)});function V$(){return T9(pE)}var tE=v("ZodNever",($,I)=>{lW.init($,I),j$.init($,I)});function aE($){return _9(tE,$)}var eE=v("ZodArray",($,I)=>{cW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(V1(U,b)),$.nonempty=(U)=>$.check(V1(1,U)),$.max=(U,b)=>$.check(vw(U,b)),$.length=(U,b)=>$.check(Vw(U,b)),$.unwrap=()=>$.element});function w$($,I){return yA(eE,$,I)}var wO=v("ZodObject",($,I)=>{Jw.init($,I),j$.init($,I),I$.defineLazy($,"shape",()=>I.shape),$.keyof=()=>a$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:V$()}),$.loose=()=>$.clone({...$._zod.def,catchall:V$()}),$.strict=()=>$.clone({...$._zod.def,catchall:aE()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return I$.extend($,U)},$.merge=(U)=>I$.merge($,U),$.pick=(U)=>I$.pick($,U),$.omit=(U)=>I$.omit($,U),$.partial=(...U)=>I$.partial(DO,$,U[0]),$.required=(...U)=>I$.required(WO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new wO(U)}function m$($,I){return new wO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var bO=v("ZodUnion",($,I)=>{Hw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new bO({type:"union",options:$,...I$.normalizeParams(I)})}var sE=v("ZodDiscriminatedUnion",($,I)=>{bO.init($,I),mW.init($,I)});function I8($,I,U){return new sE({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var $S=v("ZodIntersection",($,I)=>{rW.init($,I),j$.init($,I)});function Ew($,I){return new $S({type:"intersection",left:$,right:I})}var IS=v("ZodRecord",($,I)=>{nW.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new IS({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var e9=v("ZodEnum",($,I)=>{iW.init($,I),j$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new e9({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new e9({type:"enum",entries:U,...I$.normalizeParams(I)})}var US=v("ZodLiteral",($,I)=>{oW.init($,I),j$.init($,I),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function f($,I){return new US({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var wS=v("ZodTransform",($,I)=>{dW.init($,I),j$.init($,I),$._zod.parse=(U,b)=>{U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(I$.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),D.continue??(D.continue=!0),U.issues.push(I$.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function XO($){return new wS({type:"transform",transform:$})}var DO=v("ZodOptional",($,I)=>{pW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function M$($){return new DO({type:"optional",innerType:$})}var bS=v("ZodNullable",($,I)=>{tW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function $O($){return new bS({type:"nullable",innerType:$})}var XS=v("ZodDefault",($,I)=>{aW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function DS($,I){return new XS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var WS=v("ZodPrefault",($,I)=>{eW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function QS($,I){return new WS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var WO=v("ZodNonOptional",($,I)=>{sW.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function GS($,I){return new WO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var NS=v("ZodCatch",($,I)=>{$9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function YS($,I){return new NS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var BS=v("ZodPipe",($,I)=>{I9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function s9($,I){return new BS({type:"pipe",in:$,out:I})}var JS=v("ZodReadonly",($,I)=>{U9.init($,I),j$.init($,I)});function HS($){return new JS({type:"readonly",innerType:$})}var QO=v("ZodCustom",($,I)=>{w9.init($,I),j$.init($,I)});function AS($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function GO($,I){return m9(QO,$??(()=>!0),I)}function OS($,I={}){return r9(QO,$,I)}function zS($){let I=AS((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(I$.issue(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(I$.issue(w))}},$(U.value,U)});return I}function U8($,I){return s9(XO($),I)}D6(b9());var w8="2025-11-25";var NO=[w8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],H4="io.modelcontextprotocol/related-task",Pw="2.0",C$=GO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),YO=L$([K(),Q$().int()]),BO=K(),pc=m$({ttl:L$([Q$(),$8()]).optional(),pollInterval:Q$().optional()}),LS=C({ttl:Q$().optional()}),KS=C({taskId:K()}),b8=m$({progressToken:YO.optional(),[H4]:KS.optional()}),Q6=C({_meta:b8.optional()}),sI=Q6.extend({task:LS.optional()}),JO=($)=>sI.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:b8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:b8.optional()}),kw=L$([K(),Q$().int()]),HO=C({jsonrpc:f(Pw),id:kw,...g$.shape}).strict(),X8=($)=>HO.safeParse($).success,AO=C({jsonrpc:f(Pw),...A6.shape}).strict(),OO=($)=>AO.safeParse($).success,D8=C({jsonrpc:f(Pw),id:kw,result:x$}).strict(),$U=($)=>D8.safeParse($).success;var c;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(c||(c={}));var W8=C({jsonrpc:f(Pw),id:kw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var zO=($)=>W8.safeParse($).success;var LO=L$([HO,AO,D8,W8]),tc=L$([D8,W8]),Rw=x$.strict(),vS=H6.extend({requestId:kw.optional(),reason:K().optional()}),Tw=A6.extend({method:f("notifications/cancelled"),params:vS}),VS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),IU=C({icons:w$(VS).optional()}),F1=C({name:K(),title:K().optional()}),KO=F1.extend({...F1.shape,...IU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),qS=Ew(C({applyDefaults:T$().optional()}),q$(K(),V$())),FS=U8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},Ew(C({form:qS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),MS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({sampling:m$({createMessage:C$.optional()}).optional(),elicitation:m$({create:C$.optional()}).optional()}).optional()}),jS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({tools:m$({call:C$.optional()}).optional()}).optional()}),ES=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:FS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:MS.optional()}),SS=Q6.extend({protocolVersion:K(),capabilities:ES,clientInfo:KO}),Q8=g$.extend({method:f("initialize"),params:SS});var PS=C({experimental:q$(K(),C$).optional(),logging:C$.optional(),completions:C$.optional(),prompts:C({listChanged:T$().optional()}).optional(),resources:C({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:C({listChanged:T$().optional()}).optional(),tasks:jS.optional()}),kS=x$.extend({protocolVersion:K(),capabilities:PS,serverInfo:KO,instructions:K().optional()}),G8=A6.extend({method:f("notifications/initialized"),params:H6.optional()});var _w=g$.extend({method:f("ping"),params:Q6.optional()}),RS=C({progress:Q$(),total:M$(Q$()),message:M$(K())}),TS=C({...H6.shape,...RS.shape,progressToken:YO}),Zw=A6.extend({method:f("notifications/progress"),params:TS}),_S=Q6.extend({cursor:BO.optional()}),UU=g$.extend({params:_S.optional()}),wU=x$.extend({nextCursor:BO.optional()}),ZS=a$(["working","input_required","completed","failed","cancelled"]),bU=C({taskId:K(),status:ZS,ttl:L$([Q$(),$8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:M$(Q$()),statusMessage:M$(K())}),M1=x$.extend({task:bU}),CS=H6.merge(bU),XU=A6.extend({method:f("notifications/tasks/status"),params:CS}),Cw=g$.extend({method:f("tasks/get"),params:Q6.extend({taskId:K()})}),gw=x$.merge(bU),xw=g$.extend({method:f("tasks/result"),params:Q6.extend({taskId:K()})}),ac=x$.loose(),hw=UU.extend({method:f("tasks/list")}),fw=wU.extend({tasks:w$(bU)}),yw=g$.extend({method:f("tasks/cancel"),params:Q6.extend({taskId:K()})}),vO=x$.merge(bU),VO=C({uri:K(),mimeType:M$(K()),_meta:q$(K(),V$()).optional()}),qO=VO.extend({text:K()}),N8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),FO=VO.extend({blob:N8}),DU=a$(["user","assistant"]),j1=C({audience:w$(DU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:aI.datetime({offset:!0}).optional()}),MO=C({...F1.shape,...IU.shape,uri:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),gS=C({...F1.shape,...IU.shape,uriTemplate:K(),description:M$(K()),mimeType:M$(K()),annotations:j1.optional(),_meta:M$(m$({}))}),uw=UU.extend({method:f("resources/list")}),xS=wU.extend({resources:w$(MO)}),lw=UU.extend({method:f("resources/templates/list")}),hS=wU.extend({resourceTemplates:w$(gS)}),Y8=Q6.extend({uri:K()}),fS=Y8,cw=g$.extend({method:f("resources/read"),params:fS}),yS=x$.extend({contents:w$(L$([qO,FO]))}),uS=A6.extend({method:f("notifications/resources/list_changed"),params:H6.optional()}),lS=Y8,cS=g$.extend({method:f("resources/subscribe"),params:lS}),mS=Y8,rS=g$.extend({method:f("resources/unsubscribe"),params:mS}),nS=H6.extend({uri:K()}),iS=A6.extend({method:f("notifications/resources/updated"),params:nS}),oS=C({name:K(),description:M$(K()),required:M$(T$())}),dS=C({...F1.shape,...IU.shape,description:M$(K()),arguments:M$(w$(oS)),_meta:M$(m$({}))}),mw=UU.extend({method:f("prompts/list")}),pS=wU.extend({prompts:w$(dS)}),tS=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),rw=g$.extend({method:f("prompts/get"),params:tS}),B8=C({type:f("text"),text:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),J8=C({type:f("image"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),H8=C({type:f("audio"),data:N8,mimeType:K(),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),aS=C({type:f("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),eS=C({type:f("resource"),resource:L$([qO,FO]),annotations:j1.optional(),_meta:q$(K(),V$()).optional()}),sS=MO.extend({type:f("resource_link")}),A8=L$([B8,J8,H8,sS,eS]),$P=C({role:DU,content:A8}),IP=x$.extend({description:K().optional(),messages:w$($P)}),UP=A6.extend({method:f("notifications/prompts/list_changed"),params:H6.optional()}),wP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),bP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),jO=C({...F1.shape,...IU.shape,description:K().optional(),inputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:f("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:wP.optional(),execution:bP.optional(),_meta:q$(K(),V$()).optional()}),nw=UU.extend({method:f("tools/list")}),XP=wU.extend({tools:w$(jO)}),iw=x$.extend({content:w$(A8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),ec=iw.or(x$.extend({toolResult:V$()})),DP=sI.extend({name:K(),arguments:q$(K(),V$()).optional()}),E1=g$.extend({method:f("tools/call"),params:DP}),WP=A6.extend({method:f("notifications/tools/list_changed"),params:H6.optional()}),sc=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),WU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),QP=Q6.extend({level:WU}),O8=g$.extend({method:f("logging/setLevel"),params:QP}),GP=H6.extend({level:WU,logger:K().optional(),data:V$()}),NP=A6.extend({method:f("notifications/message"),params:GP}),YP=C({name:K().optional()}),BP=C({hints:w$(YP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),JP=C({mode:a$(["auto","required","none"]).optional()}),HP=C({type:f("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(A8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),AP=I8("type",[B8,J8,H8]),Sw=I8("type",[B8,J8,H8,aS,HP]),OP=C({role:DU,content:L$([Sw,w$(Sw)]),_meta:q$(K(),V$()).optional()}),zP=sI.extend({messages:w$(OP),modelPreferences:BP.optional(),systemPrompt:K().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:Q$().optional(),maxTokens:Q$().int(),stopSequences:w$(K()).optional(),metadata:C$.optional(),tools:w$(jO).optional(),toolChoice:JP.optional()}),LP=g$.extend({method:f("sampling/createMessage"),params:zP}),z8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:DU,content:AP}),L8=x$.extend({model:K(),stopReason:M$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:DU,content:L$([Sw,w$(Sw)])}),KP=C({type:f("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),vP=C({type:f("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),VP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),qP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),FP=C({type:f("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),MP=C({type:f("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),jP=L$([qP,FP]),EP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:f("string"),enum:w$(K())}),default:w$(K()).optional()}),SP=C({type:f("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({anyOf:w$(C({const:K(),title:K()}))}),default:w$(K()).optional()}),PP=L$([EP,SP]),kP=L$([MP,jP,PP]),RP=L$([kP,KP,vP,VP]),TP=sI.extend({mode:f("form").optional(),message:K(),requestedSchema:C({type:f("object"),properties:q$(K(),RP),required:w$(K()).optional()})}),_P=sI.extend({mode:f("url"),message:K(),elicitationId:K(),url:K().url()}),ZP=L$([TP,_P]),CP=g$.extend({method:f("elicitation/create"),params:ZP}),gP=H6.extend({elicitationId:K()}),xP=A6.extend({method:f("notifications/elicitation/complete"),params:gP}),ow=x$.extend({action:a$(["accept","decline","cancel"]),content:U8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),hP=C({type:f("ref/resource"),uri:K()});var fP=C({type:f("ref/prompt"),name:K()}),yP=Q6.extend({ref:L$([fP,hP]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),dw=g$.extend({method:f("completion/complete"),params:yP});function EO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function SO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var uP=x$.extend({completion:m$({values:w$(K()).max(100),total:M$(Q$().int()),hasMore:M$(T$())})}),lP=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),cP=g$.extend({method:f("roots/list"),params:Q6.optional()}),K8=x$.extend({roots:w$(lP)}),mP=A6.extend({method:f("notifications/roots/list_changed"),params:H6.optional()}),$m=L$([_w,Q8,dw,O8,rw,mw,uw,lw,cw,cS,rS,E1,nw,Cw,xw,hw,yw]),Im=L$([Tw,Zw,G8,mP,XU]),Um=L$([Rw,z8,L8,ow,K8,gw,fw,M1]),wm=L$([_w,LP,CP,cP,Cw,xw,hw,yw]),bm=L$([Tw,Zw,NP,iS,uS,WP,UP,XU,xP]),Xm=L$([Rw,kS,uP,IP,pS,xS,hS,yS,iw,XP,gw,fw,M1]);class h extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===c.UrlElicitationRequired&&U){let b=U;if(b.elicitations)return new PO(b.elicitations,I)}return new h($,I,U)}}class PO extends h{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function A4($){return $==="completed"||$==="failed"||$==="cancelled"}var RO=Symbol("Let zodToJsonSchema decide on which parser to use");var kO={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"},TO=($)=>typeof $==="string"?{...kO,name:$}:{...kO,...$};var _O=($)=>{let I=TO($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([b,w])=>[w._def,{def:w._def,path:[...I.basePath,I.definitionPath,b],jsonSchema:void 0}]))}};function v8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,v8($,I,b,w)}var pw=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function F$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?pw(I,$.currentPath):I.join("/")}}function ZO($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==M.ZodAny)U.items=n($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)b$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)b$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)b$(U,"minItems",$.exactLength.value,$.exactLength.message,I),b$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function CO($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function gO(){return{type:"boolean"}}function tw($,I){return n($.type._def,I)}var xO=($,I)=>{return n($.innerType._def,I)};function V8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>V8($,I,w))};switch(b){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return rP($,I)}}var rP=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let b of $.checks)switch(b.kind){case"min":b$(U,"minimum",b.value,b.message,I);break;case"max":b$(U,"maximum",b.value,b.message,I);break}return U};function hO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function fO($,I){return I.effectStrategy==="input"?n($.schema._def,I):F$(I)}function yO($){return{type:"string",enum:Array.from($.values)}}var nP=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function uO($,I){let U=[n($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),n($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((X)=>!!X),b=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,w=[];return U.forEach((X)=>{if(nP(X)){if(w.push(...X.allOf),X.unevaluatedProperties===void 0)b=void 0}else{let D=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:W,...Q}=X;D=Q}else b=void 0;w.push(D)}}),w.length?{allOf:w,...b}:void 0}function lO($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var q8=void 0,F6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(q8===void 0)q8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return q8},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function aw($,I){let U={type:"string"};if($.checks)for(let b of $.checks)switch(b.kind){case"min":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I);break;case"max":b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"email":switch(I.emailStrategy){case"format:email":M6(U,"email",b.message,I);break;case"format:idn-email":M6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,F6.email,b.message,I);break}break;case"url":M6(U,"uri",b.message,I);break;case"uuid":M6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,F6.cuid,b.message,I);break;case"cuid2":r$(U,F6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${F8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${F8(b.value,I)}$`),b.message,I);break;case"datetime":M6(U,"date-time",b.message,I);break;case"date":M6(U,"date",b.message,I);break;case"time":M6(U,"time",b.message,I);break;case"duration":M6(U,"duration",b.message,I);break;case"length":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I),b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"includes":{r$(U,RegExp(F8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")M6(U,"ipv4",b.message,I);if(b.version!=="v4")M6(U,"ipv6",b.message,I);break}case"base64url":r$(U,F6.base64url,b.message,I);break;case"jwt":r$(U,F6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,F6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,F6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,F6.emoji(),b.message,I);break;case"ulid":{r$(U,F6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{M6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,F6.base64,b.message,I);break}}break}case"nanoid":r$(U,F6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function F8($,I){return I.patternStrategy==="escape"?oP($):$}var iP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function oP($){let I="";for(let U=0;U<$.length;U++){if(!iP.has($[U]))I+="\\";I+=$[U]}return I}function M6($,I,U,b){if($.format||$.anyOf?.some((w)=>w.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&b.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&b.errorMessages&&{errorMessage:{format:U}}})}else b$($,"format",I,U,b)}function r$($,I,U,b){if($.pattern||$.allOf?.some((w)=>w.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&b.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:cO(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",cO(I,b),U,b)}function cO($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},b=U.i?$.source.toLowerCase():$.source,w="",X=!1,D=!1,W=!1;for(let Q=0;Q<b.length;Q++){if(X){w+=b[Q],X=!1;continue}if(U.i){if(D){if(b[Q].match(/[a-z]/)){if(W)w+=b[Q],w+=`${b[Q-2]}-${b[Q]}`.toUpperCase(),W=!1;else if(b[Q+1]==="-"&&b[Q+2]?.match(/[a-z]/))w+=b[Q],W=!0;else w+=`${b[Q]}${b[Q].toUpperCase()}`;continue}}else if(b[Q].match(/[a-z]/)){w+=`[${b[Q]}${b[Q].toUpperCase()}]`;continue}}if(U.m){if(b[Q]==="^"){w+=`(^|(?<=[\r
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of this.seen.entries()){let Y=G[1];if($===G[0]){X(G);continue}if(U.external){let H=U.external.registry.get(G[0])?.id;if($!==G[0]&&H){X(G);continue}}if(this.metadataRegistry.get(G[0])?.id){X(G);continue}if(Y.cycle){X(G);continue}if(Y.count>1){if(U.reused==="ref"){X(G);continue}}}let D=(G,Y)=>{let J=this.seen.get(G),H=J.def??J.schema,B={...H};if(J.ref===null)return;let A=J.ref;if(J.ref=null,A){D(A,Y);let O=this.seen.get(A).schema;if(O.$ref&&Y.target==="draft-7")H.allOf=H.allOf??[],H.allOf.push(O);else Object.assign(H,O),Object.assign(H,B)}if(!J.isParent)this.override({zodSchema:G,jsonSchema:H,path:J.path??[]})};for(let G of[...this.seen.entries()].reverse())D(G[0],{target:this.target});let W={};if(this.target==="draft-2020-12")W.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")W.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let G=U.external.registry.get($)?.id;if(!G)throw new Error("Schema is missing an `id` property");W.$id=U.external.uri(G)}Object.assign(W,b.def);let Q=U.external?.defs??{};for(let G of this.seen.entries()){let Y=G[1];if(Y.def&&Y.defId)Q[Y.defId]=Y.def}if(U.external);else if(Object.keys(Q).length>0)if(this.target==="draft-2020-12")W.$defs=Q;else W.definitions=Q;try{return JSON.parse(JSON.stringify(W))}catch(G){throw new Error("Error converting schema to JSON.")}}}function U8($,I){if($ instanceof Vw){let b=new I8(I),w={};for(let W of $._idmap.entries()){let[Q,G]=W;b.process(G)}let X={},D={registry:$,uri:I?.uri,defs:w};for(let W of $._idmap.entries()){let[Q,G]=W;X[Q]=b.emit(G,{...I,external:D})}if(Object.keys(w).length>0){let W=b.target==="draft-2020-12"?"$defs":"definitions";X.__shared={[W]:w}}return{schemas:X}}let U=new I8(I);return U.process($),U.emit($,I)}function R$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let w=$._zod.def;switch(w.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return R$(w.element,U);case"object":{for(let X in w.shape)if(R$(w.shape[X],U))return!0;return!1}case"union":{for(let X of w.options)if(R$(X,U))return!0;return!1}case"intersection":return R$(w.left,U)||R$(w.right,U);case"tuple":{for(let X of w.items)if(R$(X,U))return!0;if(w.rest&&R$(w.rest,U))return!0;return!1}case"record":return R$(w.keyType,U)||R$(w.valueType,U);case"map":return R$(w.keyType,U)||R$(w.valueType,U);case"set":return R$(w.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(w.innerType,U);case"lazy":return R$(w.getter(),U);case"default":return R$(w.innerType,U);case"prefault":return R$(w.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(w.in,U)||R$(w.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${w.type}`)}var xE=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");Y$.init($,I),$.def=I,$.parse=(U,b)=>zW($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>r4($,U,b),$.parseAsync=async(U,b)=>KW($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>n4($,U,b),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$}});var hE=v("ZodMiniObject",($,I)=>{Kw.init($,I),xE.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function w8($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new hE(U)}function B6($){return!!$._zod}function d4($){let I=Object.values($);if(I.length===0)return w8({});let U=I.every(B6),b=I.every((w)=>!B6(w));if(U)return w8($);if(b)return uH($);throw new Error("Mixed Zod versions detected in object shape.")}function B4($,I){if(B6($))return r4($,I);return $.safeParse(I)}async function Pw($,I){if(B6($))return await n4($,I);return await $.safeParseAsync(I)}function H4($){if(!$)return;let I;if(B6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function M1($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let b=Object.values($);if(b.length>0&&b.every((w)=>typeof w==="object"&&w!==null&&(w._def!==void 0||w._zod!==void 0||typeof w.parse==="function")))return d4($)}}if(B6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function kw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function wO($){return $.description}function bO($){if(B6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Rw($){if(B6($)){let X=$._zod?.def;if(X){if(X.value!==void 0)return X.value;if(Array.isArray(X.values)&&X.values.length>0)return X.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let b=$.value;if(b!==void 0)return b;return}var sI={};v6(sI,{time:()=>D8,duration:()=>W8,datetime:()=>b8,date:()=>X8,ZodISOTime:()=>WO,ZodISODuration:()=>QO,ZodISODateTime:()=>XO,ZodISODate:()=>DO});var XO=v("ZodISODateTime",($,I)=>{nA.init($,I),v$.init($,I)});function b8($){return aA(XO,$)}var DO=v("ZodISODate",($,I)=>{iA.init($,I),v$.init($,I)});function X8($){return eA(DO,$)}var WO=v("ZodISOTime",($,I)=>{oA.init($,I),v$.init($,I)});function D8($){return sA(WO,$)}var QO=v("ZodISODuration",($,I)=>{dA.init($,I),v$.init($,I)});function W8($){return $O(QO,$)}var GO=($,I)=>{Aw.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>AW($,U)},flatten:{value:(U)=>HW($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Im=v("ZodError",GO),$U=v("ZodError",GO,{Parent:Error});var YO=OW($U),NO=LW($U),JO=vW($U),BO=VW($U);var j$=v("ZodType",($,I)=>{return Y$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(U,b)=>W6($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>YO($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>JO($,U,b),$.parseAsync=async(U,b)=>NO($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>BO($,U,b),$.spa=$.safeParseAsync,$.refine=(U,b)=>$.check(CS(U,b)),$.superRefine=(U)=>$.check(gS(U)),$.overwrite=(U)=>$.check(i4(U)),$.optional=()=>F$($),$.nullable=()=>OO($),$.nullish=()=>F$(OO($)),$.nonoptional=(U)=>SS($,U),$.array=()=>w$($),$.or=(U)=>L$([$,U]),$.and=(U)=>_w($,U),$.transform=(U)=>G8($,VO(U)),$.default=(U)=>FS($,U),$.prefault=(U)=>ES($,U),$.catch=(U)=>kS($,U),$.pipe=(U)=>G8($,U),$.readonly=()=>_S($),$.describe=(U)=>{let b=$.clone();return J4.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return J4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return J4.get($);let b=$.clone();return J4.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),zO=v("_ZodString",($,I)=>{tI.init($,I),j$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(m9(...b)),$.includes=(...b)=>$.check(i9(...b)),$.startsWith=(...b)=>$.check(o9(...b)),$.endsWith=(...b)=>$.check(d9(...b)),$.min=(...b)=>$.check(q1(...b)),$.max=(...b)=>$.check(Ew(...b)),$.length=(...b)=>$.check(Sw(...b)),$.nonempty=(...b)=>$.check(q1(1,...b)),$.lowercase=(b)=>$.check(r9(b)),$.uppercase=(b)=>$.check(n9(b)),$.trim=()=>$.check(t9()),$.normalize=(...b)=>$.check(p9(...b)),$.toLowerCase=()=>$.check(a9()),$.toUpperCase=()=>$.check(e9())}),iE=v("ZodString",($,I)=>{tI.init($,I),zO.init($,I),$.email=(U)=>$.check(O9(oE,U)),$.url=(U)=>$.check(V9(dE,U)),$.jwt=(U)=>$.check(x9(GS,U)),$.emoji=(U)=>$.check(q9(pE,U)),$.guid=(U)=>$.check(qw(HO,U)),$.uuid=(U)=>$.check(z9(Tw,U)),$.uuidv4=(U)=>$.check(L9(Tw,U)),$.uuidv6=(U)=>$.check(K9(Tw,U)),$.uuidv7=(U)=>$.check(v9(Tw,U)),$.nanoid=(U)=>$.check(M9(tE,U)),$.guid=(U)=>$.check(qw(HO,U)),$.cuid=(U)=>$.check(F9(aE,U)),$.cuid2=(U)=>$.check(j9(eE,U)),$.ulid=(U)=>$.check(E9(sE,U)),$.base64=(U)=>$.check(Z9(DS,U)),$.base64url=(U)=>$.check(C9(WS,U)),$.xid=(U)=>$.check(S9($S,U)),$.ksuid=(U)=>$.check(P9(IS,U)),$.ipv4=(U)=>$.check(k9(US,U)),$.ipv6=(U)=>$.check(R9(wS,U)),$.cidrv4=(U)=>$.check(T9(bS,U)),$.cidrv6=(U)=>$.check(_9(XS,U)),$.e164=(U)=>$.check(g9(QS,U)),$.datetime=(U)=>$.check(b8(U)),$.date=(U)=>$.check(X8(U)),$.time=(U)=>$.check(D8(U)),$.duration=(U)=>$.check(W8(U))});function K($){return A9(iE,$)}var v$=v("ZodStringFormat",($,I)=>{z$.init($,I),zO.init($,I)}),oE=v("ZodEmail",($,I)=>{RW.init($,I),v$.init($,I)});var HO=v("ZodGUID",($,I)=>{PW.init($,I),v$.init($,I)});var Tw=v("ZodUUID",($,I)=>{kW.init($,I),v$.init($,I)});var dE=v("ZodURL",($,I)=>{TW.init($,I),v$.init($,I)});var pE=v("ZodEmoji",($,I)=>{_W.init($,I),v$.init($,I)});var tE=v("ZodNanoID",($,I)=>{ZW.init($,I),v$.init($,I)});var aE=v("ZodCUID",($,I)=>{CW.init($,I),v$.init($,I)});var eE=v("ZodCUID2",($,I)=>{gW.init($,I),v$.init($,I)});var sE=v("ZodULID",($,I)=>{xW.init($,I),v$.init($,I)});var $S=v("ZodXID",($,I)=>{hW.init($,I),v$.init($,I)});var IS=v("ZodKSUID",($,I)=>{fW.init($,I),v$.init($,I)});var US=v("ZodIPv4",($,I)=>{yW.init($,I),v$.init($,I)});var wS=v("ZodIPv6",($,I)=>{uW.init($,I),v$.init($,I)});var bS=v("ZodCIDRv4",($,I)=>{lW.init($,I),v$.init($,I)});var XS=v("ZodCIDRv6",($,I)=>{cW.init($,I),v$.init($,I)});var DS=v("ZodBase64",($,I)=>{mW.init($,I),v$.init($,I)});var WS=v("ZodBase64URL",($,I)=>{rW.init($,I),v$.init($,I)});var QS=v("ZodE164",($,I)=>{nW.init($,I),v$.init($,I)});var GS=v("ZodJWT",($,I)=>{iW.init($,I),v$.init($,I)});var LO=v("ZodNumber",($,I)=>{Lw.init($,I),j$.init($,I),$.gt=(b,w)=>$.check(Fw(b,w)),$.gte=(b,w)=>$.check(eI(b,w)),$.min=(b,w)=>$.check(eI(b,w)),$.lt=(b,w)=>$.check(Mw(b,w)),$.lte=(b,w)=>$.check(aI(b,w)),$.max=(b,w)=>$.check(aI(b,w)),$.int=(b)=>$.check(AO(b)),$.safe=(b)=>$.check(AO(b)),$.positive=(b)=>$.check(Fw(0,b)),$.nonnegative=(b)=>$.check(eI(0,b)),$.negative=(b)=>$.check(Mw(0,b)),$.nonpositive=(b)=>$.check(aI(0,b)),$.multipleOf=(b,w)=>$.check(jw(b,w)),$.step=(b,w)=>$.check(jw(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function Q$($){return h9(LO,$)}var YS=v("ZodNumberFormat",($,I)=>{oW.init($,I),LO.init($,I)});function AO($){return f9(YS,$)}var NS=v("ZodBoolean",($,I)=>{dW.init($,I),j$.init($,I)});function T$($){return y9(NS,$)}var JS=v("ZodNull",($,I)=>{pW.init($,I),j$.init($,I)});function Y8($){return u9(JS,$)}var BS=v("ZodUnknown",($,I)=>{tW.init($,I),j$.init($,I)});function V$(){return l9(BS)}var HS=v("ZodNever",($,I)=>{aW.init($,I),j$.init($,I)});function AS($){return c9(HS,$)}var OS=v("ZodArray",($,I)=>{eW.init($,I),j$.init($,I),$.element=I.element,$.min=(U,b)=>$.check(q1(U,b)),$.nonempty=(U)=>$.check(q1(1,U)),$.max=(U,b)=>$.check(Ew(U,b)),$.length=(U,b)=>$.check(Sw(U,b)),$.unwrap=()=>$.element});function w$($,I){return IO(OS,$,I)}var KO=v("ZodObject",($,I)=>{Kw.init($,I),j$.init($,I),I$.defineLazy($,"shape",()=>I.shape),$.keyof=()=>a$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:V$()}),$.loose=()=>$.clone({...$._zod.def,catchall:V$()}),$.strict=()=>$.clone({...$._zod.def,catchall:AS()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return I$.extend($,U)},$.merge=(U)=>I$.merge($,U),$.pick=(U)=>I$.pick($,U),$.omit=(U)=>I$.omit($,U),$.partial=(...U)=>I$.partial(qO,$,U[0]),$.required=(...U)=>I$.required(MO,$,U[0])});function C($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new KO(U)}function m$($,I){return new KO({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var vO=v("ZodUnion",($,I)=>{vw.init($,I),j$.init($,I),$.options=I.options});function L$($,I){return new vO({type:"union",options:$,...I$.normalizeParams(I)})}var zS=v("ZodDiscriminatedUnion",($,I)=>{vO.init($,I),sW.init($,I)});function N8($,I,U){return new zS({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var LS=v("ZodIntersection",($,I)=>{$9.init($,I),j$.init($,I)});function _w($,I){return new LS({type:"intersection",left:$,right:I})}var KS=v("ZodRecord",($,I)=>{I9.init($,I),j$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function q$($,I,U){return new KS({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var Q8=v("ZodEnum",($,I)=>{U9.init($,I),j$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new Q8({...I,checks:[],...I$.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new Q8({...I,checks:[],...I$.normalizeParams(w),entries:X})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new Q8({type:"enum",entries:U,...I$.normalizeParams(I)})}var vS=v("ZodLiteral",($,I)=>{w9.init($,I),j$.init($,I),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function y($,I){return new vS({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var VS=v("ZodTransform",($,I)=>{b9.init($,I),j$.init($,I),$._zod.parse=(U,b)=>{U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(I$.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),D.continue??(D.continue=!0),U.issues.push(I$.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function VO($){return new VS({type:"transform",transform:$})}var qO=v("ZodOptional",($,I)=>{X9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function F$($){return new qO({type:"optional",innerType:$})}var qS=v("ZodNullable",($,I)=>{D9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function OO($){return new qS({type:"nullable",innerType:$})}var MS=v("ZodDefault",($,I)=>{W9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function FS($,I){return new MS({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var jS=v("ZodPrefault",($,I)=>{Q9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function ES($,I){return new jS({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var MO=v("ZodNonOptional",($,I)=>{G9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType});function SS($,I){return new MO({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var PS=v("ZodCatch",($,I)=>{Y9.init($,I),j$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function kS($,I){return new PS({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var RS=v("ZodPipe",($,I)=>{N9.init($,I),j$.init($,I),$.in=I.in,$.out=I.out});function G8($,I){return new RS({type:"pipe",in:$,out:I})}var TS=v("ZodReadonly",($,I)=>{J9.init($,I),j$.init($,I)});function _S($){return new TS({type:"readonly",innerType:$})}var FO=v("ZodCustom",($,I)=>{B9.init($,I),j$.init($,I)});function ZS($){let I=new Z$({check:"custom"});return I._zod.check=$,I}function jO($,I){return s9(FO,$??(()=>!0),I)}function CS($,I={}){return $8(FO,$,I)}function gS($){let I=ZS((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(I$.issue(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(I$.issue(w))}},$(U.value,U)});return I}function J8($,I){return G8(VO($),I)}D6(H9());var B8="2025-11-25";var EO=[B8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],A4="io.modelcontextprotocol/related-task",Cw="2.0",C$=jO(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),SO=L$([K(),Q$().int()]),PO=K(),Am=m$({ttl:L$([Q$(),Y8()]).optional(),pollInterval:Q$().optional()}),xS=C({ttl:Q$().optional()}),hS=C({taskId:K()}),H8=m$({progressToken:SO.optional(),[A4]:hS.optional()}),Q6=C({_meta:H8.optional()}),IU=Q6.extend({task:xS.optional()}),kO=($)=>IU.safeParse($).success,g$=C({method:K(),params:Q6.loose().optional()}),H6=C({_meta:H8.optional()}),A6=C({method:K(),params:H6.loose().optional()}),x$=m$({_meta:H8.optional()}),gw=L$([K(),Q$().int()]),RO=C({jsonrpc:y(Cw),id:gw,...g$.shape}).strict(),A8=($)=>RO.safeParse($).success,TO=C({jsonrpc:y(Cw),...A6.shape}).strict(),_O=($)=>TO.safeParse($).success,O8=C({jsonrpc:y(Cw),id:gw,result:x$}).strict(),UU=($)=>O8.safeParse($).success;var c;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(c||(c={}));var z8=C({jsonrpc:y(Cw),id:gw.optional(),error:C({code:Q$().int(),message:K(),data:V$().optional()})}).strict();var ZO=($)=>z8.safeParse($).success;var CO=L$([RO,TO,O8,z8]),Om=L$([O8,z8]),xw=x$.strict(),fS=H6.extend({requestId:gw.optional(),reason:K().optional()}),hw=A6.extend({method:y("notifications/cancelled"),params:fS}),yS=C({src:K(),mimeType:K().optional(),sizes:w$(K()).optional(),theme:a$(["light","dark"]).optional()}),wU=C({icons:w$(yS).optional()}),F1=C({name:K(),title:K().optional()}),gO=F1.extend({...F1.shape,...wU.shape,version:K(),websiteUrl:K().optional(),description:K().optional()}),uS=_w(C({applyDefaults:T$().optional()}),q$(K(),V$())),lS=J8(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},_w(C({form:uS.optional(),url:C$.optional()}),q$(K(),V$()).optional())),cS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({sampling:m$({createMessage:C$.optional()}).optional(),elicitation:m$({create:C$.optional()}).optional()}).optional()}),mS=m$({list:C$.optional(),cancel:C$.optional(),requests:m$({tools:m$({call:C$.optional()}).optional()}).optional()}),rS=C({experimental:q$(K(),C$).optional(),sampling:C({context:C$.optional(),tools:C$.optional()}).optional(),elicitation:lS.optional(),roots:C({listChanged:T$().optional()}).optional(),tasks:cS.optional()}),nS=Q6.extend({protocolVersion:K(),capabilities:rS,clientInfo:gO}),L8=g$.extend({method:y("initialize"),params:nS});var iS=C({experimental:q$(K(),C$).optional(),logging:C$.optional(),completions:C$.optional(),prompts:C({listChanged:T$().optional()}).optional(),resources:C({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:C({listChanged:T$().optional()}).optional(),tasks:mS.optional()}),oS=x$.extend({protocolVersion:K(),capabilities:iS,serverInfo:gO,instructions:K().optional()}),K8=A6.extend({method:y("notifications/initialized"),params:H6.optional()});var fw=g$.extend({method:y("ping"),params:Q6.optional()}),dS=C({progress:Q$(),total:F$(Q$()),message:F$(K())}),pS=C({...H6.shape,...dS.shape,progressToken:SO}),yw=A6.extend({method:y("notifications/progress"),params:pS}),tS=Q6.extend({cursor:PO.optional()}),bU=g$.extend({params:tS.optional()}),XU=x$.extend({nextCursor:PO.optional()}),aS=a$(["working","input_required","completed","failed","cancelled"]),DU=C({taskId:K(),status:aS,ttl:L$([Q$(),Y8()]),createdAt:K(),lastUpdatedAt:K(),pollInterval:F$(Q$()),statusMessage:F$(K())}),j1=x$.extend({task:DU}),eS=H6.merge(DU),WU=A6.extend({method:y("notifications/tasks/status"),params:eS}),uw=g$.extend({method:y("tasks/get"),params:Q6.extend({taskId:K()})}),lw=x$.merge(DU),cw=g$.extend({method:y("tasks/result"),params:Q6.extend({taskId:K()})}),zm=x$.loose(),mw=bU.extend({method:y("tasks/list")}),rw=XU.extend({tasks:w$(DU)}),nw=g$.extend({method:y("tasks/cancel"),params:Q6.extend({taskId:K()})}),xO=x$.merge(DU),hO=C({uri:K(),mimeType:F$(K()),_meta:q$(K(),V$()).optional()}),fO=hO.extend({text:K()}),v8=K().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),yO=hO.extend({blob:v8}),QU=a$(["user","assistant"]),E1=C({audience:w$(QU).optional(),priority:Q$().min(0).max(1).optional(),lastModified:sI.datetime({offset:!0}).optional()}),uO=C({...F1.shape,...wU.shape,uri:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),sS=C({...F1.shape,...wU.shape,uriTemplate:K(),description:F$(K()),mimeType:F$(K()),annotations:E1.optional(),_meta:F$(m$({}))}),iw=bU.extend({method:y("resources/list")}),$P=XU.extend({resources:w$(uO)}),ow=bU.extend({method:y("resources/templates/list")}),IP=XU.extend({resourceTemplates:w$(sS)}),V8=Q6.extend({uri:K()}),UP=V8,dw=g$.extend({method:y("resources/read"),params:UP}),wP=x$.extend({contents:w$(L$([fO,yO]))}),bP=A6.extend({method:y("notifications/resources/list_changed"),params:H6.optional()}),XP=V8,DP=g$.extend({method:y("resources/subscribe"),params:XP}),WP=V8,QP=g$.extend({method:y("resources/unsubscribe"),params:WP}),GP=H6.extend({uri:K()}),YP=A6.extend({method:y("notifications/resources/updated"),params:GP}),NP=C({name:K(),description:F$(K()),required:F$(T$())}),JP=C({...F1.shape,...wU.shape,description:F$(K()),arguments:F$(w$(NP)),_meta:F$(m$({}))}),pw=bU.extend({method:y("prompts/list")}),BP=XU.extend({prompts:w$(JP)}),HP=Q6.extend({name:K(),arguments:q$(K(),K()).optional()}),tw=g$.extend({method:y("prompts/get"),params:HP}),q8=C({type:y("text"),text:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),M8=C({type:y("image"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),F8=C({type:y("audio"),data:v8,mimeType:K(),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),AP=C({type:y("tool_use"),name:K(),id:K(),input:q$(K(),V$()),_meta:q$(K(),V$()).optional()}),OP=C({type:y("resource"),resource:L$([fO,yO]),annotations:E1.optional(),_meta:q$(K(),V$()).optional()}),zP=uO.extend({type:y("resource_link")}),j8=L$([q8,M8,F8,zP,OP]),LP=C({role:QU,content:j8}),KP=x$.extend({description:K().optional(),messages:w$(LP)}),vP=A6.extend({method:y("notifications/prompts/list_changed"),params:H6.optional()}),VP=C({title:K().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),qP=C({taskSupport:a$(["required","optional","forbidden"]).optional()}),lO=C({...F1.shape,...wU.shape,description:K().optional(),inputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()),outputSchema:C({type:y("object"),properties:q$(K(),C$).optional(),required:w$(K()).optional()}).catchall(V$()).optional(),annotations:VP.optional(),execution:qP.optional(),_meta:q$(K(),V$()).optional()}),aw=bU.extend({method:y("tools/list")}),MP=XU.extend({tools:w$(lO)}),ew=x$.extend({content:w$(j8).default([]),structuredContent:q$(K(),V$()).optional(),isError:T$().optional()}),Lm=ew.or(x$.extend({toolResult:V$()})),FP=IU.extend({name:K(),arguments:q$(K(),V$()).optional()}),S1=g$.extend({method:y("tools/call"),params:FP}),jP=A6.extend({method:y("notifications/tools/list_changed"),params:H6.optional()}),Km=C({autoRefresh:T$().default(!0),debounceMs:Q$().int().nonnegative().default(300)}),GU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),EP=Q6.extend({level:GU}),E8=g$.extend({method:y("logging/setLevel"),params:EP}),SP=H6.extend({level:GU,logger:K().optional(),data:V$()}),PP=A6.extend({method:y("notifications/message"),params:SP}),kP=C({name:K().optional()}),RP=C({hints:w$(kP).optional(),costPriority:Q$().min(0).max(1).optional(),speedPriority:Q$().min(0).max(1).optional(),intelligencePriority:Q$().min(0).max(1).optional()}),TP=C({mode:a$(["auto","required","none"]).optional()}),_P=C({type:y("tool_result"),toolUseId:K().describe("The unique identifier for the corresponding tool call."),content:w$(j8).default([]),structuredContent:C({}).loose().optional(),isError:T$().optional(),_meta:q$(K(),V$()).optional()}),ZP=N8("type",[q8,M8,F8]),Zw=N8("type",[q8,M8,F8,AP,_P]),CP=C({role:QU,content:L$([Zw,w$(Zw)]),_meta:q$(K(),V$()).optional()}),gP=IU.extend({messages:w$(CP),modelPreferences:RP.optional(),systemPrompt:K().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:Q$().optional(),maxTokens:Q$().int(),stopSequences:w$(K()).optional(),metadata:C$.optional(),tools:w$(lO).optional(),toolChoice:TP.optional()}),xP=g$.extend({method:y("sampling/createMessage"),params:gP}),S8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens"]).or(K())),role:QU,content:ZP}),P8=x$.extend({model:K(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(K())),role:QU,content:L$([Zw,w$(Zw)])}),hP=C({type:y("boolean"),title:K().optional(),description:K().optional(),default:T$().optional()}),fP=C({type:y("string"),title:K().optional(),description:K().optional(),minLength:Q$().optional(),maxLength:Q$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:K().optional()}),yP=C({type:a$(["number","integer"]),title:K().optional(),description:K().optional(),minimum:Q$().optional(),maximum:Q$().optional(),default:Q$().optional()}),uP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),default:K().optional()}),lP=C({type:y("string"),title:K().optional(),description:K().optional(),oneOf:w$(C({const:K(),title:K()})),default:K().optional()}),cP=C({type:y("string"),title:K().optional(),description:K().optional(),enum:w$(K()),enumNames:w$(K()).optional(),default:K().optional()}),mP=L$([uP,lP]),rP=C({type:y("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({type:y("string"),enum:w$(K())}),default:w$(K()).optional()}),nP=C({type:y("array"),title:K().optional(),description:K().optional(),minItems:Q$().optional(),maxItems:Q$().optional(),items:C({anyOf:w$(C({const:K(),title:K()}))}),default:w$(K()).optional()}),iP=L$([rP,nP]),oP=L$([cP,mP,iP]),dP=L$([oP,hP,fP,yP]),pP=IU.extend({mode:y("form").optional(),message:K(),requestedSchema:C({type:y("object"),properties:q$(K(),dP),required:w$(K()).optional()})}),tP=IU.extend({mode:y("url"),message:K(),elicitationId:K(),url:K().url()}),aP=L$([pP,tP]),eP=g$.extend({method:y("elicitation/create"),params:aP}),sP=H6.extend({elicitationId:K()}),$k=A6.extend({method:y("notifications/elicitation/complete"),params:sP}),sw=x$.extend({action:a$(["accept","decline","cancel"]),content:J8(($)=>$===null?void 0:$,q$(K(),L$([K(),Q$(),T$(),w$(K())])).optional())}),Ik=C({type:y("ref/resource"),uri:K()});var Uk=C({type:y("ref/prompt"),name:K()}),wk=Q6.extend({ref:L$([Uk,Ik]),argument:C({name:K(),value:K()}),context:C({arguments:q$(K(),K()).optional()}).optional()}),$b=g$.extend({method:y("completion/complete"),params:wk});function cO($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function mO($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var bk=x$.extend({completion:m$({values:w$(K()).max(100),total:F$(Q$().int()),hasMore:F$(T$())})}),Xk=C({uri:K().startsWith("file://"),name:K().optional(),_meta:q$(K(),V$()).optional()}),Dk=g$.extend({method:y("roots/list"),params:Q6.optional()}),k8=x$.extend({roots:w$(Xk)}),Wk=A6.extend({method:y("notifications/roots/list_changed"),params:H6.optional()}),vm=L$([fw,L8,$b,E8,tw,pw,iw,ow,dw,DP,QP,S1,aw,uw,cw,mw,nw]),Vm=L$([hw,yw,K8,Wk,WU]),qm=L$([xw,S8,P8,sw,k8,lw,rw,j1]),Mm=L$([fw,xP,eP,Dk,uw,cw,mw,nw]),Fm=L$([hw,yw,PP,YP,bP,jP,vP,WU,$k]),jm=L$([xw,oS,bk,KP,BP,$P,IP,wP,ew,MP,lw,rw,j1]);class f extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===c.UrlElicitationRequired&&U){let b=U;if(b.elicitations)return new rO(b.elicitations,I)}return new f($,I,U)}}class rO extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function O4($){return $==="completed"||$==="failed"||$==="cancelled"}var iO=Symbol("Let zodToJsonSchema decide on which parser to use");var nO={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"},oO=($)=>typeof $==="string"?{...nO,name:$}:{...nO,...$};var dO=($)=>{let I=oO($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([b,w])=>[w._def,{def:w._def,path:[...I.basePath,I.definitionPath,b],jsonSchema:void 0}]))}};function R8($,I,U,b){if(!b?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function b$($,I,U,b,w){$[I]=U,R8($,I,b,w)}var Ib=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function M$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?Ib(I,$.currentPath):I.join("/")}}function pO($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==F.ZodAny)U.items=n($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)b$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)b$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)b$(U,"minItems",$.exactLength.value,$.exactLength.message,I),b$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function tO($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function aO(){return{type:"boolean"}}function Ub($,I){return n($.type._def,I)}var eO=($,I)=>{return n($.innerType._def,I)};function T8($,I,U){let b=U??I.dateStrategy;if(Array.isArray(b))return{anyOf:b.map((w,X)=>T8($,I,w))};switch(b){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Qk($,I)}}var Qk=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let b of $.checks)switch(b.kind){case"min":b$(U,"minimum",b.value,b.message,I);break;case"max":b$(U,"maximum",b.value,b.message,I);break}return U};function sO($,I){return{...n($.innerType._def,I),default:$.defaultValue()}}function $z($,I){return I.effectStrategy==="input"?n($.schema._def,I):M$(I)}function Iz($){return{type:"string",enum:Array.from($.values)}}var Gk=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function Uz($,I){let U=[n($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),n($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((X)=>!!X),b=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,w=[];return U.forEach((X)=>{if(Gk(X)){if(w.push(...X.allOf),X.unevaluatedProperties===void 0)b=void 0}else{let D=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:W,...Q}=X;D=Q}else b=void 0;w.push(D)}}),w.length?{allOf:w,...b}:void 0}function wz($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var _8=void 0,M6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(_8===void 0)_8=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _8},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function wb($,I){let U={type:"string"};if($.checks)for(let b of $.checks)switch(b.kind){case"min":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I);break;case"max":b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"email":switch(I.emailStrategy){case"format:email":F6(U,"email",b.message,I);break;case"format:idn-email":F6(U,"idn-email",b.message,I);break;case"pattern:zod":r$(U,M6.email,b.message,I);break}break;case"url":F6(U,"uri",b.message,I);break;case"uuid":F6(U,"uuid",b.message,I);break;case"regex":r$(U,b.regex,b.message,I);break;case"cuid":r$(U,M6.cuid,b.message,I);break;case"cuid2":r$(U,M6.cuid2,b.message,I);break;case"startsWith":r$(U,RegExp(`^${Z8(b.value,I)}`),b.message,I);break;case"endsWith":r$(U,RegExp(`${Z8(b.value,I)}$`),b.message,I);break;case"datetime":F6(U,"date-time",b.message,I);break;case"date":F6(U,"date",b.message,I);break;case"time":F6(U,"time",b.message,I);break;case"duration":F6(U,"duration",b.message,I);break;case"length":b$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,b.value):b.value,b.message,I),b$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,b.value):b.value,b.message,I);break;case"includes":{r$(U,RegExp(Z8(b.value,I)),b.message,I);break}case"ip":{if(b.version!=="v6")F6(U,"ipv4",b.message,I);if(b.version!=="v4")F6(U,"ipv6",b.message,I);break}case"base64url":r$(U,M6.base64url,b.message,I);break;case"jwt":r$(U,M6.jwt,b.message,I);break;case"cidr":{if(b.version!=="v6")r$(U,M6.ipv4Cidr,b.message,I);if(b.version!=="v4")r$(U,M6.ipv6Cidr,b.message,I);break}case"emoji":r$(U,M6.emoji(),b.message,I);break;case"ulid":{r$(U,M6.ulid,b.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{F6(U,"binary",b.message,I);break}case"contentEncoding:base64":{b$(U,"contentEncoding","base64",b.message,I);break}case"pattern:zod":{r$(U,M6.base64,b.message,I);break}}break}case"nanoid":r$(U,M6.nanoid,b.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((w)=>{})(b)}return U}function Z8($,I){return I.patternStrategy==="escape"?Nk($):$}var Yk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Nk($){let I="";for(let U=0;U<$.length;U++){if(!Yk.has($[U]))I+="\\";I+=$[U]}return I}function F6($,I,U,b){if($.format||$.anyOf?.some((w)=>w.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&b.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&b.errorMessages&&{errorMessage:{format:U}}})}else b$($,"format",I,U,b)}function r$($,I,U,b){if($.pattern||$.allOf?.some((w)=>w.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&b.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:bz(I,b),...U&&b.errorMessages&&{errorMessage:{pattern:U}}})}else b$($,"pattern",bz(I,b),U,b)}function bz($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},b=U.i?$.source.toLowerCase():$.source,w="",X=!1,D=!1,W=!1;for(let Q=0;Q<b.length;Q++){if(X){w+=b[Q],X=!1;continue}if(U.i){if(D){if(b[Q].match(/[a-z]/)){if(W)w+=b[Q],w+=`${b[Q-2]}-${b[Q]}`.toUpperCase(),W=!1;else if(b[Q+1]==="-"&&b[Q+2]?.match(/[a-z]/))w+=b[Q],W=!0;else w+=`${b[Q]}${b[Q].toUpperCase()}`;continue}}else if(b[Q].match(/[a-z]/)){w+=`[${b[Q]}${b[Q].toUpperCase()}]`;continue}}if(U.m){if(b[Q]==="^"){w+=`(^|(?<=[\r
37
37
  ]))`;continue}else if(b[Q]==="$"){w+=`($|(?=[\r
38
38
  ]))`;continue}}if(U.s&&b[Q]==="."){w+=D?`${b[Q]}\r
39
39
  `:`[${b[Q]}\r
40
- ]`;continue}if(w+=b[Q],b[Q]==="\\")X=!0;else if(D&&b[Q]==="]")D=!1;else if(!D&&b[Q]==="[")D=!0}try{new RegExp(w)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return w}function ew($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===M.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((b,w)=>({...b,[w]:n($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",w]})??F$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:n($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===M.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=aw($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===M.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===M.ZodBranded&&$.keyType._def.type._def.typeName===M.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=tw($.keyType._def,I);return{...U,propertyNames:w}}return U}function mO($,I){if(I.mapStrategy==="record")return ew($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||F$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||F$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function rO($){let I=$.values,b=Object.keys($.values).filter((X)=>{return typeof I[I[X]]!=="number"}).map((X)=>I[X]),w=Array.from(new Set(b.map((X)=>typeof X)));return{type:w.length===1?w[0]==="string"?"string":"number":["string","number"],enum:b}}function nO($){return $.target==="openAi"?void 0:{not:F$({...$,currentPath:[...$.currentPath,"not"]})}}function iO($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var QU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dO($,I){if(I.target==="openApi3")return oO($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in QU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=QU[X._def.typeName];return D&&!w.includes(D)?[...w,D]:w},[]);return{type:b.length>1?b:b[0]}}else if(U.every((b)=>b._def.typeName==="ZodLiteral"&&!b.description)){let b=U.reduce((w,X)=>{let D=typeof X._def.value;switch(D){case"string":case"number":case"boolean":return[...w,D];case"bigint":return[...w,"integer"];case"object":if(X._def.value===null)return[...w,"null"];case"symbol":case"undefined":case"function":default:return w}},[]);if(b.length===U.length){let w=b.filter((X,D,W)=>W.indexOf(X)===D);return{type:w.length>1?w:w[0],enum:U.reduce((X,D)=>{return X.includes(D._def.value)?X:[...X,D._def.value]},[])}}}else if(U.every((b)=>b._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((b,w)=>[...b,...w._def.values.filter((X)=>!b.includes(X))],[])};return oO($,I)}var oO=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((b,w)=>n(b._def,{...I,currentPath:[...I.currentPath,"anyOf",`${w}`]})).filter((b)=>!!b&&(!I.strictUnions||typeof b==="object"&&Object.keys(b).length>0));return U.length?{anyOf:U}:void 0};function pO($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:QU[$.innerType._def.typeName],nullable:!0};return{type:[QU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let b=n($.innerType._def,{...I,currentPath:[...I.currentPath]});if(b&&"$ref"in b)return{allOf:[b],nullable:!0};return b&&{...b,nullable:!0}}let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function tO($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",v8(U,"type",b.message,I);break;case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function aO($,I){let U=I.target==="openAi",b={type:"object",properties:{}},w=[],X=$.shape();for(let W in X){let Q=X[W];if(Q===void 0||Q._def===void 0)continue;let G=pP(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let N=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(N===void 0)continue;if(b.properties[W]=N,!G)w.push(W)}if(w.length)b.required=w;let D=dP($,I);if(D!==void 0)b.additionalProperties=D;return b}function dP($,I){if($.catchall._def.typeName!=="ZodNever")return n($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function pP($){try{return $.isOptional()}catch{return!0}}var eO=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return n($.innerType._def,I);let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:F$(I)},U]}:F$(I)};var sO=($,I)=>{if(I.pipeStrategy==="input")return n($.in._def,I);else if(I.pipeStrategy==="output")return n($.out._def,I);let U=n($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),b=n($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,b].filter((w)=>w!==void 0)}};function $z($,I){return n($.type._def,I)}function Iz($,I){let b={type:"array",uniqueItems:!0,items:n($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)b$(b,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)b$(b,"maxItems",$.maxSize.value,$.maxSize.message,I);return b}function Uz($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[]),additionalItems:n($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[])}}function wz($){return{not:F$($)}}function bz($){return F$($)}var Xz=($,I)=>{return n($.innerType._def,I)};var Dz=($,I,U)=>{switch(I){case M.ZodString:return aw($,U);case M.ZodNumber:return tO($,U);case M.ZodObject:return aO($,U);case M.ZodBigInt:return CO($,U);case M.ZodBoolean:return gO();case M.ZodDate:return V8($,U);case M.ZodUndefined:return wz(U);case M.ZodNull:return iO(U);case M.ZodArray:return ZO($,U);case M.ZodUnion:case M.ZodDiscriminatedUnion:return dO($,U);case M.ZodIntersection:return uO($,U);case M.ZodTuple:return Uz($,U);case M.ZodRecord:return ew($,U);case M.ZodLiteral:return lO($,U);case M.ZodEnum:return yO($);case M.ZodNativeEnum:return rO($);case M.ZodNullable:return pO($,U);case M.ZodOptional:return eO($,U);case M.ZodMap:return mO($,U);case M.ZodSet:return Iz($,U);case M.ZodLazy:return()=>$.getter()._def;case M.ZodPromise:return $z($,U);case M.ZodNaN:case M.ZodNever:return nO(U);case M.ZodEffects:return fO($,U);case M.ZodAny:return F$(U);case M.ZodUnknown:return bz(U);case M.ZodDefault:return hO($,U);case M.ZodBranded:return tw($,U);case M.ZodReadonly:return Xz($,U);case M.ZodCatch:return xO($,U);case M.ZodPipeline:return sO($,U);case M.ZodFunction:case M.ZodVoid:case M.ZodSymbol:return;default:return((b)=>{return})(I)}};function n($,I,U=!1){let b=I.seen.get($);if(I.override){let W=I.override?.($,I,b,U);if(W!==RO)return W}if(b&&!U){let W=tP(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=Dz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)aP($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var tP=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:pw(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,b)=>I.currentPath[b]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),F$(I);return I.$refStrategy==="seen"?F$(I):void 0}}},aP=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var M8=($,I)=>{let U=_O(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,N])=>({...Q,[G]:n(N._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??F$(U)}),{}):void 0,w=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,X=n($._def,w===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,w]},!1)??F$(U),D=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(D!==void 0)X.title=D;if(U.flags.hasReferencedOpenAiAnyType){if(!b)b={};if(!b[U.openAiAnyTypeName])b[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let W=w===void 0?b?{...X,[U.definitionPath]:b}:X:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,w].join("/"),[U.definitionPath]:{...b,[w]:X}};if(U.target==="jsonSchema7")W.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")W.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in W)||("oneOf"in W)||("allOf"in W)||("type"in W)&&Array.isArray(W.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return W};function eP($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function j8($,I){if(J6($))return i9($,{target:eP(I?.target),io:I?.pipeStrategy??"input"});return M8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function E8($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function S8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var sP=60000;class P8{constructor($){if(this._options=$,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(Tw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(Zw,(I)=>{this._onprogress(I)}),this.setRequestHandler(_w,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(Cw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(xw,async(I,U)=>{let b=async()=>{let w=I.params.taskId;if(this._taskMessageQueue){let D;while(D=await this._taskMessageQueue.dequeue(w,U.sessionId)){if(D.type==="response"||D.type==="error"){let W=D.message,Q=W.id,G=this._requestResolvers.get(Q);if(G)if(this._requestResolvers.delete(Q),D.type==="response")G(W);else{let N=W,B=new h(N.error.code,N.error.message,N.error.data);G(B)}else{let N=D.type==="response"?"Response":"Error";this._onerror(new Error(`${N} handler missing for request ${Q}`))}continue}await this._transport?.send(D.message,{relatedRequestId:U.requestId})}}let X=await this._taskStore.getTask(w,U.sessionId);if(!X)throw new h(c.InvalidParams,`Task not found: ${w}`);if(!A4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(A4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[H4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(hw,async(I,U)=>{try{let{tasks:b,nextCursor:w}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:b,nextCursor:w,_meta:{}}}catch(b){throw new h(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(yw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new h(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(A4(b.status))throw new h(c.InvalidParams,`Cannot cancel task in terminal status: ${b.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let w=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!w)throw new h(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof h)throw b;throw new h(c.InvalidRequest,`Failed to cancel task: ${b instanceof Error?b.message:String(b)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,b,w=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(b,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:w,onTimeout:b})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),h.fromError(c.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(w)=>{U?.(w),this._onerror(w)};let b=this._transport?.onmessage;this._transport.onmessage=(w,X)=>{if(b?.(w,X),$U(w)||zO(w))this._onresponse(w);else if(X8(w))this._onrequest(w,X);else if(OO(w))this._onnotification(w);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(w)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let I=h.fromError(c.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,b=this._transport,w=$.params?._meta?.[H4]?.taskId;if(U===void 0){let G={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(w&&this._taskMessageQueue)this._enqueueTaskMessage(w,{type:"error",message:G,timestamp:Date.now()},b?.sessionId).catch((N)=>this._onerror(new Error(`Failed to enqueue error response: ${N}`)));else b?.send(G).catch((N)=>this._onerror(new Error(`Failed to send an error response: ${N}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=JO($.params)?$.params.task:void 0,W=this._taskStore?this.requestTaskStore($,b?.sessionId):void 0,Q={signal:X.signal,sessionId:b?.sessionId,_meta:$.params?._meta,sendNotification:async(G)=>{let N={relatedRequestId:$.id};if(w)N.relatedTask={taskId:w};await this.notification(G,N)},sendRequest:async(G,N,B)=>{let H={...B,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let J=H.relatedTask?.taskId??w;if(J&&W)await W.updateTaskStatus(J,"input_required");return await this.request(G,N,H)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:w,taskStore:W,taskRequestedTtl:D?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(D)this.assertTaskHandlerCapability($.method)}).then(()=>U($,Q)).then(async(G)=>{if(X.signal.aborted)return;let N={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)},async(G)=>{if(X.signal.aborted)return;let N={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(G.code)?G.code:c.InternalError,message:G.message??"Internal error",...G.data!==void 0&&{data:G.data}}};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"error",message:N,timestamp:Date.now()},b?.sessionId);else await b?.send(N)}).catch((G)=>this._onerror(new Error(`Failed to send response: ${G}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,b=Number(I),w=this._progressHandlers.get(b);if(!w){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let X=this._responseHandlers.get(b),D=this._timeoutInfo.get(b);if(D&&X&&D.resetTimeoutOnProgress)try{this._resetTimeout(b)}catch(W){this._responseHandlers.delete(b),this._progressHandlers.delete(b),this._cleanupTimeout(b),X(W);return}w(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),$U($))U($);else{let X=new h($.error.code,$.error.message,$.error.data);U(X)}return}let b=this._responseHandlers.get(I);if(b===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let w=!1;if($U($)&&$.result&&typeof $.result==="object"){let X=$.result;if(X.task&&typeof X.task==="object"){let D=X.task;if(typeof D.taskId==="string")w=!0,this._taskProgressTokens.set(D.taskId,I)}}if(!w)this._progressHandlers.delete(I);if($U($))b($);else{let X=h.fromError($.error.code,$.error.message,$.error.data);b(X)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:b}=U??{};if(!b){try{yield{type:"result",result:await this.request($,I,U)}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,M1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new h(c.InternalError,"Task creation did not return a task");while(!0){let D=await this.getTask({taskId:w},U);if(yield{type:"taskStatus",task:D},A4(D.status)){if(D.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};else if(D.status==="failed")yield{type:"error",error:new h(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new h(c.InternalError,`Task ${w} was cancelled`)};return}if(D.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};return}let W=D.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((Q)=>setTimeout(Q,W)),U?.signal?.throwIfAborted()}}catch(X){yield{type:"error",error:X instanceof h?X:new h(c.InternalError,String(X))}}}request($,I,U){let{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X,task:D,relatedTask:W}=U??{};return new Promise((Q,G)=>{let N=(q)=>{G(q)};if(!this._transport){N(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){N(q);return}U?.signal?.throwIfAborted();let B=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:B};if(U?.onprogress)this._progressHandlers.set(B,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:B}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[H4]:W}};let J=(q)=>{this._responseHandlers.delete(B),this._progressHandlers.delete(B),this._cleanupTimeout(B),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:B,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof h?q:new h(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(B,(q)=>{if(U?.signal?.aborted)return;if(q instanceof Error)return G(q);try{let k=B4(I,q.result);if(!k.success)G(k.error);else Q(k.data)}catch(k){G(k)}}),U?.signal?.addEventListener("abort",()=>{J(U?.signal?.reason)});let A=U?.timeout??sP,O=()=>J(h.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(B,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(B);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${B}`))};this._requestResolvers.set(B,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(B),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(B),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},gw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},fw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},vO,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let D={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[H4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:D,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let D={...$,jsonrpc:"2.0"};if(I?.relatedTask)D={...D,params:{...D.params,_meta:{...D.params?._meta||{},[H4]:I.relatedTask}}};this._transport?.send(D,I).catch((W)=>this._onerror(W))});return}let X={...$,jsonrpc:"2.0"};if(I?.relatedTask)X={...X,params:{...X.params,_meta:{...X.params?._meta||{},[H4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=E8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=S8($,b);return Promise.resolve(I(X,w))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=E8($);this._notificationHandlers.set(U,(b)=>{let w=S8($,b);return Promise.resolve(I(w))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let b=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,b)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let b of U)if(b.type==="request"&&X8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new h(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(w);else this._onerror(new Error(`Resolver missing for request ${w} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let b=await this._taskStore?.getTask($);if(b?.pollInterval)U=b.pollInterval}catch{}return new Promise((b,w)=>{if(I.aborted){w(new h(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new h(c.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(b)=>{if(!$)throw new Error("No request provided");return await U.createTask(b,$.id,{method:$.method,params:$.params},I)},getTask:async(b)=>{let w=await U.getTask(b,I);if(!w)throw new h(c.InvalidParams,"Failed to retrieve task: Task not found");return w},storeTaskResult:async(b,w,X)=>{await U.storeTaskResult(b,w,X,I);let D=await U.getTask(b,I);if(D){let W=XU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),A4(D.status))this._cleanupTaskProgressHandler(b)}},getTaskResult:(b)=>{return U.getTaskResult(b,I)},updateTaskStatus:async(b,w,X)=>{let D=await U.getTask(b,I);if(!D)throw new h(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(A4(D.status))throw new h(c.InvalidParams,`Cannot update task "${b}" from terminal status "${D.status}" to "${w}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(b,w,X,I);let W=await U.getTask(b,I);if(W){let Q=XU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),A4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function Wz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Qz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(Wz(D)&&Wz(X))U[w]={...D,...X};else U[w]=X}return U}var yv=LH(qQ(),1),uv=LH(fv(),1);function Qx(){let $=new yv.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return uv.default($),$}class _Q{constructor($){this._ajv=$??Qx()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class ZQ{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function lv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function cv($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class CQ extends P8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(WU.options.map((U,b)=>[U,b])),this.isMessageIgnored=(U,b)=>{let w=this._loggingLevels.get(b);return w?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(w):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new _Q,this.setRequestHandler(Q8,(U)=>this._oninitialize(U)),this.setNotificationHandler(G8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(O8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=WU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new ZQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Qz(this._capabilities,$)}setRequestHandler($,I){let b=J4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(J6(b)){let D=b;w=D._zod?.def?.value??D.value}else{let D=b;w=D._def?.value??D.value}if(typeof w!=="string")throw new Error("Schema method literal must be a string");if(w==="tools/call"){let D=async(W,Q)=>{let G=B4(E1,W);if(!G.success){let J=G.error instanceof Error?G.error.message:String(G.error);throw new h(c.InvalidParams,`Invalid tools/call request: ${J}`)}let{params:N}=G.data,B=await Promise.resolve(I(W,Q));if(N.task){let J=B4(M1,B);if(!J.success){let A=J.error instanceof Error?J.error.message:String(J.error);throw new h(c.InvalidParams,`Invalid task creation result: ${A}`)}return J.data}let H=B4(iw,B);if(!H.success){let J=H.error instanceof Error?H.error.message:String(H.error);throw new h(c.InvalidParams,`Invalid tools/call result: ${J}`)}return H.data};return super.setRequestHandler($,D)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){cv(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;lv(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:NO.includes(I)?I:w8,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"},Rw)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],b=Array.isArray(U.content)?U.content:[U.content],w=b.some((Q)=>Q.type==="tool_result"),X=$.messages.length>1?$.messages[$.messages.length-2]:void 0,D=X?Array.isArray(X.content)?X.content:[X.content]:[],W=D.some((Q)=>Q.type==="tool_use");if(w){if(b.some((Q)=>Q.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!W)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(W){let Q=new Set(D.filter((N)=>N.type==="tool_use").map((N)=>N.id)),G=new Set(b.filter((N)=>N.type==="tool_result").map((N)=>N.toolUseId));if(Q.size!==G.size||![...Q].every((N)=>G.has(N)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},L8,I);return this.request({method:"sampling/createMessage",params:$},z8,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let b=$;return this.request({method:"elicitation/create",params:b},ow,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let b=$.mode==="form"?$:{...$,mode:"form"},w=await this.request({method:"elicitation/create",params:b},ow,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new h(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof h)throw X;throw new h(c.InternalError,`Error validating elicitation response: ${X instanceof Error?X.message:String(X)}`)}return w}}}createElicitationCompletionNotifier($,I){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},K8,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var rv=Symbol.for("mcp.completable");function gQ($){return!!$&&typeof $==="object"&&rv in $}function nv($){return $[rv]?.complete}var mv;(function($){$.Completable="McpCompletable"})(mv||(mv={}));var Gx=/^[A-Za-z0-9._-]{1,128}$/;function Nx($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Gx.test($)){let U=$.split("").filter((b)=>!/[A-Za-z0-9._-]/.test(b)).filter((b,w,X)=>X.indexOf(b)===w);return I.push(`Tool name contains invalid characters: ${U.map((b)=>`"${b}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function Yx($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function xQ($){let I=Nx($);return Yx($,I.warnings),I.isValid}class hQ{constructor($){this._mcpServer=$}registerToolTask($,I,U){let b={taskSupport:"required",...I.execution};if(b.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,b,I._meta,U)}}class yQ{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new CQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new hQ(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(nw)),this.server.assertCanSetRequestHandler(F4(E1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(nw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=q1(I.inputSchema);return b?j8(b,{strictUnions:!0,pipeStrategy:"input"}):Bx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=q1(I.outputSchema);if(b)U.outputSchema=j8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(E1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new h(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Tool ${$.params.name} disabled`);let b=!!$.params.task,w=U.execution?.taskSupport,X="createTask"in U.handler;if((w==="required"||w==="optional")&&!X)throw new h(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new h(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(w==="optional"&&!b&&X)return await this.handleAutomaticTaskPolling(U,$,I);let D=await this.validateToolInput(U,$.params.arguments,$.params.name),W=await this.executeToolHandler(U,D,I);if(b)return W;return await this.validateToolOutput(U,W,$.params.name),W}catch(U){if(U instanceof h){if(U.code===c.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let w=q1($.inputSchema)??$.inputSchema,X=await qw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=Fw(D);throw new h(c.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${W}`)}return X.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new h(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=q1($.outputSchema),w=await qw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=Fw(X);throw new h(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${D}`)}}async executeToolHandler($,I,U){let b=$.handler;if("createTask"in b){if(!U.taskStore)throw new Error("No task store provided.");let X={...U,taskStore:U.taskStore};if($.inputSchema){let D=b;return await Promise.resolve(D.createTask(I,X))}else{let D=b;return await Promise.resolve(D.createTask(X))}}if($.inputSchema){let X=b;return await Promise.resolve(X(I,U))}else{let X=b;return await Promise.resolve(X(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let b=await this.validateToolInput($,I.params.arguments,I.params.name),w=$.handler,X={...U,taskStore:U.taskStore},D=b?await Promise.resolve(w.createTask(b,X)):await Promise.resolve(w.createTask(X)),W=D.task.taskId,Q=D.task,G=Q.pollInterval??5000;while(Q.status!=="completed"&&Q.status!=="failed"&&Q.status!=="cancelled"){await new Promise((B)=>setTimeout(B,G));let N=await U.taskStore.getTask(W);if(!N)throw new h(c.InternalError,`Task ${W} not found during polling`);Q=N}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(dw,async($)=>{switch($.params.ref.type){case"ref/prompt":return EO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return SO($),this.handleResourceCompletion($,$.params.ref);default:throw new h(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new h(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return _U;let w=J4(U.argsSchema)?.[$.params.argument.name];if(!gQ(w))return _U;let X=nv(w);if(!X)return _U;let D=await X($.params.argument.value,$.params.context);return ov(D)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((X)=>X.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return _U;throw new h(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return _U;let w=await b($.params.argument.value,$.params.context);return ov(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(uw)),this.server.assertCanSetRequestHandler(F4(lw)),this.server.assertCanSetRequestHandler(F4(cw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(uw,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([w,X])=>X.enabled).map(([w,X])=>({uri:w,name:X.name,...X.metadata})),b=[];for(let w of Object.values(this._registeredResourceTemplates)){if(!w.resourceTemplate.listCallback)continue;let X=await w.resourceTemplate.listCallback(I);for(let D of X.resources)b.push({...w.metadata,...D})}return{resources:[...U,...b]}}),this.server.setRequestHandler(lw,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(cw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new h(c.InvalidParams,`Resource ${U} disabled`);return b.readCallback(U,I)}for(let w of Object.values(this._registeredResourceTemplates)){let X=w.resourceTemplate.uriTemplate.match(U.toString());if(X)return w.readCallback(U,X,I)}throw new h(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(mw)),this.server.assertCanSetRequestHandler(F4(rw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(mw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?Hx(I.argsSchema):void 0}})})),this.server.setRequestHandler(rw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new h(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new h(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=q1(U.argsSchema),w=await qw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=Fw(W);throw new h(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${Q}`)}let X=w.data,D=U.callback;return await Promise.resolve(D(X,I))}else{let b=U.callback;return await Promise.resolve(b(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let b;if(typeof U[0]==="object")b=U.shift();let w=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let X=this._createRegisteredResource($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let X=this._createRegisteredResourceTemplate($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}}registerResource($,I,U,b){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}_createRegisteredResource($,I,U,b,w){let X={name:$,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({uri:null}),update:(D)=>{if(typeof D.uri!=="undefined"&&D.uri!==U){if(delete this._registeredResources[U],D.uri)this._registeredResources[D.uri]=X}if(typeof D.name!=="undefined")X.name=D.name;if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.metadata!=="undefined")X.metadata=D.metadata;if(typeof D.callback!=="undefined")X.readCallback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=X,X}_createRegisteredResourceTemplate($,I,U,b,w){let X={resourceTemplate:U,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Q)=>{if(typeof Q.name!=="undefined"&&Q.name!==$){if(delete this._registeredResourceTemplates[$],Q.name)this._registeredResourceTemplates[Q.name]=X}if(typeof Q.title!=="undefined")X.title=Q.title;if(typeof Q.template!=="undefined")X.resourceTemplate=Q.template;if(typeof Q.metadata!=="undefined")X.metadata=Q.metadata;if(typeof Q.callback!=="undefined")X.readCallback=Q.callback;if(typeof Q.enabled!=="undefined")X.enabled=Q.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=X;let D=U.uriTemplate.variableNames;if(Array.isArray(D)&&D.some((Q)=>!!U.completeCallback(Q)))this.setCompletionRequestHandler();return X}_createRegisteredPrompt($,I,U,b,w){let X={title:I,description:U,argsSchema:b===void 0?void 0:o4(b),callback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(D)=>{if(typeof D.name!=="undefined"&&D.name!==$){if(delete this._registeredPrompts[$],D.name)this._registeredPrompts[D.name]=X}if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.description!=="undefined")X.description=D.description;if(typeof D.argsSchema!=="undefined")X.argsSchema=o4(D.argsSchema);if(typeof D.callback!=="undefined")X.callback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=X,b){if(Object.values(b).some((W)=>{let Q=W instanceof B6?W._def?.innerType:W;return gQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){xQ($);let G={title:I,description:U,inputSchema:iv(b),outputSchema:iv(w),annotations:X,execution:D,_meta:W,handler:Q,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(N)=>{if(typeof N.name!=="undefined"&&N.name!==$){if(typeof N.name==="string")xQ(N.name);if(delete this._registeredTools[$],N.name)this._registeredTools[N.name]=G}if(typeof N.title!=="undefined")G.title=N.title;if(typeof N.description!=="undefined")G.description=N.description;if(typeof N.paramsSchema!=="undefined")G.inputSchema=o4(N.paramsSchema);if(typeof N.outputSchema!=="undefined")G.outputSchema=o4(N.outputSchema);if(typeof N.callback!=="undefined")G.handler=N.callback;if(typeof N.annotations!=="undefined")G.annotations=N.annotations;if(typeof N._meta!=="undefined")G._meta=N._meta;if(typeof N.enabled!=="undefined")G.enabled=N.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,b,w,X;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let W=I[0];if(fQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!fQ(I[0]))X=I.shift()}else if(typeof W==="object"&&W!==null)X=I.shift()}let D=I[0];return this._createRegisteredTool($,void 0,U,b,w,X,{taskSupport:"forbidden"},void 0,D)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:b,description:w,inputSchema:X,outputSchema:D,annotations:W,_meta:Q}=I;return this._createRegisteredTool($,b,w,X,D,W,{taskSupport:"forbidden"},Q,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let b;if(I.length>1)b=I.shift();let w=I[0],X=this._createRegisteredPrompt($,void 0,U,b,w);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:b,description:w,argsSchema:X}=I,D=this._createRegisteredPrompt($,b,w,X,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),D}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var Bx={type:"object",properties:{}};function dv($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Jx($){return"_def"in $||"_zod"in $||dv($)}function fQ($){if(typeof $!=="object"||$===null)return!1;if(Jx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(dv)}function iv($){if(!$)return;if(fQ($))return o4($);return $}function Hx($){let I=J4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=lA(b),X=cA(b);return{name:U,description:w,required:!X}})}function F4($){let U=J4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Mw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function ov($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var _U={completion:{values:[],hasMore:!1}};import tv from"node:process";class uQ{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
41
- `);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Ax(I)}clear(){this._buffer=void 0}}function Ax($){return LO.parse(JSON.parse($))}function pv($){return JSON.stringify($)+`
42
- `}class lQ{constructor($=tv.stdin,I=tv.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new uQ,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let U=pv($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Ox,defineProperty:av,getOwnPropertyDescriptor:zx,getOwnPropertyNames:ev,getPrototypeOf:Lx}=Object,Kx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[ev($)[0]]((I={exports:{}}).exports,I),I.exports},vx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=ev(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Kx.call($,W)&&W!==U)av($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=zx(I,W))||b.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?Ox(Lx($)):{},vx(I||!$||!$.__esModule?av(U,"default",{value:$,enumerable:!0}):U,$)),sv=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Vx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=sv().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),qx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=sv().default,b=Vx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),u6=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=qx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),_$=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=u6();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let b=null,w=!1,X=!1,D=!1;function W(){if(b===null){D=!0;return}if(X)return;if(X=!0,typeof b==="function")b();else if(b)b.unsubscribe()}if(b=$({next(Q){var G;if(w)return;(G=U.next)===null||G===void 0||G.call(U,Q)},error(Q){var G;if(w)return;w=!0,(G=U.error)===null||G===void 0||G.call(U,Q),W()},complete(){var Q;if(w)return;w=!0,(Q=U.complete)===null||Q===void 0||Q.call(U),W()}}),D)W();return{unsubscribe:W}},pipe(...U){return U.reduce(Fx,I)}};return I}function Fx($,I){return I($)}function cQ($){let I=new AbortController;return new Promise((b,w)=>{let X=!1;function D(){if(X)return;X=!0,W.unsubscribe()}I.signal.addEventListener("abort",()=>{w(I.signal.reason)});let W=$.subscribe({next(Q){X=!0,b(Q),D()},error(Q){w(Q)},complete(){I.abort(),D()}})})}function mQ($){return(I)=>{let U=0,b=null,w=[];function X(){if(b)return;b=I.subscribe({next(W){for(let G of w){var Q;(Q=G.next)===null||Q===void 0||Q.call(G,W)}},error(W){for(let G of w){var Q;(Q=G.error)===null||Q===void 0||Q.call(G,W)}},complete(){for(let Q of w){var W;(W=Q.complete)===null||W===void 0||W.call(Q)}}})}function D(){if(U===0&&b){let W=b;b=null,W.unsubscribe()}}return l6((W)=>{return U++,w.push(W),X(),{unsubscribe(){U--,D();let Q=w.findIndex((G)=>G===W);if(Q>-1)w.splice(Q,1)}}})}}var kd=Symbol();function hb($){let I=$,U=[],b=(D)=>{if(I!==void 0)D.next(I);U.push(D)},w=(D)=>{U.splice(U.indexOf(D),1)},X=l6((D)=>{return b(D),()=>{w(D)}});return X.next=(D)=>{if(I===D)return;I=D;for(let W of U)W.next(D)},X.get=()=>I,X}function $V($){return l6((I)=>{function U(w=0,X=$.op){let D=$.links[w];if(!D)throw new Error("No more links to execute - did you forget to add an ending link?");return D({op:X,next(Q){return U(w+1,Q)}})}return U().subscribe(I)})}var ZU={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var IV=[ZU.BAD_GATEWAY,ZU.SERVICE_UNAVAILABLE,ZU.GATEWAY_TIMEOUT,ZU.INTERNAL_SERVER_ERROR];function M4($){return!!$&&!Array.isArray($)&&typeof $==="object"}var{create:Mx,defineProperty:wV,getOwnPropertyDescriptor:jx,getOwnPropertyNames:bV,getPrototypeOf:Ex}=Object,Sx=Object.prototype.hasOwnProperty,CU=($,I)=>function(){return I||$[bV($)[0]]((I={exports:{}}).exports,I),I.exports},Px=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=bV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!Sx.call($,W)&&W!==U)wV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=jx(I,W))||b.enumerable})}return $},gU=($,I,U)=>(U=$!=null?Mx(Ex($)):{},Px(I||!$||!$.__esModule?wV(U,"default",{value:$,enumerable:!0}):U,$)),XV=()=>{},UV=($)=>{if(Object.freeze)Object.freeze($)};function DV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(XV,{get(X,D){if(typeof D!=="string"||D==="then")return;return DV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1],G={args:W,path:I};if(Q==="call")G={args:W.length>=2?[W[1]]:[],path:I.slice(0,-1)};else if(Q==="apply")G={args:W.length>=2?W[1]:[],path:I.slice(0,-1)};return UV(G.args),UV(G.path),$(G)}})),U[w]}var fb=($)=>DV($,[],Object.create(null)),rQ=($)=>{return new Proxy(XV,{get(I,U){if(U==="then")return;return $(U)}})};var WV=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),kx=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=WV().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Rx=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=WV().default,b=kx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),nQ=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=Rx();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),yb=CU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=nQ();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),md=gU(yb(),1);var od=gU(nQ(),1);var ub=gU(yb(),1);function Cx($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ub.default(ub.default({},$),{},{error:b})}}return{ok:!0,result:ub.default(ub.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var iQ=class extends Error{constructor(){super("Unable to transform response from server")}};function oQ($,I){let U;try{U=Cx($,I)}catch(b){throw new iQ}if(!U.ok&&(!M4(U.error.error)||typeof U.error.error.code!=="number"))throw new iQ;if(U.ok&&!M4(U.result))throw new iQ;return U}var dd=gU(yb(),1);var pd=Symbol();var lb=Y$(u6(),1),f1=Y$(_$(),1);function QV($){return $ instanceof j4}function fx($){return M4($)&&M4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function yx($,I){if(typeof $==="string")return $;if(M4($)&&typeof $.message==="string")return $.message;return I}var j4=class $ extends Error{constructor(I,U){var b,w;let X=U===null||U===void 0?void 0:U.cause;super(I,{cause:X});lb.default(this,"cause",void 0),lb.default(this,"shape",void 0),lb.default(this,"data",void 0),lb.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=X,this.shape=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error,this.data=U===null||U===void 0||(w=U.result)===null||w===void 0?void 0:w.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let b=I;if(QV(b)){if(U.meta)b.meta=f1.default(f1.default({},b.meta),U.meta);return b}if(fx(b))return new $(b.error.message,f1.default(f1.default({},U),{},{result:b}));return new $(yx(b,"Unknown error"),f1.default(f1.default({},U),{},{cause:b}))}};function cb($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var GV=($)=>typeof $==="function";function NV($){if($)return $;if(typeof window!=="undefined"&&GV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&GV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var xU=Y$(_$(),1);function mb($){return{url:$.url.toString(),fetch:$.fetch,transformer:cb($.transformer),methodOverride:$.methodOverride}}function ux($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var lx={query:"GET",mutation:"POST",subscription:"PATCH"};function YV($){return"input"in $?$.transformer.input.serialize($.input):ux($.inputs.map((I)=>$.transformer.input.serialize(I)))}var y1=($)=>{let I=$.url.split("?"),b=I[0].replace(/\/$/,"")+"/"+$.path,w=[];if(I[1])w.push(I[1]);if("inputs"in $)w.push("batch=1");if($.type==="query"||$.type==="subscription"){let X=YV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},BV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=YV($);return I!==void 0?JSON.stringify(I):void 0},dQ=($)=>{return rb(xU.default(xU.default({},$),{},{contentTypeHeader:"application/json",getUrl:y1,getBody:BV}))},cx=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},mx=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new cx};async function JV($){var I;mx($.signal);let U=$.getUrl($),b=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:lx[$.type],X=await(async()=>{let W=await $.headers();if(Symbol.iterator in W)return Object.fromEntries(W);return W})(),D=xU.default(xU.default(xU.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{"trpc-accept":$.trpcAcceptHeader}:void 0),X);return NV($.fetch)(U,{method:w,signal:$.signal,body:b,headers:D})}async function rb($){let I={},U=await JV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function HV($){return $ instanceof Uint8Array||$ instanceof Blob}function AV($){return $ instanceof FormData}var u1=Y$(_$(),1),rx=($)=>{if("input"in $){let{input:I}=$;if(AV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:void 0,getUrl:y1,getBody:()=>I}))}if(HV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return rb(u1.default(u1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:y1,getBody:()=>I}))}}return dQ($)};function pQ($){let I=mb($);return()=>{return(U)=>{let{op:b}=U;return l6((w)=>{let{path:X,input:D,type:W}=b;if(W==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let Q=rx(u1.default(u1.default({},I),{},{type:W,path:X,input:D,signal:b.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:b});return $.headers}})),G=void 0;return Q.then((N)=>{G=N.meta;let B=oQ(N.json,I.transformer.output);if(!B.ok){w.error(j4.from(B.error,{meta:G}));return}w.next({context:N.meta,result:B.result}),w.complete()}).catch((N)=>{w.error(j4.from(N,{meta:G}))}),()=>{}})}}}var op=Y$(_$(),1);var tp=Y$(_$(),1);var tQ=($,...I)=>{return typeof $==="function"?$(...I):$},Ut=Y$(u6(),1);function nx(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function ix($){let I=await tQ($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function ox($){let I={method:"connectionParams",data:await tQ($)};return JSON.stringify(I)}var wt=Y$(u6(),1);var $1=Y$(u6(),1);function dx($){let{promise:I,resolve:U,reject:b}=nx();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function px($,{intervalMs:I,pongTimeoutMs:U}){let b,w;function X(){b=setTimeout(()=>{$.send("PING"),w=setTimeout(()=>{$.close()},U)},I)}function D(){clearTimeout(b),X()}function W(){clearTimeout(w),D()}$.addEventListener("open",X),$.addEventListener("message",({data:Q})=>{if(clearTimeout(b),X(),Q==="PONG")W()}),$.addEventListener("close",()=>{clearTimeout(b),clearTimeout(w)})}var tx=class ${constructor(I){var U;if($1.default(this,"id",++$.connectCount),$1.default(this,"WebSocketPonyfill",void 0),$1.default(this,"urlOptions",void 0),$1.default(this,"keepAliveOpts",void 0),$1.default(this,"wsObservable",hb(null)),$1.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=ix(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)px(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await dx(b),I.urlOptions.connectionParams)b.send(await ox(I.urlOptions.connectionParams))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};$1.default(tx,"connectCount",0);var bt=Y$(u6(),1),Xt=Y$(_$(),1);var aQ=Y$(u6(),1),OV=Y$(_$(),1),ax=class{constructor($){aQ.default(this,"links",void 0),aQ.default(this,"runtime",void 0),aQ.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return $V({links:this.links,op:OV.default(OV.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(mQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await cQ(U)).result.data}catch(U){throw j4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(w){switch(w.result.type){case"state":{var X;(X=U.onConnectionStateChange)===null||X===void 0||X.call(U,w.result);break}case"started":{var D;(D=U.onStarted)===null||D===void 0||D.call(U,{context:w.context});break}case"stopped":{var W;(W=U.onStopped)===null||W===void 0||W.call(U);break}case"data":case void 0:{var Q;(Q=U.onData)===null||Q===void 0||Q.call(U,w.result.data);break}}},error(w){var X;(X=U.onError)===null||X===void 0||X.call(U,w)},complete(){var w;(w=U.onComplete)===null||w===void 0||w.call(U)}})}};var ex=Symbol.for("trpc_untypedClient"),sx={query:"query",mutate:"mutation",subscribe:"subscription"},$h=($)=>{return sx[$]};function Ih($){let I=fb(({path:U,args:b})=>{let w=[...U],X=$h(w.pop()),D=w.join(".");return $[X](D,...b)});return rQ((U)=>{if(U===ex)return $;return I[U]})}function zV($){let I=new ax($);return Ih(I)}var Zt=Y$(_$(),1);var Ct=Y$(_$(),1);var Uh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(w){var X,D,W,Q=2;for(typeof Symbol!="undefined"&&(D=Symbol.asyncIterator,W=Symbol.iterator);Q--;){if(D&&(X=w[D])!=null)return X.call(w);if(W&&(X=w[W])!=null)return new b(X.call(w));D="@@asyncIterator",W="@@iterator"}throw new TypeError("Object is not async iterable")}function b(w){function X(D){if(Object(D)!==D)return Promise.reject(new TypeError(D+" is not an object."));var W=D.done;return Promise.resolve(D.value).then(function(Q){return{value:Q,done:W}})}return b=function D(W){this.s=W,this.n=W.next},b.prototype={s:null,n:null,next:function D(){return X(this.n.apply(this.s,arguments))},return:function D(W){var Q=this.s.return;return Q===void 0?Promise.resolve({value:W,done:!0}):X(Q.apply(this.s,arguments))},throw:function D(W){var Q=this.s.return;return Q===void 0?Promise.reject(W):X(Q.apply(this.s,arguments))}},new b(w)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),gt=Y$(Uh(),1);var xt=Y$(_$(),1);var wh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var b=typeof SuppressedError=="function"?SuppressedError:function(W,Q){var G=Error();return G.name="SuppressedError",G.error=W,G.suppressed=Q,G},w={},X=[];function D(W,Q){if(Q!=null){if(Object(Q)!==Q)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(W)var G=Q[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(G===void 0&&(G=Q[Symbol.dispose||Symbol.for("Symbol.dispose")],W))var N=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");N&&(G=function B(){try{N.call(Q)}catch(H){return Promise.reject(H)}}),X.push({v:Q,d:G,a:W})}else W&&X.push({d:Q,a:W});return Q}return{e:w,u:D.bind(null,!1),a:D.bind(null,!0),d:function W(){var Q,G=this.e,N=0;function B(){for(;Q=X.pop();)try{if(!Q.a&&N===1)return N=0,X.push(Q),Promise.resolve().then(B);if(Q.d){var J=Q.d.call(Q.v);if(Q.a)return N|=2,Promise.resolve(J).then(B,H)}else N|=1}catch(A){return H(A)}if(N===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(J){return G=G!==w?new b(J,G):J,B()}return B()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),LV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(b,w){this.v=b,this.k=w}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),bh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=LV();function b(w){return new U(w,0)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Xh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=LV();function b(X){return function(){return new w(X.apply(this,arguments))}}function w(X){var D,W;function Q(N,B){try{var H=X[N](B),J=H.value,A=J instanceof U;Promise.resolve(A?J.v:J).then(function(O){if(A){var V=N==="return"?"return":"next";if(!J.k||O.done)return Q(V,O);O=X[V](O).value}G(H.done?"return":"normal",O)},function(O){Q("throw",O)})}catch(O){G("throw",O)}}function G(N,B){switch(N){case"return":D.resolve({value:B,done:!0});break;case"throw":D.reject(B);break;default:D.resolve({value:B,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(N,B){return new Promise(function(H,J){var A={key:N,arg:B,resolve:H,reject:J,next:null};W?W=W.next=A:(D=W=A,Q(N,B))})},typeof X.return!="function"&&(this.return=void 0)}w.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},w.prototype.next=function(X){return this._invoke("next",X)},w.prototype.throw=function(X){return this._invoke("throw",X)},w.prototype.return=function(X){return this._invoke("return",X)},I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),ht=Y$(wh(),1),ft=Y$(bh(),1),yt=Y$(Xh(),1),ut=Y$(_$(),1);class eQ{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class hU{constructor($){this.generateIdentifier=$,this.kv=new eQ}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class sQ extends hU{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function Dh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function KV($,I){let U=Dh($);if("find"in U)return U.find(I);let b=U;for(let w=0;w<b.length;w++){let X=b[w];if(I(X))return X}return}function I1($,I){Object.entries($).forEach(([U,b])=>I(b,U))}function l1($,I){return $.indexOf(I)!==-1}function $G($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class IG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return KV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Wh=($)=>Object.prototype.toString.call($).slice(8,-1),UG=($)=>typeof $==="undefined",Qh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},nb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Gh=($)=>typeof $==="string",Nh=($)=>typeof $==="number"&&!isNaN($),Yh=($)=>typeof $==="boolean",vV=($)=>$ instanceof RegExp,E4=($)=>$ instanceof Map,S4=($)=>$ instanceof Set,wG=($)=>Wh($)==="Symbol",VV=($)=>$ instanceof Date&&!isNaN($.valueOf()),ib=($)=>$ instanceof Error,bG=($)=>typeof $==="number"&&isNaN($),qV=($)=>Yh($)||Qh($)||UG($)||Nh($)||Gh($)||wG($),FV=($)=>typeof $==="bigint",MV=($)=>$===1/0||$===-1/0,jV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),EV=($)=>$ instanceof URL;var ob=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),db=($)=>$.map(String).map(ob).join("."),c1=($,I)=>{let U=[],b="";for(let X=0;X<$.length;X++){let D=$.charAt(X);if(!I&&D==="\\"){let G=$.charAt(X+1);if(G==="\\"){b+="\\",X++;continue}else if(G!==".")throw Error("invalid path")}if(D==="\\"&&$.charAt(X+1)==="."){b+=".",X++;continue}if(D==="."){U.push(b),b="";continue}b+=D}let w=b;return U.push(w),U};function c6($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var SV=[c6(UG,"undefined",()=>null,()=>{return}),c6(FV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(VV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(ib,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U}),c6(vV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(S4,"set",($)=>[...$.values()],($)=>new Set($)),c6(E4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>bG($)||MV($),"number",($)=>{if(bG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(EV,"URL",($)=>$.toString(),($)=>new URL($))];function pb($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var PV=pb(($,I)=>{if(wG($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let b=U.symbolRegistry.getValue(I[1]);if(!b)throw new Error("Trying to deserialize unknown symbol");return b}),Bh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),kV=pb(jV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Bh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function XG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var RV=pb(XG,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let b={};return U.forEach((w)=>{b[w]=$[w]}),b},($,I,U)=>{let b=U.classRegistry.getValue(I[1]);if(!b)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(b.prototype),$)}),TV=pb(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let b=U.customTransformerRegistry.findByName(I[1]);if(!b)throw new Error("Trying to deserialize unknown custom value");return b.deserialize($)}),Jh=[RV,PV,TV,kV],DG=($,I)=>{let U=$G(Jh,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=$G(SV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},_V={};SV.forEach(($)=>{_V[$.annotation]=$});var ZV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return PV.untransform($,I,U);case"class":return RV.untransform($,I,U);case"custom":return TV.untransform($,I,U);case"typed-array":return kV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=_V[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var m1=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function CV($){if(l1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(l1($,"prototype"))throw new Error("prototype is not allowed as a property");if(l1($,"constructor"))throw new Error("constructor is not allowed as a property")}var gV=($,I)=>{CV(I);for(let U=0;U<I.length;U++){let b=I[U];if(S4($))$=m1($,+b);else if(E4($)){let w=+b,X=+I[++U]===0?"key":"value",D=m1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},tb=($,I,U)=>{if(CV(I),I.length===0)return U($);let b=$;for(let X=0;X<I.length-1;X++){let D=I[X];if(_6(b)){let W=+D;b=b[W]}else if(U1(b))b=b[D];else if(S4(b)){let W=+D;b=m1(b,W)}else if(E4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",N=m1(b,Q);switch(G){case"key":b=N;break;case"value":b=b.get(N);break}}}let w=I[I.length-1];if(_6(b))b[+w]=U(b[+w]);else if(U1(b))b[w]=U(b[w]);if(S4(b)){let X=m1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(E4(b)){let X=+I[I.length-2],D=m1(b,X);switch(+w===0?"key":"value"){case"key":{let Q=U(D);if(b.set(Q,b.get(D)),Q!==D)b.delete(D);break}case"value":{b.set(D,U(b.get(D)));break}}}return $};var xV=($)=>$<1;function WG($,I,U,b=[]){if(!$)return;let w=xV(U);if(!_6($)){I1($,(W,Q)=>WG(W,I,U,[...b,...c1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{WG(W,I,U,[...b,...c1(Q,w)])});I(X,b)}function hV($,I,U,b){return WG(I,(w,X)=>{$=tb($,X,(D)=>ZV(D,w,b))},U),$}function fV($,I,U){let b=xV(U);function w(X,D){let W=gV($,c1(D,b));X.map((Q)=>c1(Q,b)).forEach((Q)=>{$=tb($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=tb($,c1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var Hh=($,I)=>U1($)||_6($)||E4($)||S4($)||ib($)||XG($,I);function Ah($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function yV($,I){let U={},b=void 0;if($.forEach((w)=>{if(w.length<=1)return;if(!I)w=w.map((W)=>W.map(String)).sort((W,Q)=>W.length-Q.length);let[X,...D]=w;if(X.length===0)b=D.map(db);else U[db(X)]=D.map(db)}),b)if(nb(U))return[b];else return[b,U];else return nb(U)?void 0:U}var QG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=qV($);if(!W){Ah($,w,I);let J=D.get($);if(J)return b?{transformedValue:null}:J}if(!Hh($,U)){let J=DG($,U),A=J?{transformedValue:J.value,annotations:[J.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(l1(X,$))return{transformedValue:null};let Q=DG($,U),G=Q?.value??$,N=_6(G)?[]:{},B={};I1(G,(J,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);let O=QG(J,I,U,b,[...w,A],[...X,$],D);if(N[A]=O.transformedValue,_6(O.annotations))B[ob(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{B[ob(A)+"."+q]=V})});let H=nb(B)?{transformedValue:N,annotations:Q?[Q.type]:void 0}:{transformedValue:N,annotations:Q?[Q.type,B]:B};if(!W)D.set($,H);return H};function ab($){return Object.prototype.toString.call($).slice(8,-1)}function eb($){return ab($)==="Array"}function GG($){if(ab($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Oh($,I,U,b,w){let X={}.propertyIsEnumerable.call(b,I)?"enumerable":"nonenumerable";if(X==="enumerable")$[I]=U;if(w&&X==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function sb($,I={}){if(eb($))return $.map((w)=>sb(w,I));if(!GG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(eb(I.props)&&!I.props.includes(X))return w;let D=$[X],W=sb(D,I);return Oh(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new sQ,this.symbolRegistry=new hU((I)=>I.description??""),this.customTransformerRegistry=new IG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=QG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=yV(I,this.dedupe);if(w)b.meta={...b.meta,referentialEqualities:w};if(b.meta)b.meta.v=1;return b}deserialize($,I){let{json:U,meta:b}=$,w=I?.inPlace?U:sb(U);if(b?.values)w=hV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=fV(w,b.referentialEqualities,b.v??0);return w}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}U$.defaultInstance=new U$;U$.serialize=U$.defaultInstance.serialize.bind(U$.defaultInstance);U$.deserialize=U$.defaultInstance.deserialize.bind(U$.defaultInstance);U$.stringify=U$.defaultInstance.stringify.bind(U$.defaultInstance);U$.parse=U$.defaultInstance.parse.bind(U$.defaultInstance);U$.registerClass=U$.defaultInstance.registerClass.bind(U$.defaultInstance);U$.registerSymbol=U$.defaultInstance.registerSymbol.bind(U$.defaultInstance);U$.registerCustom=U$.defaultInstance.registerCustom.bind(U$.defaultInstance);U$.allowErrorProps=U$.defaultInstance.allowErrorProps.bind(U$.defaultInstance);var uV=U$;var{serialize:Sa,deserialize:Pa,stringify:ka,parse:Ra,registerClass:Ta,registerCustom:_a,registerSymbol:Za,allowErrorProps:Ca}=U$;class NG{trpc;constructor($){this.trpc=zV({links:[pQ({url:`${$.apiUrl}/trpc`,transformer:uV,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromReactionArtifact($){return this.trpc.mcpTools.createMatrixFromReactionArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function YG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var w4=YG();async function lV($){let I=YG();I.info("Initializing server context...");let U=new NG({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let b;try{b=(await U.whoami()).userId,I.info(`Resolved user: ${b.slice(0,8)}...`)}catch(X){I.error("Failed to resolve user identity from API key:",X),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let w={userId:b,client:U,log:I};try{I.info("Loading workspace context..."),w.workspaceContext=await U.getWorkspaceContext();let X=w.workspaceContext.orgs.length,D=w.workspaceContext.orgs.reduce((W,Q)=>W+Q.workspaces.length,0);I.info(`Workspace context loaded: ${X} org(s), ${D} workspace(s)`)}catch(X){I.warn("Failed to load workspace context at startup (will retry on first tool call):",X)}return w}var Y={};v6(Y,{xor:()=>JF,xid:()=>xq,void:()=>WF,uuidv7:()=>Pq,uuidv6:()=>Sq,uuidv4:()=>Eq,uuid:()=>jq,util:()=>E,url:()=>kq,uppercase:()=>II,unknown:()=>N1,union:()=>jD,undefined:()=>XF,ulid:()=>gq,uint64:()=>wF,uint32:()=>$F,tuple:()=>PB,trim:()=>WI,treeifyError:()=>FG,transform:()=>SD,toUpperCase:()=>GI,toLowerCase:()=>QI,toJSONSchema:()=>eX,templateLiteral:()=>EF,symbol:()=>bF,superRefine:()=>sB,success:()=>FF,stringbool:()=>CF,stringFormat:()=>oq,string:()=>bD,strictObject:()=>YF,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,setErrorMap:()=>sy,set:()=>LF,safeParseAsync:()=>UB,safeParse:()=>IB,safeEncodeAsync:()=>GB,safeEncode:()=>WB,safeDecodeAsync:()=>NB,safeDecode:()=>QB,registry:()=>MX,regexes:()=>K6,regex:()=>s1,refine:()=>eB,record:()=>kB,readonly:()=>iB,property:()=>pX,promise:()=>SF,prettifyError:()=>MG,preprocess:()=>xF,prefault:()=>yB,positive:()=>nX,pipe:()=>Y0,partialRecord:()=>AF,parseAsync:()=>$B,parse:()=>s5,overwrite:()=>Z6,optional:()=>G0,object:()=>NF,number:()=>BB,nullish:()=>qF,nullable:()=>N0,null:()=>zB,normalize:()=>DI,nonpositive:()=>oX,nonoptional:()=>uB,nonnegative:()=>dX,never:()=>MD,negative:()=>iX,nativeEnum:()=>KF,nanoid:()=>_q,nan:()=>MF,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,meta:()=>_F,maxSize:()=>W1,maxLength:()=>Q1,map:()=>zF,mac:()=>yq,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,looseRecord:()=>OF,looseObject:()=>BF,locales:()=>b0,literal:()=>vF,length:()=>G1,lazy:()=>pB,ksuid:()=>hq,keyof:()=>GF,jwt:()=>iq,json:()=>gF,iso:()=>JI,ipv6:()=>uq,ipv4:()=>fq,intersection:()=>EB,int64:()=>UF,int32:()=>sq,int:()=>XD,instanceof:()=>ZF,includes:()=>UI,httpUrl:()=>Rq,hostname:()=>dq,hex:()=>pq,hash:()=>tq,guid:()=>Mq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>$u,function:()=>PF,fromJSONSchema:()=>fF,formatError:()=>oU,float64:()=>eq,float32:()=>aq,flattenError:()=>iU,file:()=>VF,enum:()=>ED,endsWith:()=>bI,encodeAsync:()=>XB,encode:()=>wB,emoji:()=>Tq,email:()=>Fq,e164:()=>nq,discriminatedUnion:()=>HF,describe:()=>TF,decodeAsync:()=>DB,decode:()=>bB,date:()=>QF,custom:()=>RF,cuid2:()=>Cq,cuid:()=>Zq,core:()=>X4,config:()=>P$,coerce:()=>IJ,codec:()=>jF,clone:()=>o$,cidrv6:()=>cq,cidrv4:()=>lq,check:()=>kF,catch:()=>mB,boolean:()=>JB,bigint:()=>IF,base64url:()=>rq,base64:()=>mq,array:()=>H0,any:()=>DF,_function:()=>PF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodRealError:()=>b6,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIssueCode:()=>ey,ZodIntersection:()=>jB,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFirstPartyTypeKind:()=>$J,ZodFile:()=>ZB,ZodError:()=>ty,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB,TimePrecision:()=>S7,NEVER:()=>BG,$output:()=>V7,$input:()=>q7,$brand:()=>JG});var X4={};v6(X4,{version:()=>vN,util:()=>E,treeifyError:()=>FG,toJSONSchema:()=>eX,toDotPath:()=>oV,safeParseAsync:()=>EG,safeParse:()=>jG,safeEncodeAsync:()=>ph,safeEncode:()=>oh,safeDecodeAsync:()=>th,safeDecode:()=>dh,registry:()=>MX,regexes:()=>K6,process:()=>G$,prettifyError:()=>MG,parseAsync:()=>wX,parse:()=>UX,meta:()=>W5,locales:()=>b0,isValidJWT:()=>Bq,isValidBase64URL:()=>Yq,isValidBase64:()=>cN,initializeContext:()=>g4,globalRegistry:()=>d$,globalConfig:()=>fU,formatError:()=>oU,flattenError:()=>iU,finalize:()=>h4,extractDefs:()=>x4,encodeAsync:()=>nh,encode:()=>mh,describe:()=>D5,decodeAsync:()=>ih,decode:()=>rh,createToJSONSchemaMethod:()=>G5,createStandardJSONSchemaMethod:()=>BI,config:()=>P$,clone:()=>o$,_xor:()=>Ey,_xid:()=>gX,_void:()=>a7,_uuidv7:()=>kX,_uuidv6:()=>PX,_uuidv4:()=>SX,_uuid:()=>EX,_url:()=>D0,_uppercase:()=>II,_unknown:()=>p7,_union:()=>jy,_undefined:()=>i7,_ulid:()=>CX,_uint64:()=>r7,_uint32:()=>f7,_tuple:()=>ky,_trim:()=>WI,_transform:()=>xy,_toUpperCase:()=>GI,_toLowerCase:()=>QI,_templateLiteral:()=>ny,_symbol:()=>n7,_superRefine:()=>X5,_success:()=>ly,_stringbool:()=>Q5,_stringFormat:()=>YI,_string:()=>M7,_startsWith:()=>wI,_slugify:()=>NI,_size:()=>e1,_set:()=>_y,_safeParseAsync:()=>t1,_safeParse:()=>p1,_safeEncodeAsync:()=>NX,_safeEncode:()=>QX,_safeDecodeAsync:()=>YX,_safeDecode:()=>GX,_regex:()=>s1,_refine:()=>b5,_record:()=>Ry,_readonly:()=>ry,_property:()=>pX,_promise:()=>oy,_positive:()=>nX,_pipe:()=>my,_parseAsync:()=>d1,_parse:()=>o1,_overwrite:()=>Z6,_optional:()=>hy,_number:()=>_7,_nullable:()=>fy,_null:()=>o7,_normalize:()=>DI,_nonpositive:()=>oX,_nonoptional:()=>uy,_nonnegative:()=>dX,_never:()=>t7,_negative:()=>iX,_nativeEnum:()=>Cy,_nanoid:()=>TX,_nan:()=>$5,_multipleOf:()=>Z4,_minSize:()=>C4,_minLength:()=>b4,_min:()=>p$,_mime:()=>XI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>N6,_map:()=>Ty,_mac:()=>E7,_lte:()=>N6,_lt:()=>r6,_lowercase:()=>$I,_literal:()=>gy,_length:()=>G1,_lazy:()=>iy,_ksuid:()=>xX,_jwt:()=>rX,_isoTime:()=>R7,_isoDuration:()=>T7,_isoDateTime:()=>P7,_isoDate:()=>k7,_ipv6:()=>fX,_ipv4:()=>hX,_intersection:()=>Py,_int64:()=>m7,_int32:()=>h7,_int:()=>C7,_includes:()=>UI,_guid:()=>X0,_gte:()=>p$,_gt:()=>n6,_float64:()=>x7,_float32:()=>g7,_file:()=>U5,_enum:()=>Zy,_endsWith:()=>bI,_encodeAsync:()=>DX,_encode:()=>bX,_emoji:()=>RX,_email:()=>jX,_e164:()=>mX,_discriminatedUnion:()=>Sy,_default:()=>yy,_decodeAsync:()=>WX,_decode:()=>XX,_date:()=>e7,_custom:()=>w5,_cuid2:()=>ZX,_cuid:()=>_X,_coercedString:()=>j7,_coercedNumber:()=>Z7,_coercedDate:()=>s7,_coercedBoolean:()=>u7,_coercedBigint:()=>c7,_cidrv6:()=>uX,_cidrv4:()=>yX,_check:()=>vq,_catch:()=>cy,_boolean:()=>y7,_bigint:()=>l7,_base64url:()=>cX,_base64:()=>lX,_array:()=>I5,_any:()=>d7,TimePrecision:()=>S7,NEVER:()=>BG,JSONSchemaGenerator:()=>d5,JSONSchema:()=>Vq,Doc:()=>AX,$output:()=>V7,$input:()=>q7,$constructor:()=>z,$brand:()=>JG,$ZodXor:()=>DY,$ZodXID:()=>TN,$ZodVoid:()=>UY,$ZodUnknown:()=>$Y,$ZodUnion:()=>aU,$ZodUndefined:()=>aN,$ZodUUID:()=>FN,$ZodURL:()=>jN,$ZodULID:()=>RN,$ZodType:()=>o,$ZodTuple:()=>FX,$ZodTransform:()=>AY,$ZodTemplateLiteral:()=>EY,$ZodSymbol:()=>tN,$ZodSuccess:()=>VY,$ZodStringFormat:()=>B$,$ZodString:()=>D1,$ZodSet:()=>YY,$ZodRegistry:()=>F7,$ZodRecord:()=>GY,$ZodRealError:()=>w6,$ZodReadonly:()=>jY,$ZodPromise:()=>PY,$ZodPrefault:()=>KY,$ZodPipe:()=>MY,$ZodOptional:()=>OY,$ZodObjectJIT:()=>XY,$ZodObject:()=>Aq,$ZodNumberFormat:()=>dN,$ZodNumber:()=>VX,$ZodNullable:()=>zY,$ZodNull:()=>eN,$ZodNonOptional:()=>vY,$ZodNever:()=>IY,$ZodNanoID:()=>SN,$ZodNaN:()=>FY,$ZodMap:()=>NY,$ZodMAC:()=>yN,$ZodLiteral:()=>JY,$ZodLazy:()=>kY,$ZodKSUID:()=>_N,$ZodJWT:()=>iN,$ZodIntersection:()=>QY,$ZodISOTime:()=>gN,$ZodISODuration:()=>xN,$ZodISODateTime:()=>ZN,$ZodISODate:()=>CN,$ZodIPv6:()=>fN,$ZodIPv4:()=>hN,$ZodGUID:()=>qN,$ZodFunction:()=>SY,$ZodFile:()=>HY,$ZodError:()=>nU,$ZodEnum:()=>BY,$ZodEncodeError:()=>w1,$ZodEmoji:()=>EN,$ZodEmail:()=>MN,$ZodE164:()=>nN,$ZodDiscriminatedUnion:()=>WY,$ZodDefault:()=>LY,$ZodDate:()=>wY,$ZodCustomStringFormat:()=>oN,$ZodCustom:()=>RY,$ZodCodec:()=>eU,$ZodCheckUpperCase:()=>JN,$ZodCheckStringFormat:()=>a1,$ZodCheckStartsWith:()=>AN,$ZodCheckSizeEquals:()=>WN,$ZodCheckRegex:()=>YN,$ZodCheckProperty:()=>zN,$ZodCheckOverwrite:()=>KN,$ZodCheckNumberFormat:()=>wN,$ZodCheckMultipleOf:()=>UN,$ZodCheckMinSize:()=>DN,$ZodCheckMinLength:()=>GN,$ZodCheckMimeType:()=>LN,$ZodCheckMaxSize:()=>XN,$ZodCheckMaxLength:()=>QN,$ZodCheckLowerCase:()=>BN,$ZodCheckLessThan:()=>JX,$ZodCheckLengthEquals:()=>NN,$ZodCheckIncludes:()=>HN,$ZodCheckGreaterThan:()=>HX,$ZodCheckEndsWith:()=>ON,$ZodCheckBigIntFormat:()=>bN,$ZodCheck:()=>A$,$ZodCatch:()=>qY,$ZodCUID2:()=>kN,$ZodCUID:()=>PN,$ZodCIDRv6:()=>lN,$ZodCIDRv4:()=>uN,$ZodBoolean:()=>tU,$ZodBigIntFormat:()=>pN,$ZodBigInt:()=>qX,$ZodBase64URL:()=>rN,$ZodBase64:()=>mN,$ZodAsyncError:()=>m6,$ZodArray:()=>bY,$ZodAny:()=>sN});var BG=Object.freeze({status:"aborted"});function z($,I,U){function b(W,Q){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:Q,constr:D,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),I(W,Q);let G=D.prototype,N=Object.keys(G);for(let B=0;B<N.length;B++){let H=N[B];if(!(H in W))W[H]=G[H].bind(W)}}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let N of G._zod.deferred)N();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var JG=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w1 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var fU={};function P$($){if($)Object.assign(fU,$);return fU}var E={};v6(E,{unwrapMessage:()=>yU,uint8ArrayToHex:()=>lh,uint8ArrayToBase64url:()=>yh,uint8ArrayToBase64:()=>rV,stringifyPrimitive:()=>j,slugify:()=>OG,shallowClone:()=>LG,safeExtend:()=>Zh,required:()=>xh,randomString:()=>Eh,propertyKeyTypes:()=>cU,promiseAllObject:()=>jh,primitiveTypes:()=>KG,prefixIssues:()=>G6,pick:()=>Rh,partial:()=>gh,optionalKeys:()=>vG,omit:()=>Th,objectClone:()=>qh,numKeys:()=>Sh,nullish:()=>P4,normalizeParams:()=>S,mergeDefs:()=>R4,merge:()=>Ch,jsonStringifyReplacer:()=>r1,joinValues:()=>L,issue:()=>i1,isPlainObject:()=>T4,isObject:()=>b1,hexToUint8Array:()=>uh,getSizableOrigin:()=>mU,getParsedType:()=>Ph,getLengthableOrigin:()=>rU,getEnumValues:()=>uU,getElementAtPath:()=>Mh,floatSafeRemainder:()=>AG,finalizeIssue:()=>U6,extend:()=>_h,escapeRegex:()=>L6,esc:()=>$X,defineLazy:()=>s,createTransparentProxy:()=>kh,cloneDef:()=>Fh,clone:()=>o$,cleanRegex:()=>lU,cleanEnum:()=>hh,captureStackTrace:()=>IX,cached:()=>n1,base64urlToUint8Array:()=>fh,base64ToUint8Array:()=>mV,assignProp:()=>k4,assertNotEqual:()=>Lh,assertNever:()=>vh,assertIs:()=>Kh,assertEqual:()=>zh,assert:()=>Vh,allowsEval:()=>zG,aborted:()=>_4,NUMBER_FORMAT_RANGES:()=>VG,Class:()=>nV,BIGINT_FORMAT_RANGES:()=>qG});function zh($){return $}function Lh($){return $}function Kh($){}function vh($){throw new Error("Unexpected value in exhaustive check")}function Vh($){}function uU($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function L($,I="|"){return $.map((U)=>j(U)).join(I)}function r1($,I){if(typeof I==="bigint")return I.toString();return I}function n1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function P4($){return $===null||$===void 0}function lU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function AG($,I){let U=($.toString().split(".")[1]||"").length,b=I.toString(),w=(b.split(".")[1]||"").length;if(w===0&&/\d?e-\d?/.test(b)){let Q=b.match(/\d?e-(\d?)/);if(Q?.[1])w=Number.parseInt(Q[1])}let X=U>w?U:w,D=Number.parseInt($.toFixed(X).replace(".","")),W=Number.parseInt(I.toFixed(X).replace(".",""));return D%W/10**X}var cV=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===cV)return;if(b===void 0)b=cV,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function qh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function k4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function R4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function Fh($){return R4($._zod.def)}function Mh($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function jh($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function Eh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function $X($){return JSON.stringify($)}function OG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var IX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var zG=n1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function T4($){if(b1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(b1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function LG($){if(T4($))return{...$};if(Array.isArray($))return[...$];return $}function Sh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var Ph=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},cU=new Set(["string","number","symbol"]),KG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function L6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function S($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function kh($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function vG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var VG={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rh($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;w[X]=U.shape[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function Th($,I){let U=$._zod.def,b=R4($._zod.def,{get shape(){let w={...$._zod.def.shape};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;delete w[X]}return k4(this,"shape",w),w},checks:[]});return o$($,b)}function _h($,I){if(!T4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let w=R4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return k4(this,"shape",X),X},checks:[]});return o$($,w)}function Zh($,I){if(!T4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return k4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function Ch($,I){let U=R4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return k4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function gh($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in w))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=$?new $({type:"optional",innerType:w[D]}):w[D]}else for(let D in w)X[D]=$?new $({type:"optional",innerType:w[D]}):w[D];return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function xh($,I,U){let b=R4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in X))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=new $({type:"nonoptional",innerType:w[D]})}else for(let D in w)X[D]=new $({type:"nonoptional",innerType:w[D]});return k4(this,"shape",X),X},checks:[]});return o$(I,b)}function _4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function G6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function yU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=yU($.inst?._zod.def?.error?.($))??yU(I?.error?.($))??yU(U.customError?.($))??yU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function mU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function rU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function i1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function hh($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function mV($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function rV($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function fh($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return mV(I+U)}function yh($){return rV($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function uh($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let b=0;b<I.length;b+=2)U[b/2]=Number.parseInt(I.slice(b,b+2),16);return U}function lh($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class nV{constructor(...$){}}var iV=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,r1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},nU=z("$ZodError",iV),w6=z("$ZodError",iV,{Parent:Error});function iU($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function oU($,I=(U)=>U.message){let U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((D)=>b({issues:D}));else if(X.code==="invalid_key")b({issues:X.issues});else if(X.code==="invalid_element")b({issues:X.issues});else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b($),U}function FG($,I=(U)=>U.message){let U={errors:[]},b=(w,X=[])=>{var D,W;for(let Q of w.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((G)=>b({issues:G},Q.path));else if(Q.code==="invalid_key")b({issues:Q.issues},Q.path);else if(Q.code==="invalid_element")b({issues:Q.issues},Q.path);else{let G=[...X,...Q.path];if(G.length===0){U.errors.push(I(Q));continue}let N=U,B=0;while(B<G.length){let H=G[B],J=B===G.length-1;if(typeof H==="string")N.properties??(N.properties={}),(D=N.properties)[H]??(D[H]={errors:[]}),N=N.properties[H];else N.items??(N.items=[]),(W=N.items)[H]??(W[H]={errors:[]}),N=N.items[H];if(J)N.errors.push(I(Q));B++}}};return b($),U}function oV($){let I=[],U=$.map((b)=>typeof b==="object"?b.key:b);for(let b of U)if(typeof b==="number")I.push(`[${b}]`);else if(typeof b==="symbol")I.push(`[${JSON.stringify(String(b))}]`);else if(/[^\w$]/.test(b))I.push(`[${JSON.stringify(b)}]`);else{if(I.length)I.push(".");I.push(b)}return I.join("")}function MG($){let I=[],U=[...$.issues].sort((b,w)=>(b.path??[]).length-(w.path??[]).length);for(let b of U)if(I.push(`✖ ${b.message}`),b.path?.length)I.push(` → at ${oV(b.path)}`);return I.join(`
43
- `)}var o1=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new m6;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},UX=o1(w6),d1=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw IX(W,w?.callee),W}return D.value},wX=d1(w6),p1=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new m6;return X.issues.length?{success:!1,error:new($??nU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},jG=p1(w6),t1=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},EG=t1(w6),bX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return o1($)(I,U,w)},mh=bX(w6),XX=($)=>(I,U,b)=>{return o1($)(I,U,b)},rh=XX(w6),DX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return d1($)(I,U,w)},nh=DX(w6),WX=($)=>async(I,U,b)=>{return d1($)(I,U,b)},ih=WX(w6),QX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},oh=QX(w6),GX=($)=>(I,U,b)=>{return p1($)(I,U,b)},dh=GX(w6),NX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},ph=NX(w6),YX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},th=YX(w6);var K6={};v6(K6,{xid:()=>RG,uuid7:()=>$f,uuid6:()=>sh,uuid4:()=>eh,uuid:()=>X1,uppercase:()=>IN,unicodeEmail:()=>dV,undefined:()=>sG,ulid:()=>kG,time:()=>nG,string:()=>oG,sha512_hex:()=>Vf,sha512_base64url:()=>Ff,sha512_base64:()=>qf,sha384_hex:()=>Lf,sha384_base64url:()=>vf,sha384_base64:()=>Kf,sha256_hex:()=>Af,sha256_base64url:()=>zf,sha256_base64:()=>Of,sha1_hex:()=>Bf,sha1_base64url:()=>Hf,sha1_base64:()=>Jf,rfc5322Email:()=>Uf,number:()=>tG,null:()=>eG,nanoid:()=>_G,md5_hex:()=>Gf,md5_base64url:()=>Yf,md5_base64:()=>Nf,mac:()=>yG,lowercase:()=>$N,ksuid:()=>TG,ipv6:()=>fG,ipv4:()=>hG,integer:()=>pG,idnEmail:()=>wf,html5Email:()=>If,hostname:()=>Df,hex:()=>Qf,guid:()=>CG,extendedDuration:()=>ah,emoji:()=>xG,email:()=>gG,e164:()=>mG,duration:()=>ZG,domain:()=>Wf,datetime:()=>iG,date:()=>rG,cuid2:()=>PG,cuid:()=>SG,cidrv6:()=>lG,cidrv4:()=>uG,browserEmail:()=>bf,boolean:()=>aG,bigint:()=>dG,base64url:()=>BX,base64:()=>cG});var SG=/^[cC][^\s-]{8,}$/,PG=/^[0-9a-z]+$/,kG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RG=/^[0-9a-vA-V]{20}$/,TG=/^[A-Za-z0-9]{27}$/,_G=/^[a-zA-Z0-9_-]{21}$/,ZG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ah=/^[-+]?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)?)??$/,CG=/^([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})$/,X1=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},eh=X1(4),sh=X1(6),$f=X1(7),gG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,If=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Uf=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,dV=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,wf=dV,bf=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Xf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xG(){return new RegExp(Xf,"u")}var hG=/^(?:(?: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])$/,fG=/^(([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}|:))$/,yG=($)=>{let I=L6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},uG=/^((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])$/,lG=/^(([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])$/,cG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BX=/^[A-Za-z0-9_-]*$/,Df=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Wf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mG=/^\+(?:[0-9]){6,14}[0-9]$/,pV="(?:(?:\\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])))",rG=new RegExp(`^${pV}$`);function tV($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function nG($){return new RegExp(`^${tV($)}$`)}function iG($){let I=tV({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${pV}T(?:${b})$`)}var oG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},dG=/^-?\d+n?$/,pG=/^-?\d+$/,tG=/^-?\d+(?:\.\d+)?/,aG=/^(?:true|false)$/i,eG=/^null$/i;var sG=/^undefined$/i;var $N=/^[^A-Z]*$/,IN=/^[^a-z]*$/,Qf=/^[0-9a-fA-F]*$/;function dU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function pU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Gf=/^[0-9a-fA-F]{32}$/,Nf=dU(22,"=="),Yf=pU(22),Bf=/^[0-9a-fA-F]{40}$/,Jf=dU(27,"="),Hf=pU(27),Af=/^[0-9a-fA-F]{64}$/,Of=dU(43,"="),zf=pU(43),Lf=/^[0-9a-fA-F]{96}$/,Kf=dU(64,""),vf=pU(64),Vf=/^[0-9a-fA-F]{128}$/,qf=dU(86,"=="),Ff=pU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),eV={number:"number",bigint:"bigint",object:"date"},JX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=eV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),HX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=eV[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),UN=z("$ZodCheckMultipleOf",($,I)=>{A$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):AG(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=VG[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=pG}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}}),bN=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=qG[I.format];$._zod.onattach.push((w)=>{let X=w._zod.bag;X.format=I.format,X.minimum=U,X.maximum=b}),$._zod.check=(w)=>{let X=w.value;if(X<U)w.issues.push({origin:"bigint",input:X,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(X>b)w.issues.push({origin:"bigint",input:X,code:"too_big",maximum:b,inst:$})}}),XN=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.size<=I.maximum)return;b.issues.push({origin:mU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),DN=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.size>=I.minimum)return;b.issues.push({origin:mU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),WN=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.size,w.maximum=I.size,w.size=I.size}),$._zod.check=(b)=>{let w=b.value,X=w.size;if(X===I.size)return;let D=X>I.size;b.issues.push({origin:mU(w),...D?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),QN=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=rU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),GN=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=rU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),NN=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!P4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=rU(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),a1=z("$ZodCheckStringFormat",($,I)=>{var U,b;if(A$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),YN=z("$ZodCheckRegex",($,I)=>{a1.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),BN=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=$N),a1.init($,I)}),JN=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=IN),a1.init($,I)}),HN=z("$ZodCheckIncludes",($,I)=>{A$.init($,I);let U=L6(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),AN=z("$ZodCheckStartsWith",($,I)=>{A$.init($,I);let U=new RegExp(`^${L6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),ON=z("$ZodCheckEndsWith",($,I)=>{A$.init($,I);let U=new RegExp(`.*${L6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});function aV($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var zN=z("$ZodCheckProperty",($,I)=>{A$.init($,I),$._zod.check=(U)=>{let b=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(b instanceof Promise)return b.then((w)=>aV(w,U,I.property));aV(b,U,I.property);return}}),LN=z("$ZodCheckMimeType",($,I)=>{A$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((b)=>{b._zod.bag.mime=I.mime}),$._zod.check=(b)=>{if(U.has(b.value.type))return;b.issues.push({code:"invalid_value",values:I.mime,input:b.value.type,inst:$,continue:!I.abort})}}),KN=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class AX{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
40
+ ]`;continue}if(w+=b[Q],b[Q]==="\\")X=!0;else if(D&&b[Q]==="]")D=!1;else if(!D&&b[Q]==="[")D=!0}try{new RegExp(w)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return w}function bb($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===F.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((b,w)=>({...b,[w]:n($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",w]})??M$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:n($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===F.ZodString&&$.keyType._def.checks?.length){let{type:b,...w}=wb($.keyType._def,I);return{...U,propertyNames:w}}else if($.keyType?._def.typeName===F.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===F.ZodBranded&&$.keyType._def.type._def.typeName===F.ZodString&&$.keyType._def.type._def.checks?.length){let{type:b,...w}=Ub($.keyType._def,I);return{...U,propertyNames:w}}return U}function Xz($,I){if(I.mapStrategy==="record")return bb($,I);let U=n($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||M$(I),b=n($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||M$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,b],minItems:2,maxItems:2}}}function Dz($){let I=$.values,b=Object.keys($.values).filter((X)=>{return typeof I[I[X]]!=="number"}).map((X)=>I[X]),w=Array.from(new Set(b.map((X)=>typeof X)));return{type:w.length===1?w[0]==="string"?"string":"number":["string","number"],enum:b}}function Wz($){return $.target==="openAi"?void 0:{not:M$({...$,currentPath:[...$.currentPath,"not"]})}}function Qz($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var YU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Yz($,I){if(I.target==="openApi3")return Gz($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((b)=>(b._def.typeName in YU)&&(!b._def.checks||!b._def.checks.length))){let b=U.reduce((w,X)=>{let D=YU[X._def.typeName];return D&&!w.includes(D)?[...w,D]:w},[]);return{type:b.length>1?b:b[0]}}else if(U.every((b)=>b._def.typeName==="ZodLiteral"&&!b.description)){let b=U.reduce((w,X)=>{let D=typeof X._def.value;switch(D){case"string":case"number":case"boolean":return[...w,D];case"bigint":return[...w,"integer"];case"object":if(X._def.value===null)return[...w,"null"];case"symbol":case"undefined":case"function":default:return w}},[]);if(b.length===U.length){let w=b.filter((X,D,W)=>W.indexOf(X)===D);return{type:w.length>1?w:w[0],enum:U.reduce((X,D)=>{return X.includes(D._def.value)?X:[...X,D._def.value]},[])}}}else if(U.every((b)=>b._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((b,w)=>[...b,...w._def.values.filter((X)=>!b.includes(X))],[])};return Gz($,I)}var Gz=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((b,w)=>n(b._def,{...I,currentPath:[...I.currentPath,"anyOf",`${w}`]})).filter((b)=>!!b&&(!I.strictUnions||typeof b==="object"&&Object.keys(b).length>0));return U.length?{anyOf:U}:void 0};function Nz($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:YU[$.innerType._def.typeName],nullable:!0};return{type:[YU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let b=n($.innerType._def,{...I,currentPath:[...I.currentPath]});if(b&&"$ref"in b)return{allOf:[b],nullable:!0};return b&&{...b,nullable:!0}}let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function Jz($,I){let U={type:"number"};if(!$.checks)return U;for(let b of $.checks)switch(b.kind){case"int":U.type="integer",R8(U,"type",b.message,I);break;case"min":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"minimum",b.value,b.message,I);else b$(U,"exclusiveMinimum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMinimum=!0;b$(U,"minimum",b.value,b.message,I)}break;case"max":if(I.target==="jsonSchema7")if(b.inclusive)b$(U,"maximum",b.value,b.message,I);else b$(U,"exclusiveMaximum",b.value,b.message,I);else{if(!b.inclusive)U.exclusiveMaximum=!0;b$(U,"maximum",b.value,b.message,I)}break;case"multipleOf":b$(U,"multipleOf",b.value,b.message,I);break}return U}function Bz($,I){let U=I.target==="openAi",b={type:"object",properties:{}},w=[],X=$.shape();for(let W in X){let Q=X[W];if(Q===void 0||Q._def===void 0)continue;let G=Bk(Q);if(G&&U){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();G=!1}let Y=n(Q._def,{...I,currentPath:[...I.currentPath,"properties",W],propertyPath:[...I.currentPath,"properties",W]});if(Y===void 0)continue;if(b.properties[W]=Y,!G)w.push(W)}if(w.length)b.required=w;let D=Jk($,I);if(D!==void 0)b.additionalProperties=D;return b}function Jk($,I){if($.catchall._def.typeName!=="ZodNever")return n($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function Bk($){try{return $.isOptional()}catch{return!0}}var Hz=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return n($.innerType._def,I);let U=n($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:M$(I)},U]}:M$(I)};var Az=($,I)=>{if(I.pipeStrategy==="input")return n($.in._def,I);else if(I.pipeStrategy==="output")return n($.out._def,I);let U=n($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),b=n($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,b].filter((w)=>w!==void 0)}};function Oz($,I){return n($.type._def,I)}function zz($,I){let b={type:"array",uniqueItems:!0,items:n($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)b$(b,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)b$(b,"maxItems",$.maxSize.value,$.maxSize.message,I);return b}function Lz($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[]),additionalItems:n($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,b)=>n(U._def,{...I,currentPath:[...I.currentPath,"items",`${b}`]})).reduce((U,b)=>b===void 0?U:[...U,b],[])}}function Kz($){return{not:M$($)}}function vz($){return M$($)}var Vz=($,I)=>{return n($.innerType._def,I)};var qz=($,I,U)=>{switch(I){case F.ZodString:return wb($,U);case F.ZodNumber:return Jz($,U);case F.ZodObject:return Bz($,U);case F.ZodBigInt:return tO($,U);case F.ZodBoolean:return aO();case F.ZodDate:return T8($,U);case F.ZodUndefined:return Kz(U);case F.ZodNull:return Qz(U);case F.ZodArray:return pO($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return Yz($,U);case F.ZodIntersection:return Uz($,U);case F.ZodTuple:return Lz($,U);case F.ZodRecord:return bb($,U);case F.ZodLiteral:return wz($,U);case F.ZodEnum:return Iz($);case F.ZodNativeEnum:return Dz($);case F.ZodNullable:return Nz($,U);case F.ZodOptional:return Hz($,U);case F.ZodMap:return Xz($,U);case F.ZodSet:return zz($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return Oz($,U);case F.ZodNaN:case F.ZodNever:return Wz(U);case F.ZodEffects:return $z($,U);case F.ZodAny:return M$(U);case F.ZodUnknown:return vz(U);case F.ZodDefault:return sO($,U);case F.ZodBranded:return Ub($,U);case F.ZodReadonly:return Vz($,U);case F.ZodCatch:return eO($,U);case F.ZodPipeline:return Az($,U);case F.ZodFunction:case F.ZodVoid:case F.ZodSymbol:return;default:return((b)=>{return})(I)}};function n($,I,U=!1){let b=I.seen.get($);if(I.override){let W=I.override?.($,I,b,U);if(W!==iO)return W}if(b&&!U){let W=Hk(b,I);if(W!==void 0)return W}let w={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,w);let X=qz($,$.typeName,I),D=typeof X==="function"?n(X(),I):X;if(D)Ak($,I,D);if(I.postProcess){let W=I.postProcess(D,$,I);return w.jsonSchema=D,W}return w.jsonSchema=D,D}var Hk=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:Ib(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,b)=>I.currentPath[b]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),M$(I);return I.$refStrategy==="seen"?M$(I):void 0}}},Ak=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var C8=($,I)=>{let U=dO(I),b=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((Q,[G,Y])=>({...Q,[G]:n(Y._def,{...U,currentPath:[...U.basePath,U.definitionPath,G]},!0)??M$(U)}),{}):void 0,w=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,X=n($._def,w===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,w]},!1)??M$(U),D=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(D!==void 0)X.title=D;if(U.flags.hasReferencedOpenAiAnyType){if(!b)b={};if(!b[U.openAiAnyTypeName])b[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let W=w===void 0?b?{...X,[U.definitionPath]:b}:X:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,w].join("/"),[U.definitionPath]:{...b,[w]:X}};if(U.target==="jsonSchema7")W.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")W.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in W)||("oneOf"in W)||("allOf"in W)||("type"in W)&&Array.isArray(W.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return W};function Ok($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function g8($,I){if(B6($))return U8($,{target:Ok(I?.target),io:I?.pipeStrategy??"input"});return C8($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function x8($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b!=="string")throw new Error("Schema method literal must be a string");return b}function h8($,I){let U=B4($,I);if(!U.success)throw U.error;return U.data}var zk=60000;class f8{constructor($){if(this._options=$,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(hw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(yw,(I)=>{this._onprogress(I)}),this.setRequestHandler(fw,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(uw,async(I,U)=>{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return{...b}}),this.setRequestHandler(cw,async(I,U)=>{let b=async()=>{let w=I.params.taskId;if(this._taskMessageQueue){let D;while(D=await this._taskMessageQueue.dequeue(w,U.sessionId)){if(D.type==="response"||D.type==="error"){let W=D.message,Q=W.id,G=this._requestResolvers.get(Q);if(G)if(this._requestResolvers.delete(Q),D.type==="response")G(W);else{let Y=W,J=new f(Y.error.code,Y.error.message,Y.error.data);G(J)}else{let Y=D.type==="response"?"Response":"Error";this._onerror(new Error(`${Y} handler missing for request ${Q}`))}continue}await this._transport?.send(D.message,{relatedRequestId:U.requestId})}}let X=await this._taskStore.getTask(w,U.sessionId);if(!X)throw new f(c.InvalidParams,`Task not found: ${w}`);if(!O4(X.status))return await this._waitForTaskUpdate(w,U.signal),await b();if(O4(X.status)){let D=await this._taskStore.getTaskResult(w,U.sessionId);return this._clearTaskQueue(w),{...D,_meta:{...D._meta,[A4]:{taskId:w}}}}return await b()};return await b()}),this.setRequestHandler(mw,async(I,U)=>{try{let{tasks:b,nextCursor:w}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:b,nextCursor:w,_meta:{}}}catch(b){throw new f(c.InvalidParams,`Failed to list tasks: ${b instanceof Error?b.message:String(b)}`)}}),this.setRequestHandler(nw,async(I,U)=>{try{let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(O4(b.status))throw new f(c.InvalidParams,`Cannot cancel task in terminal status: ${b.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let w=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!w)throw new f(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...w}}catch(b){if(b instanceof f)throw b;throw new f(c.InvalidRequest,`Failed to cancel task: ${b instanceof Error?b.message:String(b)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,b,w=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(b,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:w,onTimeout:b})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),f.fromError(c.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(w)=>{U?.(w),this._onerror(w)};let b=this._transport?.onmessage;this._transport.onmessage=(w,X)=>{if(b?.(w,X),UU(w)||ZO(w))this._onresponse(w);else if(A8(w))this._onrequest(w,X);else if(_O(w))this._onnotification(w);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(w)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let I=f.fromError(c.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,b=this._transport,w=$.params?._meta?.[A4]?.taskId;if(U===void 0){let G={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(w&&this._taskMessageQueue)this._enqueueTaskMessage(w,{type:"error",message:G,timestamp:Date.now()},b?.sessionId).catch((Y)=>this._onerror(new Error(`Failed to enqueue error response: ${Y}`)));else b?.send(G).catch((Y)=>this._onerror(new Error(`Failed to send an error response: ${Y}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set($.id,X);let D=kO($.params)?$.params.task:void 0,W=this._taskStore?this.requestTaskStore($,b?.sessionId):void 0,Q={signal:X.signal,sessionId:b?.sessionId,_meta:$.params?._meta,sendNotification:async(G)=>{let Y={relatedRequestId:$.id};if(w)Y.relatedTask={taskId:w};await this.notification(G,Y)},sendRequest:async(G,Y,J)=>{let H={...J,relatedRequestId:$.id};if(w&&!H.relatedTask)H.relatedTask={taskId:w};let B=H.relatedTask?.taskId??w;if(B&&W)await W.updateTaskStatus(B,"input_required");return await this.request(G,Y,H)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:w,taskStore:W,taskRequestedTtl:D?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(D)this.assertTaskHandlerCapability($.method)}).then(()=>U($,Q)).then(async(G)=>{if(X.signal.aborted)return;let Y={result:G,jsonrpc:"2.0",id:$.id};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"response",message:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)},async(G)=>{if(X.signal.aborted)return;let Y={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(G.code)?G.code:c.InternalError,message:G.message??"Internal error",...G.data!==void 0&&{data:G.data}}};if(w&&this._taskMessageQueue)await this._enqueueTaskMessage(w,{type:"error",message:Y,timestamp:Date.now()},b?.sessionId);else await b?.send(Y)}).catch((G)=>this._onerror(new Error(`Failed to send response: ${G}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,b=Number(I),w=this._progressHandlers.get(b);if(!w){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let X=this._responseHandlers.get(b),D=this._timeoutInfo.get(b);if(D&&X&&D.resetTimeoutOnProgress)try{this._resetTimeout(b)}catch(W){this._responseHandlers.delete(b),this._progressHandlers.delete(b),this._cleanupTimeout(b),X(W);return}w(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),UU($))U($);else{let X=new f($.error.code,$.error.message,$.error.data);U(X)}return}let b=this._responseHandlers.get(I);if(b===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let w=!1;if(UU($)&&$.result&&typeof $.result==="object"){let X=$.result;if(X.task&&typeof X.task==="object"){let D=X.task;if(typeof D.taskId==="string")w=!0,this._taskProgressTokens.set(D.taskId,I)}}if(!w)this._progressHandlers.delete(I);if(UU($))b($);else{let X=f.fromError($.error.code,$.error.message,$.error.data);b(X)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:b}=U??{};if(!b){try{yield{type:"result",result:await this.request($,I,U)}}catch(X){yield{type:"error",error:X instanceof f?X:new f(c.InternalError,String(X))}}return}let w;try{let X=await this.request($,j1,U);if(X.task)w=X.task.taskId,yield{type:"taskCreated",task:X.task};else throw new f(c.InternalError,"Task creation did not return a task");while(!0){let D=await this.getTask({taskId:w},U);if(yield{type:"taskStatus",task:D},O4(D.status)){if(D.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};else if(D.status==="failed")yield{type:"error",error:new f(c.InternalError,`Task ${w} failed`)};else if(D.status==="cancelled")yield{type:"error",error:new f(c.InternalError,`Task ${w} was cancelled`)};return}if(D.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:w},I,U)};return}let W=D.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((Q)=>setTimeout(Q,W)),U?.signal?.throwIfAborted()}}catch(X){yield{type:"error",error:X instanceof f?X:new f(c.InternalError,String(X))}}}request($,I,U){let{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X,task:D,relatedTask:W}=U??{};return new Promise((Q,G)=>{let Y=(q)=>{G(q)};if(!this._transport){Y(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),D)this.assertTaskCapability($.method)}catch(q){Y(q);return}U?.signal?.throwIfAborted();let J=this._requestMessageId++,H={...$,jsonrpc:"2.0",id:J};if(U?.onprogress)this._progressHandlers.set(J,U.onprogress),H.params={...$.params,_meta:{...$.params?._meta||{},progressToken:J}};if(D)H.params={...H.params,task:D};if(W)H.params={...H.params,_meta:{...H.params?._meta||{},[A4]:W}};let B=(q)=>{this._responseHandlers.delete(J),this._progressHandlers.delete(J),this._cleanupTimeout(J),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:J,reason:String(q)}},{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((P)=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));let k=q instanceof f?q:new f(c.RequestTimeout,String(q));G(k)};this._responseHandlers.set(J,(q)=>{if(U?.signal?.aborted)return;if(q instanceof Error)return G(q);try{let k=B4(I,q.result);if(!k.success)G(k.error);else Q(k.data)}catch(k){G(k)}}),U?.signal?.addEventListener("abort",()=>{B(U?.signal?.reason)});let A=U?.timeout??zk,O=()=>B(f.fromError(c.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(J,A,U?.maxTotalTimeout,O,U?.resetTimeoutOnProgress??!1);let V=W?.taskId;if(V){let q=(k)=>{let P=this._responseHandlers.get(J);if(P)P(k);else this._onerror(new Error(`Response handler missing for side-channeled request ${J}`))};this._requestResolvers.set(J,q),this._enqueueTaskMessage(V,{type:"request",message:H,timestamp:Date.now()}).catch((k)=>{this._cleanupTimeout(J),G(k)})}else this._transport.send(H,{relatedRequestId:b,resumptionToken:w,onresumptiontoken:X}).catch((q)=>{this._cleanupTimeout(J),G(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},lw,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},rw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},xO,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let D={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[A4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:D,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let D={...$,jsonrpc:"2.0"};if(I?.relatedTask)D={...D,params:{...D.params,_meta:{...D.params?._meta||{},[A4]:I.relatedTask}}};this._transport?.send(D,I).catch((W)=>this._onerror(W))});return}let X={...$,jsonrpc:"2.0"};if(I?.relatedTask)X={...X,params:{...X.params,_meta:{...X.params?._meta||{},[A4]:I.relatedTask}}};await this._transport.send(X,I)}setRequestHandler($,I){let U=x8($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(b,w)=>{let X=h8($,b);return Promise.resolve(I(X,w))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=x8($);this._notificationHandlers.set(U,(b)=>{let w=h8($,b);return Promise.resolve(I(w))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let b=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,b)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let b of U)if(b.type==="request"&&A8(b.message)){let w=b.message.id,X=this._requestResolvers.get(w);if(X)X(new f(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(w);else this._onerror(new Error(`Resolver missing for request ${w} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let b=await this._taskStore?.getTask($);if(b?.pollInterval)U=b.pollInterval}catch{}return new Promise((b,w)=>{if(I.aborted){w(new f(c.InvalidRequest,"Request cancelled"));return}let X=setTimeout(b,U);I.addEventListener("abort",()=>{clearTimeout(X),w(new f(c.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(b)=>{if(!$)throw new Error("No request provided");return await U.createTask(b,$.id,{method:$.method,params:$.params},I)},getTask:async(b)=>{let w=await U.getTask(b,I);if(!w)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return w},storeTaskResult:async(b,w,X)=>{await U.storeTaskResult(b,w,X,I);let D=await U.getTask(b,I);if(D){let W=WU.parse({method:"notifications/tasks/status",params:D});if(await this.notification(W),O4(D.status))this._cleanupTaskProgressHandler(b)}},getTaskResult:(b)=>{return U.getTaskResult(b,I)},updateTaskStatus:async(b,w,X)=>{let D=await U.getTask(b,I);if(!D)throw new f(c.InvalidParams,`Task "${b}" not found - it may have been cleaned up`);if(O4(D.status))throw new f(c.InvalidParams,`Cannot update task "${b}" from terminal status "${D.status}" to "${w}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(b,w,X,I);let W=await U.getTask(b,I);if(W){let Q=WU.parse({method:"notifications/tasks/status",params:W});if(await this.notification(Q),O4(W.status))this._cleanupTaskProgressHandler(b)}},listTasks:(b)=>{return U.listTasks(b,I)}}}}function Mz($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Fz($,I){let U={...$};for(let b in I){let w=b,X=I[w];if(X===void 0)continue;let D=U[w];if(Mz(D)&&Mz(X))U[w]={...D,...X};else U[w]=X}return U}var IV=CH(_Q(),1),UV=CH($V(),1);function Ex(){let $=new IV.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return UV.default($),$}class cQ{constructor($){this._ajv=$??Ex()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class mQ{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function wV($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function bV($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class rQ extends f8{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(GU.options.map((U,b)=>[U,b])),this.isMessageIgnored=(U,b)=>{let w=this._loggingLevels.get(b);return w?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(w):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new cQ,this.setRequestHandler(L8,(U)=>this._oninitialize(U)),this.setNotificationHandler(K8,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(E8,async(U,b)=>{let w=b.sessionId||b.requestInfo?.headers["mcp-session-id"]||void 0,{level:X}=U.params,D=GU.safeParse(X);if(D.success)this._loggingLevels.set(w,D.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new mQ(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Fz(this._capabilities,$)}setRequestHandler($,I){let b=H4($)?.method;if(!b)throw new Error("Schema is missing a method literal");let w;if(B6(b)){let D=b;w=D._zod?.def?.value??D.value}else{let D=b;w=D._def?.value??D.value}if(typeof w!=="string")throw new Error("Schema method literal must be a string");if(w==="tools/call"){let D=async(W,Q)=>{let G=B4(S1,W);if(!G.success){let B=G.error instanceof Error?G.error.message:String(G.error);throw new f(c.InvalidParams,`Invalid tools/call request: ${B}`)}let{params:Y}=G.data,J=await Promise.resolve(I(W,Q));if(Y.task){let B=B4(j1,J);if(!B.success){let A=B.error instanceof Error?B.error.message:String(B.error);throw new f(c.InvalidParams,`Invalid task creation result: ${A}`)}return B.data}let H=B4(ew,J);if(!H.success){let B=H.error instanceof Error?H.error.message:String(H.error);throw new f(c.InvalidParams,`Invalid tools/call result: ${B}`)}return H.data};return super.setRequestHandler($,D)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){bV(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;wV(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:EO.includes(I)?I:B8,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"},xw)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],b=Array.isArray(U.content)?U.content:[U.content],w=b.some((Q)=>Q.type==="tool_result"),X=$.messages.length>1?$.messages[$.messages.length-2]:void 0,D=X?Array.isArray(X.content)?X.content:[X.content]:[],W=D.some((Q)=>Q.type==="tool_use");if(w){if(b.some((Q)=>Q.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!W)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(W){let Q=new Set(D.filter((Y)=>Y.type==="tool_use").map((Y)=>Y.id)),G=new Set(b.filter((Y)=>Y.type==="tool_result").map((Y)=>Y.toolUseId));if(Q.size!==G.size||![...Q].every((Y)=>G.has(Y)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},P8,I);return this.request({method:"sampling/createMessage",params:$},S8,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let b=$;return this.request({method:"elicitation/create",params:b},sw,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let b=$.mode==="form"?$:{...$,mode:"form"},w=await this.request({method:"elicitation/create",params:b},sw,I);if(w.action==="accept"&&w.content&&b.requestedSchema)try{let D=this._jsonSchemaValidator.getValidator(b.requestedSchema)(w.content);if(!D.valid)throw new f(c.InvalidParams,`Elicitation response content does not match requested schema: ${D.errorMessage}`)}catch(X){if(X instanceof f)throw X;throw new f(c.InternalError,`Error validating elicitation response: ${X instanceof Error?X.message:String(X)}`)}return w}}}createElicitationCompletionNotifier($,I){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},k8,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var DV=Symbol.for("mcp.completable");function nQ($){return!!$&&typeof $==="object"&&DV in $}function WV($){return $[DV]?.complete}var XV;(function($){$.Completable="McpCompletable"})(XV||(XV={}));var Sx=/^[A-Za-z0-9._-]{1,128}$/;function Px($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Sx.test($)){let U=$.split("").filter((b)=>!/[A-Za-z0-9._-]/.test(b)).filter((b,w,X)=>X.indexOf(b)===w);return I.push(`Tool name contains invalid characters: ${U.map((b)=>`"${b}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function kx($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function iQ($){let I=Px($);return kx($,I.warnings),I.isValid}class oQ{constructor($){this._mcpServer=$}registerToolTask($,I,U){let b={taskSupport:"required",...I.execution};if(b.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,b,I._meta,U)}}class pQ{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new rQ($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new oQ(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(aw)),this.server.assertCanSetRequestHandler(F4(S1)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(aw,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let b=M1(I.inputSchema);return b?g8(b,{strictUnions:!0,pipeStrategy:"input"}):Rx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let b=M1(I.outputSchema);if(b)U.outputSchema=g8(b,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(S1,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new f(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Tool ${$.params.name} disabled`);let b=!!$.params.task,w=U.execution?.taskSupport,X="createTask"in U.handler;if((w==="required"||w==="optional")&&!X)throw new f(c.InternalError,`Tool ${$.params.name} has taskSupport '${w}' but was not registered with registerToolTask`);if(w==="required"&&!b)throw new f(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(w==="optional"&&!b&&X)return await this.handleAutomaticTaskPolling(U,$,I);let D=await this.validateToolInput(U,$.params.arguments,$.params.name),W=await this.executeToolHandler(U,D,I);if(b)return W;return await this.validateToolOutput(U,W,$.params.name),W}catch(U){if(U instanceof f){if(U.code===c.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let w=M1($.inputSchema)??$.inputSchema,X=await Pw(w,I);if(!X.success){let D="error"in X?X.error:"Unknown error",W=kw(D);throw new f(c.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${W}`)}return X.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new f(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let b=M1($.outputSchema),w=await Pw(b,I.structuredContent);if(!w.success){let X="error"in w?w.error:"Unknown error",D=kw(X);throw new f(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${D}`)}}async executeToolHandler($,I,U){let b=$.handler;if("createTask"in b){if(!U.taskStore)throw new Error("No task store provided.");let X={...U,taskStore:U.taskStore};if($.inputSchema){let D=b;return await Promise.resolve(D.createTask(I,X))}else{let D=b;return await Promise.resolve(D.createTask(X))}}if($.inputSchema){let X=b;return await Promise.resolve(X(I,U))}else{let X=b;return await Promise.resolve(X(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let b=await this.validateToolInput($,I.params.arguments,I.params.name),w=$.handler,X={...U,taskStore:U.taskStore},D=b?await Promise.resolve(w.createTask(b,X)):await Promise.resolve(w.createTask(X)),W=D.task.taskId,Q=D.task,G=Q.pollInterval??5000;while(Q.status!=="completed"&&Q.status!=="failed"&&Q.status!=="cancelled"){await new Promise((J)=>setTimeout(J,G));let Y=await U.taskStore.getTask(W);if(!Y)throw new f(c.InternalError,`Task ${W} not found during polling`);Q=Y}return await U.taskStore.getTaskResult(W)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4($b)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler($b,async($)=>{switch($.params.ref.type){case"ref/prompt":return cO($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return mO($),this.handleResourceCompletion($,$.params.ref);default:throw new f(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new f(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return CU;let w=H4(U.argsSchema)?.[$.params.argument.name];if(!nQ(w))return CU;let X=WV(w);if(!X)return CU;let D=await X($.params.argument.value,$.params.context);return GV(D)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((X)=>X.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return CU;throw new f(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let b=U.resourceTemplate.completeCallback($.params.argument.name);if(!b)return CU;let w=await b($.params.argument.value,$.params.context);return GV(w)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(iw)),this.server.assertCanSetRequestHandler(F4(ow)),this.server.assertCanSetRequestHandler(F4(dw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(iw,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([w,X])=>X.enabled).map(([w,X])=>({uri:w,name:X.name,...X.metadata})),b=[];for(let w of Object.values(this._registeredResourceTemplates)){if(!w.resourceTemplate.listCallback)continue;let X=await w.resourceTemplate.listCallback(I);for(let D of X.resources)b.push({...w.metadata,...D})}return{resources:[...U,...b]}}),this.server.setRequestHandler(ow,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(dw,async($,I)=>{let U=new URL($.params.uri),b=this._registeredResources[U.toString()];if(b){if(!b.enabled)throw new f(c.InvalidParams,`Resource ${U} disabled`);return b.readCallback(U,I)}for(let w of Object.values(this._registeredResourceTemplates)){let X=w.resourceTemplate.uriTemplate.match(U.toString());if(X)return w.readCallback(U,X,I)}throw new f(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(pw)),this.server.assertCanSetRequestHandler(F4(tw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?_x(I.argsSchema):void 0}})})),this.server.setRequestHandler(tw,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new f(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let b=M1(U.argsSchema),w=await Pw(b,$.params.arguments);if(!w.success){let W="error"in w?w.error:"Unknown error",Q=kw(W);throw new f(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${Q}`)}let X=w.data,D=U.callback;return await Promise.resolve(D(X,I))}else{let b=U.callback;return await Promise.resolve(b(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let b;if(typeof U[0]==="object")b=U.shift();let w=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let X=this._createRegisteredResource($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let X=this._createRegisteredResourceTemplate($,void 0,I,b,w);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),X}}registerResource($,I,U,b){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,U.title,I,U,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}_createRegisteredResource($,I,U,b,w){let X={name:$,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({uri:null}),update:(D)=>{if(typeof D.uri!=="undefined"&&D.uri!==U){if(delete this._registeredResources[U],D.uri)this._registeredResources[D.uri]=X}if(typeof D.name!=="undefined")X.name=D.name;if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.metadata!=="undefined")X.metadata=D.metadata;if(typeof D.callback!=="undefined")X.readCallback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=X,X}_createRegisteredResourceTemplate($,I,U,b,w){let X={resourceTemplate:U,title:I,metadata:b,readCallback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Q)=>{if(typeof Q.name!=="undefined"&&Q.name!==$){if(delete this._registeredResourceTemplates[$],Q.name)this._registeredResourceTemplates[Q.name]=X}if(typeof Q.title!=="undefined")X.title=Q.title;if(typeof Q.template!=="undefined")X.resourceTemplate=Q.template;if(typeof Q.metadata!=="undefined")X.metadata=Q.metadata;if(typeof Q.callback!=="undefined")X.readCallback=Q.callback;if(typeof Q.enabled!=="undefined")X.enabled=Q.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=X;let D=U.uriTemplate.variableNames;if(Array.isArray(D)&&D.some((Q)=>!!U.completeCallback(Q)))this.setCompletionRequestHandler();return X}_createRegisteredPrompt($,I,U,b,w){let X={title:I,description:U,argsSchema:b===void 0?void 0:d4(b),callback:w,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(D)=>{if(typeof D.name!=="undefined"&&D.name!==$){if(delete this._registeredPrompts[$],D.name)this._registeredPrompts[D.name]=X}if(typeof D.title!=="undefined")X.title=D.title;if(typeof D.description!=="undefined")X.description=D.description;if(typeof D.argsSchema!=="undefined")X.argsSchema=d4(D.argsSchema);if(typeof D.callback!=="undefined")X.callback=D.callback;if(typeof D.enabled!=="undefined")X.enabled=D.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=X,b){if(Object.values(b).some((W)=>{let Q=W instanceof J6?W._def?.innerType:W;return nQ(Q)}))this.setCompletionRequestHandler()}return X}_createRegisteredTool($,I,U,b,w,X,D,W,Q){iQ($);let G={title:I,description:U,inputSchema:QV(b),outputSchema:QV(w),annotations:X,execution:D,_meta:W,handler:Q,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(Y)=>{if(typeof Y.name!=="undefined"&&Y.name!==$){if(typeof Y.name==="string")iQ(Y.name);if(delete this._registeredTools[$],Y.name)this._registeredTools[Y.name]=G}if(typeof Y.title!=="undefined")G.title=Y.title;if(typeof Y.description!=="undefined")G.description=Y.description;if(typeof Y.paramsSchema!=="undefined")G.inputSchema=d4(Y.paramsSchema);if(typeof Y.outputSchema!=="undefined")G.outputSchema=d4(Y.outputSchema);if(typeof Y.callback!=="undefined")G.handler=Y.callback;if(typeof Y.annotations!=="undefined")G.annotations=Y.annotations;if(typeof Y._meta!=="undefined")G._meta=Y._meta;if(typeof Y.enabled!=="undefined")G.enabled=Y.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,b,w,X;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let W=I[0];if(dQ(W)){if(b=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!dQ(I[0]))X=I.shift()}else if(typeof W==="object"&&W!==null)X=I.shift()}let D=I[0];return this._createRegisteredTool($,void 0,U,b,w,X,{taskSupport:"forbidden"},void 0,D)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:b,description:w,inputSchema:X,outputSchema:D,annotations:W,_meta:Q}=I;return this._createRegisteredTool($,b,w,X,D,W,{taskSupport:"forbidden"},Q,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let b;if(I.length>1)b=I.shift();let w=I[0],X=this._createRegisteredPrompt($,void 0,U,b,w);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:b,description:w,argsSchema:X}=I,D=this._createRegisteredPrompt($,b,w,X,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),D}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var Rx={type:"object",properties:{}};function YV($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Tx($){return"_def"in $||"_zod"in $||YV($)}function dQ($){if(typeof $!=="object"||$===null)return!1;if(Tx($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(YV)}function QV($){if(!$)return;if(dQ($))return d4($);return $}function _x($){let I=H4($);if(!I)return[];return Object.entries(I).map(([U,b])=>{let w=wO(b),X=bO(b);return{name:U,description:w,required:!X}})}function F4($){let U=H4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let b=Rw(U);if(typeof b==="string")return b;throw new Error("Schema method literal must be a string")}function GV($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var CU={completion:{values:[],hasMore:!1}};import JV from"node:process";class tQ{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
41
+ `);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Zx(I)}clear(){this._buffer=void 0}}function Zx($){return CO.parse(JSON.parse($))}function NV($){return JSON.stringify($)+`
42
+ `}class aQ{constructor($=JV.stdin,I=JV.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new tQ,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){return new Promise((I)=>{let U=NV($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:Cx,defineProperty:BV,getOwnPropertyDescriptor:gx,getOwnPropertyNames:HV,getPrototypeOf:xx}=Object,hx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[HV($)[0]]((I={exports:{}}).exports,I),I.exports},fx=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=HV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!hx.call($,W)&&W!==U)BV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=gx(I,W))||b.enumerable})}return $},N$=($,I,U)=>(U=$!=null?Cx(xx($)):{},fx(I||!$||!$.__esModule?BV(U,"default",{value:$,enumerable:!0}):U,$)),AV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),yx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=AV().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),ux=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=AV().default,b=yx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),u6=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=ux();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),_$=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=u6();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let b=null,w=!1,X=!1,D=!1;function W(){if(b===null){D=!0;return}if(X)return;if(X=!0,typeof b==="function")b();else if(b)b.unsubscribe()}if(b=$({next(Q){var G;if(w)return;(G=U.next)===null||G===void 0||G.call(U,Q)},error(Q){var G;if(w)return;w=!0,(G=U.error)===null||G===void 0||G.call(U,Q),W()},complete(){var Q;if(w)return;w=!0,(Q=U.complete)===null||Q===void 0||Q.call(U),W()}}),D)W();return{unsubscribe:W}},pipe(...U){return U.reduce(lx,I)}};return I}function lx($,I){return I($)}function eQ($){let I=new AbortController;return new Promise((b,w)=>{let X=!1;function D(){if(X)return;X=!0,W.unsubscribe()}I.signal.addEventListener("abort",()=>{w(I.signal.reason)});let W=$.subscribe({next(Q){X=!0,b(Q),D()},error(Q){w(Q)},complete(){I.abort(),D()}})})}function sQ($){return(I)=>{let U=0,b=null,w=[];function X(){if(b)return;b=I.subscribe({next(W){for(let G of w){var Q;(Q=G.next)===null||Q===void 0||Q.call(G,W)}},error(W){for(let G of w){var Q;(Q=G.error)===null||Q===void 0||Q.call(G,W)}},complete(){for(let Q of w){var W;(W=Q.complete)===null||W===void 0||W.call(Q)}}})}function D(){if(U===0&&b){let W=b;b=null,W.unsubscribe()}}return l6((W)=>{return U++,w.push(W),X(),{unsubscribe(){U--,D();let Q=w.findIndex((G)=>G===W);if(Q>-1)w.splice(Q,1)}}})}}var pd=Symbol();function mb($){let I=$,U=[],b=(D)=>{if(I!==void 0)D.next(I);U.push(D)},w=(D)=>{U.splice(U.indexOf(D),1)},X=l6((D)=>{return b(D),()=>{w(D)}});return X.next=(D)=>{if(I===D)return;I=D;for(let W of U)W.next(D)},X.get=()=>I,X}function OV($){return l6((I)=>{function U(w=0,X=$.op){let D=$.links[w];if(!D)throw new Error("No more links to execute - did you forget to add an ending link?");return D({op:X,next(Q){return U(w+1,Q)}})}return U().subscribe(I)})}function w4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function rb(){return Object.create(null)}var y1={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var zV=[y1.BAD_GATEWAY,y1.SERVICE_UNAVAILABLE,y1.GATEWAY_TIMEOUT,y1.INTERNAL_SERVER_ERROR];var{create:mx,defineProperty:KV,getOwnPropertyDescriptor:rx,getOwnPropertyNames:vV,getPrototypeOf:nx}=Object,ix=Object.prototype.hasOwnProperty,gU=($,I)=>function(){return I||$[vV($)[0]]((I={exports:{}}).exports,I),I.exports},ox=($,I,U,b)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var w=vV(I),X=0,D=w.length,W;X<D;X++)if(W=w[X],!ix.call($,W)&&W!==U)KV($,W,{get:((Q)=>I[Q]).bind(null,W),enumerable:!(b=rx(I,W))||b.enumerable})}return $},xU=($,I,U)=>(U=$!=null?mx(nx($)):{},ox(I||!$||!$.__esModule?KV(U,"default",{value:$,enumerable:!0}):U,$)),VV=()=>{},LV=($)=>{if(Object.freeze)Object.freeze($)};function qV($,I,U){var b;let w=I.join(".");return(b=U[w])!==null&&b!==void 0||(U[w]=new Proxy(VV,{get(X,D){if(typeof D!=="string"||D==="then")return;return qV($,[...I,D],U)},apply(X,D,W){let Q=I[I.length-1];if(Q==="valueOf"||Q==="toString"||Q==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let G={args:W,path:I};if(Q==="call")G={args:W.length>=2?[W[1]]:[],path:I.slice(0,-1)};else if(Q==="apply")G={args:W.length>=2?W[1]:[],path:I.slice(0,-1)};return LV(G.args),LV(G.path),$(G)}})),U[w]}var nb=($)=>qV($,[],rb()),$G=($)=>{return new Proxy(VV,{get(I,U){if(U==="then")return;return $(U)}})};var MV=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(b){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},I.exports.__esModule=!0,I.exports.default=I.exports,U(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),dx=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=MV().default;function b(w,X){if(U(w)!="object"||!w)return w;var D=w[Symbol.toPrimitive];if(D!==void 0){var W=D.call(w,X||"default");if(U(W)!="object")return W;throw new TypeError("@@toPrimitive must return a primitive value.")}return(X==="string"?String:Number)(w)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),px=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=MV().default,b=dx();function w(X){var D=b(X,"string");return U(D)=="symbol"?D:D+""}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),IG=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=px();function b(w,X,D){return(X=U(X))in w?Object.defineProperty(w,X,{value:D,enumerable:!0,configurable:!0,writable:!0}):w[X]=D,w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),ib=gU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=IG();function b(X,D){var W=Object.keys(X);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(X);D&&(Q=Q.filter(function(G){return Object.getOwnPropertyDescriptor(X,G).enumerable})),W.push.apply(W,Q)}return W}function w(X){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{};D%2?b(Object(W),!0).forEach(function(Q){U(X,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(W)):b(Object(W)).forEach(function(Q){Object.defineProperty(X,Q,Object.getOwnPropertyDescriptor(W,Q))})}return X}I.exports=w,I.exports.__esModule=!0,I.exports.default=I.exports}}),Yp=xU(ib(),1);var Hp=xU(IG(),1);var ob=xU(ib(),1);function ex($,I){if("error"in $){let b=I.deserialize($.error);return{ok:!1,error:ob.default(ob.default({},$),{},{error:b})}}return{ok:!0,result:ob.default(ob.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var UG=class extends Error{constructor(){super("Unable to transform response from server")}};function wG($,I){let U;try{U=ex($,I)}catch(b){throw new UG}if(!U.ok&&(!w4(U.error.error)||typeof U.error.error.code!=="number"))throw new UG;if(U.ok&&!w4(U.result))throw new UG;return U}var Ap=xU(ib(),1);var Op=Symbol();var db=N$(u6(),1),u1=N$(_$(),1);function FV($){return $ instanceof j4}function Uh($){return w4($)&&w4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function wh($,I){if(typeof $==="string")return $;if(w4($)&&typeof $.message==="string")return $.message;return I}var j4=class $ extends Error{constructor(I,U){var b,w;let X=U===null||U===void 0?void 0:U.cause;super(I,{cause:X});db.default(this,"cause",void 0),db.default(this,"shape",void 0),db.default(this,"data",void 0),db.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=X,this.shape=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error,this.data=U===null||U===void 0||(w=U.result)===null||w===void 0?void 0:w.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let b=I;if(FV(b)){if(U.meta)b.meta=u1.default(u1.default({},b.meta),U.meta);return b}if(Uh(b))return new $(b.error.message,u1.default(u1.default({},U),{},{result:b,cause:U.cause}));return new $(wh(b,"Unknown error"),u1.default(u1.default({},U),{},{cause:b}))}};function pb($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var jV=($)=>typeof $==="function";function EV($){if($)return $;if(typeof window!=="undefined"&&jV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&jV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var hU=N$(_$(),1);function tb($){return{url:$.url.toString(),fetch:$.fetch,transformer:pb($.transformer),methodOverride:$.methodOverride}}function bh($){let I={};for(let U=0;U<$.length;U++){let b=$[U];I[U]=b}return I}var Xh={query:"GET",mutation:"POST",subscription:"PATCH"};function SV($){return"input"in $?$.transformer.input.serialize($.input):bh($.inputs.map((I)=>$.transformer.input.serialize(I)))}var l1=($)=>{let I=$.url.split("?"),b=I[0].replace(/\/$/,"")+"/"+$.path,w=[];if(I[1])w.push(I[1]);if("inputs"in $)w.push("batch=1");if($.type==="query"||$.type==="subscription"){let X=SV($);if(X!==void 0&&$.methodOverride!=="POST")w.push(`input=${encodeURIComponent(JSON.stringify(X))}`)}if(w.length)b+="?"+w.join("&");return b},PV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=SV($);return I!==void 0?JSON.stringify(I):void 0},bG=($)=>{return ab(hU.default(hU.default({},$),{},{contentTypeHeader:"application/json",getUrl:l1,getBody:PV}))},Dh=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},Wh=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new Dh};async function kV($){var I,U;Wh($.signal);let b=$.getUrl($),w=$.getBody($),X=(I=$.methodOverride)!==null&&I!==void 0?I:Xh[$.type],D=await(async()=>{let Q=await $.headers();if(Symbol.iterator in Q)return Object.fromEntries(Q);return Q})(),W=hU.default(hU.default(hU.default({},$.contentTypeHeader&&X!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),D);return EV($.fetch)(b,{method:X,signal:$.signal,body:w,headers:W})}async function ab($){let I={},U=await kV($);I.response=U;let b=await U.json();return I.responseJSON=b,{json:b,meta:I}}function RV($){return $ instanceof Uint8Array||$ instanceof Blob}function TV($){return $ instanceof FormData}var c1=N$(_$(),1),Qh=($)=>{if("input"in $){let{input:I}=$;if(TV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:void 0,getUrl:l1,getBody:()=>I}))}if(RV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return ab(c1.default(c1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:l1,getBody:()=>I}))}}return bG($)};function XG($){let I=tb($);return()=>{return(U)=>{let{op:b}=U;return l6((w)=>{let{path:X,input:D,type:W}=b;if(W==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let Q=Qh(c1.default(c1.default({},I),{},{type:W,path:X,input:D,signal:b.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:b});return $.headers}})),G=void 0;return Q.then((Y)=>{G=Y.meta;let J=wG(Y.json,I.transformer.output);if(!J.ok){w.error(j4.from(J.error,{meta:G}));return}w.next({context:Y.meta,result:J.result}),w.complete()}).catch((Y)=>{w.error(j4.from(Y,{meta:G}))}),()=>{}})}}}var Bt=N$(_$(),1);var Ot=N$(_$(),1);var DG=($,...I)=>{return typeof $==="function"?$(...I):$},qt=N$(u6(),1);function Gh(){let $,I;return{promise:new Promise((b,w)=>{$=b,I=w}),resolve:$,reject:I}}async function Yh($){let I=await DG($.url);if(!$.connectionParams)return I;let b=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+b}async function Nh($,I){let U={method:"connectionParams",data:await DG($)};return I.encode(U)}var Mt=N$(u6(),1);var E4=N$(u6(),1);function Jh($){let{promise:I,resolve:U,reject:b}=Gh();return $.addEventListener("open",()=>{$.removeEventListener("error",b),U()}),$.addEventListener("error",b),I}function Bh($,{intervalMs:I,pongTimeoutMs:U}){let b,w;function X(){b=setTimeout(()=>{$.send("PING"),w=setTimeout(()=>{$.close()},U)},I)}function D(){clearTimeout(b),X()}function W(){clearTimeout(w),D()}$.addEventListener("open",X),$.addEventListener("message",({data:Q})=>{if(clearTimeout(b),X(),Q==="PONG")W()}),$.addEventListener("close",()=>{clearTimeout(b),clearTimeout(w)})}var Hh=class ${constructor(I){var U;if(E4.default(this,"id",++$.connectCount),E4.default(this,"WebSocketPonyfill",void 0),E4.default(this,"urlOptions",void 0),E4.default(this,"keepAliveOpts",void 0),E4.default(this,"encoder",void 0),E4.default(this,"wsObservable",mb(null)),E4.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive,this.encoder=I.encoder}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=Yh(I.urlOptions).then((b)=>new I.WebSocketPonyfill(b));I.openPromise=U.then(async(b)=>{if(I.ws=b,b.binaryType="arraybuffer",b.addEventListener("message",function({data:w}){if(w==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)Bh(b,I.keepAliveOpts);if(b.addEventListener("close",()=>{if(I.ws===b)I.ws=null}),await Jh(b),I.urlOptions.connectionParams)b.send(await Nh(I.urlOptions.connectionParams,I.encoder))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};E4.default(Hh,"connectCount",0);var Ft=N$(u6(),1),jt=N$(_$(),1);var WG=N$(u6(),1),_V=N$(_$(),1),Ah=class{constructor($){WG.default(this,"links",void 0),WG.default(this,"runtime",void 0),WG.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return OV({links:this.links,op:_V.default(_V.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(sQ())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await eQ(U)).result.data}catch(U){throw j4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(w){switch(w.result.type){case"state":{var X;(X=U.onConnectionStateChange)===null||X===void 0||X.call(U,w.result);break}case"started":{var D;(D=U.onStarted)===null||D===void 0||D.call(U,{context:w.context});break}case"stopped":{var W;(W=U.onStopped)===null||W===void 0||W.call(U);break}case"data":case void 0:{var Q;(Q=U.onData)===null||Q===void 0||Q.call(U,w.result.data);break}}},error(w){var X;(X=U.onError)===null||X===void 0||X.call(U,w)},complete(){var w;(w=U.onComplete)===null||w===void 0||w.call(U)}})}};var Oh=Symbol.for("trpc_untypedClient"),zh={query:"query",mutate:"mutation",subscribe:"subscription"},Lh=($)=>{return zh[$]};function Kh($){let I=nb(({path:U,args:b})=>{let w=[...U],X=Lh(w.pop()),D=w.join(".");return $[X](D,...b)});return $G((U)=>{if(U===Oh)return $;return I[U]})}function ZV($){let I=new Ah($);return Kh(I)}var $a=N$(_$(),1);var Ia=N$(_$(),1);var vh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(w){var X,D,W,Q=2;for(typeof Symbol!="undefined"&&(D=Symbol.asyncIterator,W=Symbol.iterator);Q--;){if(D&&(X=w[D])!=null)return X.call(w);if(W&&(X=w[W])!=null)return new b(X.call(w));D="@@asyncIterator",W="@@iterator"}throw new TypeError("Object is not async iterable")}function b(w){function X(D){if(Object(D)!==D)return Promise.reject(new TypeError(D+" is not an object."));var W=D.done;return Promise.resolve(D.value).then(function(Q){return{value:Q,done:W}})}return b=function D(W){this.s=W,this.n=W.next},b.prototype={s:null,n:null,next:function D(){return X(this.n.apply(this.s,arguments))},return:function D(W){var Q=this.s.return;return Q===void 0?Promise.resolve({value:W,done:!0}):X(Q.apply(this.s,arguments))},throw:function D(W){var Q=this.s.return;return Q===void 0?Promise.reject(W):X(Q.apply(this.s,arguments))}},new b(w)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Ua=N$(vh(),1);var wa=N$(_$(),1);var Vh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var b=typeof SuppressedError=="function"?SuppressedError:function(W,Q){var G=Error();return G.name="SuppressedError",G.error=W,G.suppressed=Q,G},w={},X=[];function D(W,Q){if(Q!=null){if(Object(Q)!==Q)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(W)var G=Q[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(G===void 0&&(G=Q[Symbol.dispose||Symbol.for("Symbol.dispose")],W))var Y=G;if(typeof G!="function")throw new TypeError("Object is not disposable.");Y&&(G=function J(){try{Y.call(Q)}catch(H){return Promise.reject(H)}}),X.push({v:Q,d:G,a:W})}else W&&X.push({d:Q,a:W});return Q}return{e:w,u:D.bind(null,!1),a:D.bind(null,!0),d:function W(){var Q,G=this.e,Y=0;function J(){for(;Q=X.pop();)try{if(!Q.a&&Y===1)return Y=0,X.push(Q),Promise.resolve().then(J);if(Q.d){var B=Q.d.call(Q.v);if(Q.a)return Y|=2,Promise.resolve(B).then(J,H)}else Y|=1}catch(A){return H(A)}if(Y===1)return G!==w?Promise.reject(G):Promise.resolve();if(G!==w)throw G}function H(B){return G=G!==w?new b(B,G):B,J()}return J()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),CV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(b,w){this.v=b,this.k=w}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),qh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=CV();function b(w){return new U(w,0)}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Mh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=CV();function b(X){return function(){return new w(X.apply(this,arguments))}}function w(X){var D,W;function Q(Y,J){try{var H=X[Y](J),B=H.value,A=B instanceof U;Promise.resolve(A?B.v:B).then(function(O){if(A){var V=Y==="return"?"return":"next";if(!B.k||O.done)return Q(V,O);O=X[V](O).value}G(H.done?"return":"normal",O)},function(O){Q("throw",O)})}catch(O){G("throw",O)}}function G(Y,J){switch(Y){case"return":D.resolve({value:J,done:!0});break;case"throw":D.reject(J);break;default:D.resolve({value:J,done:!1})}(D=D.next)?Q(D.key,D.arg):W=null}this._invoke=function(Y,J){return new Promise(function(H,B){var A={key:Y,arg:J,resolve:H,reject:B,next:null};W?W=W.next=A:(D=W=A,Q(Y,J))})},typeof X.return!="function"&&(this.return=void 0)}w.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},w.prototype.next=function(X){return this._invoke("next",X)},w.prototype.throw=function(X){return this._invoke("throw",X)},w.prototype.return=function(X){return this._invoke("return",X)},I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),ba=N$(Vh(),1),Xa=N$(qh(),1),Da=N$(Mh(),1),Wa=N$(_$(),1);class QG{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class fU{constructor($){this.generateIdentifier=$,this.kv=new QG}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class GG extends fU{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function Fh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function gV($,I){let U=Fh($);if("find"in U)return U.find(I);let b=U;for(let w=0;w<b.length;w++){let X=b[w];if(I(X))return X}return}function I1($,I){Object.entries($).forEach(([U,b])=>I(b,U))}function m1($,I){return $.indexOf(I)!==-1}function YG($,I){for(let U=0;U<$.length;U++){let b=$[U];if(I(b))return b}return}class NG{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return gV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var jh=($)=>Object.prototype.toString.call($).slice(8,-1),JG=($)=>typeof $==="undefined",Eh=($)=>$===null,U1=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},eb=($)=>U1($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),Sh=($)=>typeof $==="string",Ph=($)=>typeof $==="number"&&!isNaN($),kh=($)=>typeof $==="boolean",xV=($)=>$ instanceof RegExp,S4=($)=>$ instanceof Map,P4=($)=>$ instanceof Set,BG=($)=>jh($)==="Symbol",hV=($)=>$ instanceof Date&&!isNaN($.valueOf()),sb=($)=>$ instanceof Error,HG=($)=>typeof $==="number"&&isNaN($),fV=($)=>kh($)||Eh($)||JG($)||Ph($)||Sh($)||BG($),yV=($)=>typeof $==="bigint",uV=($)=>$===1/0||$===-1/0,lV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),cV=($)=>$ instanceof URL;var $X=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),IX=($)=>$.map(String).map($X).join("."),r1=($,I)=>{let U=[],b="";for(let X=0;X<$.length;X++){let D=$.charAt(X);if(!I&&D==="\\"){let G=$.charAt(X+1);if(G==="\\"){b+="\\",X++;continue}else if(G!==".")throw Error("invalid path")}if(D==="\\"&&$.charAt(X+1)==="."){b+=".",X++;continue}if(D==="."){U.push(b),b="";continue}b+=D}let w=b;return U.push(w),U};function c6($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var mV=[c6(JG,"undefined",()=>null,()=>{return}),c6(yV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(hV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6(sb,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((b)=>{U[b]=$[b]}),U}),c6(xV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(P4,"set",($)=>[...$.values()],($)=>new Set($)),c6(S4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>HG($)||uV($),"number",($)=>{if(HG($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(cV,"URL",($)=>$.toString(),($)=>new URL($))];function UX($,I,U,b){return{isApplicable:$,annotation:I,transform:U,untransform:b}}var rV=UX(($,I)=>{if(BG($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let b=U.symbolRegistry.getValue(I[1]);if(!b)throw new Error("Trying to deserialize unknown symbol");return b}),Rh=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),nV=UX(lV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Rh[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function AG($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var iV=UX(AG,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let b={};return U.forEach((w)=>{b[w]=$[w]}),b},($,I,U)=>{let b=U.classRegistry.getValue(I[1]);if(!b)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(b.prototype),$)}),oV=UX(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let b=U.customTransformerRegistry.findByName(I[1]);if(!b)throw new Error("Trying to deserialize unknown custom value");return b.deserialize($)}),Th=[iV,rV,oV,nV],OG=($,I)=>{let U=YG(Th,(w)=>w.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let b=YG(mV,(w)=>w.isApplicable($,I));if(b)return{value:b.transform($,I),type:b.annotation};return},dV={};mV.forEach(($)=>{dV[$.annotation]=$});var pV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return rV.untransform($,I,U);case"class":return iV.untransform($,I,U);case"custom":return oV.untransform($,I,U);case"typed-array":return nV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let b=dV[I];if(!b)throw new Error("Unknown transformation: "+I);return b.untransform($,U)}};var n1=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function tV($){if(m1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(m1($,"prototype"))throw new Error("prototype is not allowed as a property");if(m1($,"constructor"))throw new Error("constructor is not allowed as a property")}var aV=($,I)=>{tV(I);for(let U=0;U<I.length;U++){let b=I[U];if(P4($))$=n1($,+b);else if(S4($)){let w=+b,X=+I[++U]===0?"key":"value",D=n1($,w);switch(X){case"key":$=D;break;case"value":$=$.get(D);break}}else $=$[b]}return $},wX=($,I,U)=>{if(tV(I),I.length===0)return U($);let b=$;for(let X=0;X<I.length-1;X++){let D=I[X];if(_6(b)){let W=+D;b=b[W]}else if(U1(b))b=b[D];else if(P4(b)){let W=+D;b=n1(b,W)}else if(S4(b)){if(X===I.length-2)break;let Q=+D,G=+I[++X]===0?"key":"value",Y=n1(b,Q);switch(G){case"key":b=Y;break;case"value":b=b.get(Y);break}}}let w=I[I.length-1];if(_6(b))b[+w]=U(b[+w]);else if(U1(b))b[w]=U(b[w]);if(P4(b)){let X=n1(b,+w),D=U(X);if(X!==D)b.delete(X),b.add(D)}if(S4(b)){let X=+I[I.length-2],D=n1(b,X);switch(+w===0?"key":"value"){case"key":{let Q=U(D);if(b.set(Q,b.get(D)),Q!==D)b.delete(D);break}case"value":{b.set(D,U(b.get(D)));break}}}return $};var eV=($)=>$<1;function zG($,I,U,b=[]){if(!$)return;let w=eV(U);if(!_6($)){I1($,(W,Q)=>zG(W,I,U,[...b,...r1(Q,w)]));return}let[X,D]=$;if(D)I1(D,(W,Q)=>{zG(W,I,U,[...b,...r1(Q,w)])});I(X,b)}function sV($,I,U,b){return zG(I,(w,X)=>{$=wX($,X,(D)=>pV(D,w,b))},U),$}function $q($,I,U){let b=eV(U);function w(X,D){let W=aV($,r1(D,b));X.map((Q)=>r1(Q,b)).forEach((Q)=>{$=wX($,Q,()=>W)})}if(_6(I)){let[X,D]=I;if(X.forEach((W)=>{$=wX($,r1(W,b),()=>$)}),D)I1(D,w)}else I1(I,w);return $}var _h=($,I)=>U1($)||_6($)||S4($)||P4($)||sb($)||AG($,I);function Zh($,I,U){let b=U.get($);if(b)b.push(I);else U.set($,[I])}function Iq($,I){let U={},b=void 0;if($.forEach((w)=>{if(w.length<=1)return;if(!I)w=w.map((W)=>W.map(String)).sort((W,Q)=>W.length-Q.length);let[X,...D]=w;if(X.length===0)b=D.map(IX);else U[IX(X)]=D.map(IX)}),b)if(eb(U))return[b];else return[b,U];else return eb(U)?void 0:U}var LG=($,I,U,b,w=[],X=[],D=new Map)=>{let W=fV($);if(!W){Zh($,w,I);let B=D.get($);if(B)return b?{transformedValue:null}:B}if(!_h($,U)){let B=OG($,U),A=B?{transformedValue:B.value,annotations:[B.type]}:{transformedValue:$};if(!W)D.set($,A);return A}if(m1(X,$))return{transformedValue:null};let Q=OG($,U),G=Q?.value??$,Y=_6(G)?[]:{},J={};I1(G,(B,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);let O=LG(B,I,U,b,[...w,A],[...X,$],D);if(Y[A]=O.transformedValue,_6(O.annotations))J[$X(A)]=O.annotations;else if(U1(O.annotations))I1(O.annotations,(V,q)=>{J[$X(A)+"."+q]=V})});let H=eb(J)?{transformedValue:Y,annotations:Q?[Q.type]:void 0}:{transformedValue:Y,annotations:Q?[Q.type,J]:J};if(!W)D.set($,H);return H};function bX($){return Object.prototype.toString.call($).slice(8,-1)}function XX($){return bX($)==="Array"}function KG($){if(bX($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function Ch($,I,U,b,w){let X={}.propertyIsEnumerable.call(b,I)?"enumerable":"nonenumerable";if(X==="enumerable")$[I]=U;if(w&&X==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function DX($,I={}){if(XX($))return $.map((w)=>DX(w,I));if(!KG($))return $;let U=Object.getOwnPropertyNames($),b=Object.getOwnPropertySymbols($);return[...U,...b].reduce((w,X)=>{if(X==="__proto__")return w;if(XX(I.props)&&!I.props.includes(X))return w;let D=$[X],W=DX(D,I);return Ch(w,X,W,$,I.nonenumerable),w},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new GG,this.symbolRegistry=new fU((I)=>I.description??""),this.customTransformerRegistry=new NG,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=LG($,I,this,this.dedupe),b={json:U.transformedValue};if(U.annotations)b.meta={...b.meta,values:U.annotations};let w=Iq(I,this.dedupe);if(w)b.meta={...b.meta,referentialEqualities:w};if(b.meta)b.meta.v=1;return b}deserialize($,I){let{json:U,meta:b}=$,w=I?.inPlace?U:DX(U);if(b?.values)w=sV(w,b.values,b.v??0,this);if(b?.referentialEqualities)w=$q(w,b.referentialEqualities,b.v??0);return w}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}U$.defaultInstance=new U$;U$.serialize=U$.defaultInstance.serialize.bind(U$.defaultInstance);U$.deserialize=U$.defaultInstance.deserialize.bind(U$.defaultInstance);U$.stringify=U$.defaultInstance.stringify.bind(U$.defaultInstance);U$.parse=U$.defaultInstance.parse.bind(U$.defaultInstance);U$.registerClass=U$.defaultInstance.registerClass.bind(U$.defaultInstance);U$.registerSymbol=U$.defaultInstance.registerSymbol.bind(U$.defaultInstance);U$.registerCustom=U$.defaultInstance.registerCustom.bind(U$.defaultInstance);U$.allowErrorProps=U$.defaultInstance.allowErrorProps.bind(U$.defaultInstance);var Uq=U$;var{serialize:da,deserialize:pa,stringify:ta,parse:aa,registerClass:ea,registerCustom:sa,registerSymbol:$e,allowErrorProps:Ie}=U$;class vG{trpc;constructor($){this.trpc=ZV({links:[XG({url:`${$.apiUrl}/trpc`,transformer:Uq,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async situate($){return this.trpc.mcpTools.situate.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromReactionArtifact($){return this.trpc.mcpTools.createMatrixFromReactionArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async updateEdge($){return this.trpc.mcpTools.updateEdge.mutate($)}async updateArtifactLinkRelation($){return this.trpc.mcpTools.updateArtifactLinkRelation.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function VG($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var b4=VG();async function wq($){let I=VG();I.info("Initializing server context...");let U=new vG({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let b;try{b=(await U.whoami()).userId,I.info(`Resolved user: ${b.slice(0,8)}...`)}catch(X){I.error("Failed to resolve user identity from API key:",X),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let w={userId:b,client:U,log:I};try{I.info("Loading workspace context..."),w.workspaceContext=await U.getWorkspaceContext();let X=w.workspaceContext.orgs.length,D=w.workspaceContext.orgs.reduce((W,Q)=>W+Q.workspaces.length,0);I.info(`Workspace context loaded: ${X} org(s), ${D} workspace(s)`)}catch(X){I.warn("Failed to load workspace context at startup (will retry on first tool call):",X)}return w}var N={};v6(N,{xor:()=>kM,xid:()=>eq,void:()=>MM,uuidv7:()=>rq,uuidv6:()=>mq,uuidv4:()=>cq,uuid:()=>lq,util:()=>E,url:()=>nq,uppercase:()=>wI,unknown:()=>Y1,union:()=>_D,undefined:()=>VM,ulid:()=>aq,uint64:()=>KM,uint32:()=>OM,tuple:()=>fJ,trim:()=>GI,treeifyError:()=>ZG,transform:()=>CD,toUpperCase:()=>NI,toLowerCase:()=>YI,toJSONSchema:()=>XD,templateLiteral:()=>cM,symbol:()=>vM,superRefine:()=>GB,success:()=>yM,stringbool:()=>tM,stringFormat:()=>GM,string:()=>ND,strictObject:()=>SM,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,setErrorMap:()=>zu,set:()=>CM,safeParseAsync:()=>JJ,safeParse:()=>NJ,safeEncodeAsync:()=>KJ,safeEncode:()=>zJ,safeDecodeAsync:()=>vJ,safeDecode:()=>LJ,registry:()=>TX,regexes:()=>K6,regex:()=>II,refine:()=>QB,record:()=>yJ,readonly:()=>UB,property:()=>UD,promise:()=>mM,prettifyError:()=>CG,preprocess:()=>eM,prefault:()=>pJ,positive:()=>eX,pipe:()=>J0,partialRecord:()=>TM,parseAsync:()=>YJ,parse:()=>GJ,overwrite:()=>Z6,optional:()=>Y0,object:()=>EM,number:()=>qJ,nullish:()=>fM,nullable:()=>N0,null:()=>SJ,normalize:()=>QI,nonpositive:()=>$D,nonoptional:()=>tJ,nonnegative:()=>ID,never:()=>TD,negative:()=>sX,nativeEnum:()=>gM,nanoid:()=>dq,nan:()=>uM,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,meta:()=>dM,maxSize:()=>W1,maxLength:()=>Q1,map:()=>ZM,mac:()=>IM,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,looseRecord:()=>_M,looseObject:()=>PM,locales:()=>X0,literal:()=>xM,length:()=>G1,lazy:()=>XB,ksuid:()=>sq,keyof:()=>jM,jwt:()=>QM,json:()=>aM,iso:()=>AI,ipv6:()=>UM,ipv4:()=>$M,intersection:()=>xJ,int64:()=>LM,int32:()=>AM,int:()=>JD,instanceof:()=>pM,includes:()=>bI,httpUrl:()=>iq,hostname:()=>YM,hex:()=>NM,hash:()=>JM,guid:()=>uq,gte:()=>p$,gt:()=>n6,globalRegistry:()=>d$,getErrorMap:()=>Lu,function:()=>rM,fromJSONSchema:()=>$F,formatError:()=>dU,float64:()=>HM,float32:()=>BM,flattenError:()=>oU,file:()=>hM,enum:()=>ZD,endsWith:()=>DI,encodeAsync:()=>AJ,encode:()=>BJ,emoji:()=>oq,email:()=>yq,e164:()=>WM,discriminatedUnion:()=>RM,describe:()=>oM,decodeAsync:()=>OJ,decode:()=>HJ,date:()=>FM,custom:()=>iM,cuid2:()=>tq,cuid:()=>pq,core:()=>D4,config:()=>P$,coerce:()=>NB,codec:()=>lM,clone:()=>o$,cidrv6:()=>bM,cidrv4:()=>wM,check:()=>nM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>zM,base64url:()=>DM,base64:()=>XM,array:()=>A0,any:()=>qM,_function:()=>rM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodRealError:()=>b6,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIssueCode:()=>Ou,ZodIntersection:()=>gJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFirstPartyTypeKind:()=>YB,ZodFile:()=>mJ,ZodError:()=>Hu,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ,TimePrecision:()=>h7,NEVER:()=>qG,$output:()=>T7,$input:()=>_7,$brand:()=>MG});var D4={};v6(D4,{version:()=>RY,util:()=>E,treeifyError:()=>ZG,toJSONSchema:()=>XD,toDotPath:()=>Gq,safeParseAsync:()=>xG,safeParse:()=>gG,safeEncodeAsync:()=>Bf,safeEncode:()=>Nf,safeDecodeAsync:()=>Hf,safeDecode:()=>Jf,registry:()=>TX,regexes:()=>K6,process:()=>G$,prettifyError:()=>CG,parseAsync:()=>YX,parse:()=>GX,meta:()=>z5,locales:()=>X0,isValidJWT:()=>Pq,isValidBase64URL:()=>Sq,isValidBase64:()=>eY,initializeContext:()=>x4,globalRegistry:()=>d$,globalConfig:()=>yU,formatError:()=>dU,flattenError:()=>oU,finalize:()=>f4,extractDefs:()=>h4,encodeAsync:()=>Gf,encode:()=>Wf,describe:()=>O5,decodeAsync:()=>Yf,decode:()=>Qf,createToJSONSchemaMethod:()=>K5,createStandardJSONSchemaMethod:()=>HI,config:()=>P$,clone:()=>o$,_xor:()=>ry,_xid:()=>cX,_void:()=>W5,_uuidv7:()=>xX,_uuidv6:()=>gX,_uuidv4:()=>CX,_uuid:()=>ZX,_url:()=>W0,_uppercase:()=>wI,_unknown:()=>X5,_union:()=>my,_undefined:()=>U5,_ulid:()=>lX,_uint64:()=>$5,_uint32:()=>d7,_tuple:()=>oy,_trim:()=>GI,_transform:()=>$u,_toUpperCase:()=>NI,_toLowerCase:()=>YI,_templateLiteral:()=>Gu,_symbol:()=>I5,_superRefine:()=>A5,_success:()=>Xu,_stringbool:()=>L5,_stringFormat:()=>BI,_string:()=>C7,_startsWith:()=>XI,_slugify:()=>JI,_size:()=>$I,_set:()=>ty,_safeParseAsync:()=>e1,_safeParse:()=>a1,_safeEncodeAsync:()=>zX,_safeEncode:()=>AX,_safeDecodeAsync:()=>LX,_safeDecode:()=>OX,_regex:()=>II,_refine:()=>H5,_record:()=>dy,_readonly:()=>Qu,_property:()=>UD,_promise:()=>Nu,_positive:()=>eX,_pipe:()=>Wu,_parseAsync:()=>t1,_parse:()=>p1,_overwrite:()=>Z6,_optional:()=>Iu,_number:()=>c7,_nullable:()=>Uu,_null:()=>w5,_normalize:()=>QI,_nonpositive:()=>$D,_nonoptional:()=>bu,_nonnegative:()=>ID,_never:()=>D5,_negative:()=>sX,_nativeEnum:()=>ey,_nanoid:()=>fX,_nan:()=>Y5,_multipleOf:()=>C4,_minSize:()=>g4,_minLength:()=>X4,_min:()=>p$,_mime:()=>WI,_maxSize:()=>W1,_maxLength:()=>Q1,_max:()=>Y6,_map:()=>py,_mac:()=>x7,_lte:()=>Y6,_lt:()=>r6,_lowercase:()=>UI,_literal:()=>sy,_length:()=>G1,_lazy:()=>Yu,_ksuid:()=>mX,_jwt:()=>aX,_isoTime:()=>u7,_isoDuration:()=>l7,_isoDateTime:()=>f7,_isoDate:()=>y7,_ipv6:()=>nX,_ipv4:()=>rX,_intersection:()=>iy,_int64:()=>s7,_int32:()=>o7,_int:()=>r7,_includes:()=>bI,_guid:()=>D0,_gte:()=>p$,_gt:()=>n6,_float64:()=>i7,_float32:()=>n7,_file:()=>J5,_enum:()=>ay,_endsWith:()=>DI,_encodeAsync:()=>BX,_encode:()=>NX,_emoji:()=>hX,_email:()=>_X,_e164:()=>tX,_discriminatedUnion:()=>ny,_default:()=>wu,_decodeAsync:()=>HX,_decode:()=>JX,_date:()=>Q5,_custom:()=>B5,_cuid2:()=>uX,_cuid:()=>yX,_coercedString:()=>g7,_coercedNumber:()=>m7,_coercedDate:()=>G5,_coercedBoolean:()=>t7,_coercedBigint:()=>e7,_cidrv6:()=>oX,_cidrv4:()=>iX,_check:()=>xq,_catch:()=>Du,_boolean:()=>p7,_bigint:()=>a7,_base64url:()=>pX,_base64:()=>dX,_array:()=>N5,_any:()=>b5,TimePrecision:()=>h7,NEVER:()=>qG,JSONSchemaGenerator:()=>bJ,JSONSchema:()=>hq,Doc:()=>qX,$output:()=>T7,$input:()=>_7,$constructor:()=>z,$brand:()=>MG,$ZodXor:()=>ON,$ZodXID:()=>lY,$ZodVoid:()=>JN,$ZodUnknown:()=>YN,$ZodUnion:()=>eU,$ZodUndefined:()=>WN,$ZodUUID:()=>ZY,$ZodURL:()=>gY,$ZodULID:()=>uY,$ZodType:()=>o,$ZodTuple:()=>RX,$ZodTransform:()=>jN,$ZodTemplateLiteral:()=>xN,$ZodSymbol:()=>DN,$ZodSuccess:()=>TN,$ZodStringFormat:()=>J$,$ZodString:()=>D1,$ZodSet:()=>VN,$ZodRegistry:()=>Z7,$ZodRecord:()=>KN,$ZodRealError:()=>w6,$ZodReadonly:()=>gN,$ZodPromise:()=>fN,$ZodPrefault:()=>kN,$ZodPipe:()=>CN,$ZodOptional:()=>EN,$ZodObjectJIT:()=>AN,$ZodObject:()=>Tq,$ZodNumberFormat:()=>bN,$ZodNumber:()=>PX,$ZodNullable:()=>SN,$ZodNull:()=>QN,$ZodNonOptional:()=>RN,$ZodNever:()=>NN,$ZodNanoID:()=>hY,$ZodNaN:()=>ZN,$ZodMap:()=>vN,$ZodMAC:()=>pY,$ZodLiteral:()=>MN,$ZodLazy:()=>yN,$ZodKSUID:()=>cY,$ZodJWT:()=>UN,$ZodIntersection:()=>LN,$ZodISOTime:()=>nY,$ZodISODuration:()=>iY,$ZodISODateTime:()=>mY,$ZodISODate:()=>rY,$ZodIPv6:()=>dY,$ZodIPv4:()=>oY,$ZodGUID:()=>_Y,$ZodFunction:()=>hN,$ZodFile:()=>FN,$ZodError:()=>iU,$ZodEnum:()=>qN,$ZodEncodeError:()=>w1,$ZodEmoji:()=>xY,$ZodEmail:()=>CY,$ZodE164:()=>IN,$ZodDiscriminatedUnion:()=>zN,$ZodDefault:()=>PN,$ZodDate:()=>BN,$ZodCustomStringFormat:()=>wN,$ZodCustom:()=>uN,$ZodCodec:()=>sU,$ZodCheckUpperCase:()=>MY,$ZodCheckStringFormat:()=>s1,$ZodCheckStartsWith:()=>jY,$ZodCheckSizeEquals:()=>zY,$ZodCheckRegex:()=>VY,$ZodCheckProperty:()=>SY,$ZodCheckOverwrite:()=>kY,$ZodCheckNumberFormat:()=>BY,$ZodCheckMultipleOf:()=>JY,$ZodCheckMinSize:()=>OY,$ZodCheckMinLength:()=>KY,$ZodCheckMimeType:()=>PY,$ZodCheckMaxSize:()=>AY,$ZodCheckMaxLength:()=>LY,$ZodCheckLowerCase:()=>qY,$ZodCheckLessThan:()=>vX,$ZodCheckLengthEquals:()=>vY,$ZodCheckIncludes:()=>FY,$ZodCheckGreaterThan:()=>VX,$ZodCheckEndsWith:()=>EY,$ZodCheckBigIntFormat:()=>HY,$ZodCheck:()=>A$,$ZodCatch:()=>_N,$ZodCUID2:()=>yY,$ZodCUID:()=>fY,$ZodCIDRv6:()=>aY,$ZodCIDRv4:()=>tY,$ZodBoolean:()=>aU,$ZodBigIntFormat:()=>XN,$ZodBigInt:()=>kX,$ZodBase64URL:()=>$N,$ZodBase64:()=>sY,$ZodAsyncError:()=>m6,$ZodArray:()=>HN,$ZodAny:()=>GN});var qG=Object.freeze({status:"aborted"});function z($,I,U){function b(W,Q){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:Q,constr:D,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),I(W,Q);let G=D.prototype,Y=Object.keys(G);for(let J=0;J<Y.length;J++){let H=Y[J];if(!(H in W))W[H]=G[H].bind(W)}}let w=U?.Parent??Object;class X extends w{}Object.defineProperty(X,"name",{value:$});function D(W){var Q;let G=U?.Parent?new X:this;b(G,W),(Q=G._zod).deferred??(Q.deferred=[]);for(let Y of G._zod.deferred)Y();return G}return Object.defineProperty(D,"init",{value:b}),Object.defineProperty(D,Symbol.hasInstance,{value:(W)=>{if(U?.Parent&&W instanceof U.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(D,"name",{value:$}),D}var MG=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w1 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var yU={};function P$($){if($)Object.assign(yU,$);return yU}var E={};v6(E,{unwrapMessage:()=>uU,uint8ArrayToHex:()=>Xf,uint8ArrayToBase64url:()=>wf,uint8ArrayToBase64:()=>Dq,stringifyPrimitive:()=>j,slugify:()=>EG,shallowClone:()=>PG,safeExtend:()=>ah,required:()=>$f,randomString:()=>rh,propertyKeyTypes:()=>mU,promiseAllObject:()=>mh,primitiveTypes:()=>kG,prefixIssues:()=>G6,pick:()=>dh,partial:()=>sh,optionalKeys:()=>RG,omit:()=>ph,objectClone:()=>uh,numKeys:()=>nh,nullish:()=>k4,normalizeParams:()=>S,mergeDefs:()=>T4,merge:()=>eh,jsonStringifyReplacer:()=>i1,joinValues:()=>L,issue:()=>d1,isPlainObject:()=>_4,isObject:()=>b1,hexToUint8Array:()=>bf,getSizableOrigin:()=>rU,getParsedType:()=>ih,getLengthableOrigin:()=>nU,getEnumValues:()=>lU,getElementAtPath:()=>ch,floatSafeRemainder:()=>jG,finalizeIssue:()=>U6,extend:()=>th,escapeRegex:()=>L6,esc:()=>WX,defineLazy:()=>s,createTransparentProxy:()=>oh,cloneDef:()=>lh,clone:()=>o$,cleanRegex:()=>cU,cleanEnum:()=>If,captureStackTrace:()=>QX,cached:()=>o1,base64urlToUint8Array:()=>Uf,base64ToUint8Array:()=>Xq,assignProp:()=>R4,assertNotEqual:()=>xh,assertNever:()=>fh,assertIs:()=>hh,assertEqual:()=>gh,assert:()=>yh,allowsEval:()=>SG,aborted:()=>Z4,NUMBER_FORMAT_RANGES:()=>TG,Class:()=>Wq,BIGINT_FORMAT_RANGES:()=>_G});function gh($){return $}function xh($){return $}function hh($){}function fh($){throw new Error("Unexpected value in exhaustive check")}function yh($){}function lU($){let I=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,w])=>I.indexOf(+b)===-1).map(([b,w])=>w)}function L($,I="|"){return $.map((U)=>j(U)).join(I)}function i1($,I){if(typeof I==="bigint")return I.toString();return I}function o1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function k4($){return $===null||$===void 0}function cU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function jG($,I){let U=($.toString().split(".")[1]||"").length,b=I.toString(),w=(b.split(".")[1]||"").length;if(w===0&&/\d?e-\d?/.test(b)){let Q=b.match(/\d?e-(\d?)/);if(Q?.[1])w=Number.parseInt(Q[1])}let X=U>w?U:w,D=Number.parseInt($.toFixed(X).replace(".","")),W=Number.parseInt(I.toFixed(X).replace(".",""));return D%W/10**X}var bq=Symbol("evaluating");function s($,I,U){let b=void 0;Object.defineProperty($,I,{get(){if(b===bq)return;if(b===void 0)b=bq,b=U();return b},set(w){Object.defineProperty($,I,{value:w})},configurable:!0})}function uh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function T4(...$){let I={};for(let U of $){let b=Object.getOwnPropertyDescriptors(U);Object.assign(I,b)}return Object.defineProperties({},I)}function lh($){return T4($._zod.def)}function ch($,I){if(!I)return $;return I.reduce((U,b)=>U?.[b],$)}function mh($){let I=Object.keys($),U=I.map((b)=>$[b]);return Promise.all(U).then((b)=>{let w={};for(let X=0;X<I.length;X++)w[I[X]]=b[X];return w})}function rh($=10){let U="";for(let b=0;b<$;b++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function WX($){return JSON.stringify($)}function EG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var QX="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var SG=o1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _4($){if(b1($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(b1(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function PG($){if(_4($))return{...$};if(Array.isArray($))return[...$];return $}function nh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var ih=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},mU=new Set(["string","number","symbol"]),kG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function L6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let b=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)b._zod.parent=$;return b}function S($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function oh($){let I;return new Proxy({},{get(U,b,w){return I??(I=$()),Reflect.get(I,b,w)},set(U,b,w,X){return I??(I=$()),Reflect.set(I,b,w,X)},has(U,b){return I??(I=$()),Reflect.has(I,b)},deleteProperty(U,b){return I??(I=$()),Reflect.deleteProperty(I,b)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,b){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,b)},defineProperty(U,b,w){return I??(I=$()),Reflect.defineProperty(I,b,w)}})}function j($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function RG($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var TG={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_G={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function dh($,I){let U=$._zod.def,b=T4($._zod.def,{get shape(){let w={};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;w[X]=U.shape[X]}return R4(this,"shape",w),w},checks:[]});return o$($,b)}function ph($,I){let U=$._zod.def,b=T4($._zod.def,{get shape(){let w={...$._zod.def.shape};for(let X in I){if(!(X in U.shape))throw new Error(`Unrecognized key: "${X}"`);if(!I[X])continue;delete w[X]}return R4(this,"shape",w),w},checks:[]});return o$($,b)}function th($,I){if(!_4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let w=T4($._zod.def,{get shape(){let X={...$._zod.def.shape,...I};return R4(this,"shape",X),X},checks:[]});return o$($,w)}function ah($,I){if(!_4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let b={...$._zod.def.shape,...I};return R4(this,"shape",b),b},checks:$._zod.def.checks};return o$($,U)}function eh($,I){let U=T4($._zod.def,{get shape(){let b={...$._zod.def.shape,...I._zod.def.shape};return R4(this,"shape",b),b},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function sh($,I,U){let b=T4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in w))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=$?new $({type:"optional",innerType:w[D]}):w[D]}else for(let D in w)X[D]=$?new $({type:"optional",innerType:w[D]}):w[D];return R4(this,"shape",X),X},checks:[]});return o$(I,b)}function $f($,I,U){let b=T4(I._zod.def,{get shape(){let w=I._zod.def.shape,X={...w};if(U)for(let D in U){if(!(D in X))throw new Error(`Unrecognized key: "${D}"`);if(!U[D])continue;X[D]=new $({type:"nonoptional",innerType:w[D]})}else for(let D in w)X[D]=new $({type:"nonoptional",innerType:w[D]});return R4(this,"shape",X),X},checks:[]});return o$(I,b)}function Z4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function G6($,I){return I.map((U)=>{var b;return(b=U).path??(b.path=[]),U.path.unshift($),U})}function uU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let b={...$,path:$.path??[]};if(!$.message){let w=uU($.inst?._zod.def?.error?.($))??uU(I?.error?.($))??uU(U.customError?.($))??uU(U.localeError?.($))??"Invalid input";b.message=w}if(delete b.inst,delete b.continue,!I?.reportInput)delete b.input;return b}function rU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function d1(...$){let[I,U,b]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:b};return{...I}}function If($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function Xq($){let I=atob($),U=new Uint8Array(I.length);for(let b=0;b<I.length;b++)U[b]=I.charCodeAt(b);return U}function Dq($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function Uf($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return Xq(I+U)}function wf($){return Dq($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bf($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let b=0;b<I.length;b+=2)U[b/2]=Number.parseInt(I.slice(b,b+2),16);return U}function Xf($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class Wq{constructor(...$){}}var Qq=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,i1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},iU=z("$ZodError",Qq),w6=z("$ZodError",Qq,{Parent:Error});function oU($,I=(U)=>U.message){let U={},b=[];for(let w of $.issues)if(w.path.length>0)U[w.path[0]]=U[w.path[0]]||[],U[w.path[0]].push(I(w));else b.push(I(w));return{formErrors:b,fieldErrors:U}}function dU($,I=(U)=>U.message){let U={_errors:[]},b=(w)=>{for(let X of w.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((D)=>b({issues:D}));else if(X.code==="invalid_key")b({issues:X.issues});else if(X.code==="invalid_element")b({issues:X.issues});else if(X.path.length===0)U._errors.push(I(X));else{let D=U,W=0;while(W<X.path.length){let Q=X.path[W];if(W!==X.path.length-1)D[Q]=D[Q]||{_errors:[]};else D[Q]=D[Q]||{_errors:[]},D[Q]._errors.push(I(X));D=D[Q],W++}}};return b($),U}function ZG($,I=(U)=>U.message){let U={errors:[]},b=(w,X=[])=>{var D,W;for(let Q of w.issues)if(Q.code==="invalid_union"&&Q.errors.length)Q.errors.map((G)=>b({issues:G},Q.path));else if(Q.code==="invalid_key")b({issues:Q.issues},Q.path);else if(Q.code==="invalid_element")b({issues:Q.issues},Q.path);else{let G=[...X,...Q.path];if(G.length===0){U.errors.push(I(Q));continue}let Y=U,J=0;while(J<G.length){let H=G[J],B=J===G.length-1;if(typeof H==="string")Y.properties??(Y.properties={}),(D=Y.properties)[H]??(D[H]={errors:[]}),Y=Y.properties[H];else Y.items??(Y.items=[]),(W=Y.items)[H]??(W[H]={errors:[]}),Y=Y.items[H];if(B)Y.errors.push(I(Q));J++}}};return b($),U}function Gq($){let I=[],U=$.map((b)=>typeof b==="object"?b.key:b);for(let b of U)if(typeof b==="number")I.push(`[${b}]`);else if(typeof b==="symbol")I.push(`[${JSON.stringify(String(b))}]`);else if(/[^\w$]/.test(b))I.push(`[${JSON.stringify(b)}]`);else{if(I.length)I.push(".");I.push(b)}return I.join("")}function CG($){let I=[],U=[...$.issues].sort((b,w)=>(b.path??[]).length-(w.path??[]).length);for(let b of U)if(I.push(`✖ ${b.message}`),b.path?.length)I.push(` → at ${Gq(b.path)}`);return I.join(`
43
+ `)}var p1=($)=>(I,U,b,w)=>{let X=b?Object.assign(b,{async:!1}):{async:!1},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)throw new m6;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw QX(W,w?.callee),W}return D.value},GX=p1(w6),t1=($)=>async(I,U,b,w)=>{let X=b?Object.assign(b,{async:!0}):{async:!0},D=I._zod.run({value:U,issues:[]},X);if(D instanceof Promise)D=await D;if(D.issues.length){let W=new(w?.Err??$)(D.issues.map((Q)=>U6(Q,X,P$())));throw QX(W,w?.callee),W}return D.value},YX=t1(w6),a1=($)=>(I,U,b)=>{let w=b?{...b,async:!1}:{async:!1},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)throw new m6;return X.issues.length?{success:!1,error:new($??iU)(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},gG=a1(w6),e1=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{async:!0}):{async:!0},X=I._zod.run({value:U,issues:[]},w);if(X instanceof Promise)X=await X;return X.issues.length?{success:!1,error:new $(X.issues.map((D)=>U6(D,w,P$())))}:{success:!0,data:X.value}},xG=e1(w6),NX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return p1($)(I,U,w)},Wf=NX(w6),JX=($)=>(I,U,b)=>{return p1($)(I,U,b)},Qf=JX(w6),BX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return t1($)(I,U,w)},Gf=BX(w6),HX=($)=>async(I,U,b)=>{return t1($)(I,U,b)},Yf=HX(w6),AX=($)=>(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return a1($)(I,U,w)},Nf=AX(w6),OX=($)=>(I,U,b)=>{return a1($)(I,U,b)},Jf=OX(w6),zX=($)=>async(I,U,b)=>{let w=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return e1($)(I,U,w)},Bf=zX(w6),LX=($)=>async(I,U,b)=>{return e1($)(I,U,b)},Hf=LX(w6);var K6={};v6(K6,{xid:()=>uG,uuid7:()=>Lf,uuid6:()=>zf,uuid4:()=>Of,uuid:()=>X1,uppercase:()=>NY,unicodeEmail:()=>Yq,undefined:()=>GY,ulid:()=>yG,time:()=>IY,string:()=>wY,sha512_hex:()=>yf,sha512_base64url:()=>lf,sha512_base64:()=>uf,sha384_hex:()=>xf,sha384_base64url:()=>ff,sha384_base64:()=>hf,sha256_hex:()=>Zf,sha256_base64url:()=>gf,sha256_base64:()=>Cf,sha1_hex:()=>Rf,sha1_base64url:()=>_f,sha1_base64:()=>Tf,rfc5322Email:()=>vf,number:()=>DY,null:()=>QY,nanoid:()=>cG,md5_hex:()=>Sf,md5_base64url:()=>kf,md5_base64:()=>Pf,mac:()=>pG,lowercase:()=>YY,ksuid:()=>lG,ipv6:()=>dG,ipv4:()=>oG,integer:()=>XY,idnEmail:()=>Vf,html5Email:()=>Kf,hostname:()=>Ff,hex:()=>Ef,guid:()=>rG,extendedDuration:()=>Af,emoji:()=>iG,email:()=>nG,e164:()=>sG,duration:()=>mG,domain:()=>jf,datetime:()=>UY,date:()=>$Y,cuid2:()=>fG,cuid:()=>hG,cidrv6:()=>aG,cidrv4:()=>tG,browserEmail:()=>qf,boolean:()=>WY,bigint:()=>bY,base64url:()=>KX,base64:()=>eG});var hG=/^[cC][^\s-]{8,}$/,fG=/^[0-9a-z]+$/,yG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uG=/^[0-9a-vA-V]{20}$/,lG=/^[A-Za-z0-9]{27}$/,cG=/^[a-zA-Z0-9_-]{21}$/,mG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Af=/^[-+]?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)?)??$/,rG=/^([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})$/,X1=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Of=X1(4),zf=X1(6),Lf=X1(7),nG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kf=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,vf=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Yq=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Vf=Yq,qf=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iG(){return new RegExp(Mf,"u")}var oG=/^(?:(?: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])$/,dG=/^(([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}|:))$/,pG=($)=>{let I=L6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},tG=/^((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])$/,aG=/^(([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])$/,eG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,KX=/^[A-Za-z0-9_-]*$/,Ff=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,jf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,sG=/^\+(?:[0-9]){6,14}[0-9]$/,Nq="(?:(?:\\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])))",$Y=new RegExp(`^${Nq}$`);function Jq($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function IY($){return new RegExp(`^${Jq($)}$`)}function UY($){let I=Jq({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let b=`${I}(?:${U.join("|")})`;return new RegExp(`^${Nq}T(?:${b})$`)}var wY=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},bY=/^-?\d+n?$/,XY=/^-?\d+$/,DY=/^-?\d+(?:\.\d+)?/,WY=/^(?:true|false)$/i,QY=/^null$/i;var GY=/^undefined$/i;var YY=/^[^A-Z]*$/,NY=/^[^a-z]*$/,Ef=/^[0-9a-fA-F]*$/;function pU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function tU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Sf=/^[0-9a-fA-F]{32}$/,Pf=pU(22,"=="),kf=tU(22),Rf=/^[0-9a-fA-F]{40}$/,Tf=pU(27,"="),_f=tU(27),Zf=/^[0-9a-fA-F]{64}$/,Cf=pU(43,"="),gf=tU(43),xf=/^[0-9a-fA-F]{96}$/,hf=pU(64,""),ff=tU(64),yf=/^[0-9a-fA-F]{128}$/,uf=pU(86,"=="),lf=tU(86);var A$=z("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),Hq={number:"number",bigint:"bigint",object:"date"},vX=z("$ZodCheckLessThan",($,I)=>{A$.init($,I);let U=Hq[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.maximum:w.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<X)if(I.inclusive)w.maximum=I.value;else w.exclusiveMaximum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value<=I.value:b.value<I.value)return;b.issues.push({origin:U,code:"too_big",maximum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),VX=z("$ZodCheckGreaterThan",($,I)=>{A$.init($,I);let U=Hq[typeof I.value];$._zod.onattach.push((b)=>{let w=b._zod.bag,X=(I.inclusive?w.minimum:w.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>X)if(I.inclusive)w.minimum=I.value;else w.exclusiveMinimum=I.value}),$._zod.check=(b)=>{if(I.inclusive?b.value>=I.value:b.value>I.value)return;b.issues.push({origin:U,code:"too_small",minimum:I.value,input:b.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),JY=z("$ZodCheckMultipleOf",($,I)=>{A$.init($,I),$._zod.onattach.push((U)=>{var b;(b=U._zod.bag).multipleOf??(b.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):jG(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),BY=z("$ZodCheckNumberFormat",($,I)=>{A$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),b=U?"int":"number",[w,X]=TG[I.format];$._zod.onattach.push((D)=>{let W=D._zod.bag;if(W.format=I.format,W.minimum=w,W.maximum=X,U)W.pattern=XY}),$._zod.check=(D)=>{let W=D.value;if(U){if(!Number.isInteger(W)){D.issues.push({expected:b,format:I.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)D.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});else D.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!I.abort});return}}if(W<w)D.issues.push({origin:"number",input:W,code:"too_small",minimum:w,inclusive:!0,inst:$,continue:!I.abort});if(W>X)D.issues.push({origin:"number",input:W,code:"too_big",maximum:X,inst:$})}}),HY=z("$ZodCheckBigIntFormat",($,I)=>{A$.init($,I);let[U,b]=_G[I.format];$._zod.onattach.push((w)=>{let X=w._zod.bag;X.format=I.format,X.minimum=U,X.maximum=b}),$._zod.check=(w)=>{let X=w.value;if(X<U)w.issues.push({origin:"bigint",input:X,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(X>b)w.issues.push({origin:"bigint",input:X,code:"too_big",maximum:b,inst:$})}}),AY=z("$ZodCheckMaxSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.size<=I.maximum)return;b.issues.push({origin:rU(w),code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),OY=z("$ZodCheckMinSize",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.size>=I.minimum)return;b.issues.push({origin:rU(w),code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),zY=z("$ZodCheckSizeEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.size!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.size,w.maximum=I.size,w.size=I.size}),$._zod.check=(b)=>{let w=b.value,X=w.size;if(X===I.size)return;let D=X>I.size;b.issues.push({origin:rU(w),...D?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),LY=z("$ZodCheckMaxLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<w)b._zod.bag.maximum=I.maximum}),$._zod.check=(b)=>{let w=b.value;if(w.length<=I.maximum)return;let D=nU(w);b.issues.push({origin:D,code:"too_big",maximum:I.maximum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),KY=z("$ZodCheckMinLength",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>w)b._zod.bag.minimum=I.minimum}),$._zod.check=(b)=>{let w=b.value;if(w.length>=I.minimum)return;let D=nU(w);b.issues.push({origin:D,code:"too_small",minimum:I.minimum,inclusive:!0,input:w,inst:$,continue:!I.abort})}}),vY=z("$ZodCheckLengthEquals",($,I)=>{var U;A$.init($,I),(U=$._zod.def).when??(U.when=(b)=>{let w=b.value;return!k4(w)&&w.length!==void 0}),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.minimum=I.length,w.maximum=I.length,w.length=I.length}),$._zod.check=(b)=>{let w=b.value,X=w.length;if(X===I.length)return;let D=nU(w),W=X>I.length;b.issues.push({origin:D,...W?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!I.abort})}}),s1=z("$ZodCheckStringFormat",($,I)=>{var U,b;if(A$.init($,I),$._zod.onattach.push((w)=>{let X=w._zod.bag;if(X.format=I.format,I.pattern)X.patterns??(X.patterns=new Set),X.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(w)=>{if(I.pattern.lastIndex=0,I.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:I.format,input:w.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(b=$._zod).check??(b.check=()=>{})}),VY=z("$ZodCheckRegex",($,I)=>{s1.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),qY=z("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=YY),s1.init($,I)}),MY=z("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=NY),s1.init($,I)}),FY=z("$ZodCheckIncludes",($,I)=>{A$.init($,I);let U=L6(I.includes),b=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=b,$._zod.onattach.push((w)=>{let X=w._zod.bag;X.patterns??(X.patterns=new Set),X.patterns.add(b)}),$._zod.check=(w)=>{if(w.value.includes(I.includes,I.position))return;w.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:w.value,inst:$,continue:!I.abort})}}),jY=z("$ZodCheckStartsWith",($,I)=>{A$.init($,I);let U=new RegExp(`^${L6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.startsWith(I.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:b.value,inst:$,continue:!I.abort})}}),EY=z("$ZodCheckEndsWith",($,I)=>{A$.init($,I);let U=new RegExp(`.*${L6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(U)}),$._zod.check=(b)=>{if(b.value.endsWith(I.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:b.value,inst:$,continue:!I.abort})}});function Bq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues))}var SY=z("$ZodCheckProperty",($,I)=>{A$.init($,I),$._zod.check=(U)=>{let b=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(b instanceof Promise)return b.then((w)=>Bq(w,U,I.property));Bq(b,U,I.property);return}}),PY=z("$ZodCheckMimeType",($,I)=>{A$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((b)=>{b._zod.bag.mime=I.mime}),$._zod.check=(b)=>{if(U.has(b.value.type))return;b.issues.push({code:"invalid_value",values:I.mime,input:b.value.type,inst:$,continue:!I.abort})}}),kY=z("$ZodCheckOverwrite",($,I)=>{A$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class qX{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
44
44
  `).filter((X)=>X),b=Math.min(...U.map((X)=>X.length-X.trimStart().length)),w=U.map((X)=>X.slice(b)).map((X)=>" ".repeat(this.indent*2)+X);for(let X of w)this.content.push(X)}compile(){let $=Function,I=this?.args,b=[...(this?.content??[""]).map((w)=>` ${w}`)];return new $(...I,b.join(`
45
- `))}}var vN={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=vN;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(D,W,Q)=>{let G=_4(D),N;for(let B of W){if(B._zod.def.when){if(!B._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,J=B._zod.check(D);if(J instanceof Promise&&Q?.async===!1)throw new m6;if(N||J instanceof Promise)N=(N??Promise.resolve()).then(async()=>{if(await J,D.issues.length===H)return;if(!G)G=_4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=_4(D,H)}}if(N)return N.then(()=>{return D});return D},X=(D,W,Q)=>{if(_4(D))return D.aborted=!0,D;let G=w(W,b,Q);if(G instanceof Promise){if(Q.async===!1)throw new m6;return G.then((N)=>$._zod.parse(N,Q))}return $._zod.parse(G,Q)};$._zod.run=(D,W)=>{if(W.skipChecks)return $._zod.parse(D,W);if(W.direction==="backward"){let G=$._zod.parse({value:D.value,issues:[]},{...W,skipChecks:!0});if(G instanceof Promise)return G.then((N)=>{return X(N,D,W)});return X(G,D,W)}let Q=$._zod.parse(D,W);if(Q instanceof Promise){if(W.async===!1)throw new m6;return Q.then((G)=>w(G,b,W))}return w(Q,b,W)}}$["~standard"]={validate:(w)=>{try{let X=jG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return EG($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),D1=z("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??oG($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),B$=z("$ZodStringFormat",($,I)=>{a1.init($,I),D1.init($,I)}),qN=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=CG),B$.init($,I)}),FN=z("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=X1(b))}else I.pattern??(I.pattern=X1());B$.init($,I)}),MN=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=gG),B$.init($,I)}),jN=z("$ZodURL",($,I)=>{B$.init($,I),$._zod.check=(U)=>{try{let b=U.value.trim(),w=new URL(b);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=w.href;else U.value=b;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),EN=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=xG()),B$.init($,I)}),SN=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=_G),B$.init($,I)}),PN=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=SG),B$.init($,I)}),kN=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=PG),B$.init($,I)}),RN=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=kG),B$.init($,I)}),TN=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=RG),B$.init($,I)}),_N=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=TG),B$.init($,I)}),ZN=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=iG(I)),B$.init($,I)}),CN=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=rG),B$.init($,I)}),gN=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=nG(I)),B$.init($,I)}),xN=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=ZG),B$.init($,I)}),hN=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=hG),B$.init($,I),$._zod.bag.format="ipv4"}),fN=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=fG),B$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),yN=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=yG(I.delimiter)),B$.init($,I),$._zod.bag.format="mac"}),uN=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=uG),B$.init($,I)}),lN=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=lG),B$.init($,I),$._zod.check=(U)=>{let b=U.value.split("/");try{if(b.length!==2)throw new Error;let[w,X]=b;if(!X)throw new Error;let D=Number(X);if(`${D}`!==X)throw new Error;if(D<0||D>128)throw new Error;new URL(`http://[${w}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function cN($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mN=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=cG),B$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(cN(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Yq($){if(!BX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return cN(U)}var rN=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=BX),B$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Yq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=mG),B$.init($,I)});function Bq($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var iN=z("$ZodJWT",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(Bq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),oN=z("$ZodCustomStringFormat",($,I)=>{B$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),VX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??tG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),dN=z("$ZodNumberFormat",($,I)=>{wN.init($,I),VX.init($,I)}),tU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=aG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}}),qX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=dG,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(w){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),pN=z("$ZodBigIntFormat",($,I)=>{bN.init($,I),qX.init($,I)}),tN=z("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:w,inst:$}),U}}),aN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=sG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:w,inst:$}),U}}),eN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=eG,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}}),sN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),$Y=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),IY=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),UY=z("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:w,inst:$}),U}}),wY=z("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(W){}let w=U.value,X=w instanceof Date;if(X&&!Number.isNaN(w.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:w,...X?{received:"Invalid Date"}:{},inst:$}),U}});function $q($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var bY=z("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>$q(G,U,D)));else $q(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vX($,I,U,b){if($.issues.length)I.issues.push(...G6(U,$.issues));if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}function Jq($){let I=Object.keys($.shape);for(let b of I)if(!$.shape?.[b]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let U=vG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Hq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let N in I){if(W.has(N))continue;if(G==="never"){D.push(N);continue}let B=Q.run({value:I[N],issues:[]},b);if(B instanceof Promise)$.push(B.then((H)=>vX(H,U,N,I)));else vX(B,U,N,I)}if(D.length)U.issues.push({code:"unrecognized_keys",keys:D,input:I,inst:X});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var Aq=z("$ZodObject",($,I)=>{if(o.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let W=I.shape;Object.defineProperty(I,"shape",{get:()=>{let Q={...W};return Object.defineProperty(I,"shape",{value:Q}),Q}})}let b=n1(()=>Jq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let N=W[G]._zod;if(N.values){Q[G]??(Q[G]=new Set);for(let B of N.values)Q[G].add(B)}}return Q});let w=b1,X=I.catchall,D;$._zod.parse=(W,Q)=>{D??(D=b.value);let G=W.value;if(!w(G))return W.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),W;W.value={};let N=[],B=D.shape;for(let H of D.keys){let A=B[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)N.push(A.then((O)=>vX(O,W,H,G)));else vX(A,W,H,G)}if(!X)return N.length?Promise.all(N).then(()=>W):W;return Hq(N,G,W,Q,b.value,$)}}),XY=z("$ZodObjectJIT",($,I)=>{Aq.init($,I);let U=$._zod.parse,b=n1(()=>Jq(I)),w=(H)=>{let J=new AX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let x=$X(P);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};J.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;J.write("const newResult = {};");for(let P of A.keys){let x=V[P],l=$X(P);J.write(`const ${x} = ${O(P)};`),J.write(`
46
- if (${x}.issues.length) {
47
- payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
45
+ `))}}var RY={major:4,minor:2,patch:1};var o=z("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=RY;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let w of b)for(let X of w._zod.onattach)X($);if(b.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let w=(D,W,Q)=>{let G=Z4(D),Y;for(let J of W){if(J._zod.def.when){if(!J._zod.def.when(D))continue}else if(G)continue;let H=D.issues.length,B=J._zod.check(D);if(B instanceof Promise&&Q?.async===!1)throw new m6;if(Y||B instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await B,D.issues.length===H)return;if(!G)G=Z4(D,H)});else{if(D.issues.length===H)continue;if(!G)G=Z4(D,H)}}if(Y)return Y.then(()=>{return D});return D},X=(D,W,Q)=>{if(Z4(D))return D.aborted=!0,D;let G=w(W,b,Q);if(G instanceof Promise){if(Q.async===!1)throw new m6;return G.then((Y)=>$._zod.parse(Y,Q))}return $._zod.parse(G,Q)};$._zod.run=(D,W)=>{if(W.skipChecks)return $._zod.parse(D,W);if(W.direction==="backward"){let G=$._zod.parse({value:D.value,issues:[]},{...W,skipChecks:!0});if(G instanceof Promise)return G.then((Y)=>{return X(Y,D,W)});return X(G,D,W)}let Q=$._zod.parse(D,W);if(Q instanceof Promise){if(W.async===!1)throw new m6;return Q.then((G)=>w(G,b,W))}return w(Q,b,W)}}$["~standard"]={validate:(w)=>{try{let X=gG($,w);return X.success?{value:X.data}:{issues:X.error?.issues}}catch(X){return xG($,w).then((D)=>D.success?{value:D.data}:{issues:D.error?.issues})}},vendor:"zod",version:1}}),D1=z("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??wY($._zod.bag),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=String(U.value)}catch(w){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),J$=z("$ZodStringFormat",($,I)=>{s1.init($,I),D1.init($,I)}),_Y=z("$ZodGUID",($,I)=>{I.pattern??(I.pattern=rG),J$.init($,I)}),ZY=z("$ZodUUID",($,I)=>{if(I.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(b===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=X1(b))}else I.pattern??(I.pattern=X1());J$.init($,I)}),CY=z("$ZodEmail",($,I)=>{I.pattern??(I.pattern=nG),J$.init($,I)}),gY=z("$ZodURL",($,I)=>{J$.init($,I),$._zod.check=(U)=>{try{let b=U.value.trim(),w=new URL(b);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(w.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(w.protocol.endsWith(":")?w.protocol.slice(0,-1):w.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=w.href;else U.value=b;return}catch(b){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),xY=z("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=iG()),J$.init($,I)}),hY=z("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=cG),J$.init($,I)}),fY=z("$ZodCUID",($,I)=>{I.pattern??(I.pattern=hG),J$.init($,I)}),yY=z("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=fG),J$.init($,I)}),uY=z("$ZodULID",($,I)=>{I.pattern??(I.pattern=yG),J$.init($,I)}),lY=z("$ZodXID",($,I)=>{I.pattern??(I.pattern=uG),J$.init($,I)}),cY=z("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=lG),J$.init($,I)}),mY=z("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=UY(I)),J$.init($,I)}),rY=z("$ZodISODate",($,I)=>{I.pattern??(I.pattern=$Y),J$.init($,I)}),nY=z("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=IY(I)),J$.init($,I)}),iY=z("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=mG),J$.init($,I)}),oY=z("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=oG),J$.init($,I),$._zod.bag.format="ipv4"}),dY=z("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=dG),J$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),pY=z("$ZodMAC",($,I)=>{I.pattern??(I.pattern=pG(I.delimiter)),J$.init($,I),$._zod.bag.format="mac"}),tY=z("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=tG),J$.init($,I)}),aY=z("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=aG),J$.init($,I),$._zod.check=(U)=>{let b=U.value.split("/");try{if(b.length!==2)throw new Error;let[w,X]=b;if(!X)throw new Error;let D=Number(X);if(`${D}`!==X)throw new Error;if(D<0||D>128)throw new Error;new URL(`http://[${w}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function eY($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var sY=z("$ZodBase64",($,I)=>{I.pattern??(I.pattern=eG),J$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(eY(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function Sq($){if(!KX.test($))return!1;let I=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return eY(U)}var $N=z("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=KX),J$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(Sq(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),IN=z("$ZodE164",($,I)=>{I.pattern??(I.pattern=sG),J$.init($,I)});function Pq($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[b]=U;if(!b)return!1;let w=JSON.parse(atob(b));if("typ"in w&&w?.typ!=="JWT")return!1;if(!w.alg)return!1;if(I&&(!("alg"in w)||w.alg!==I))return!1;return!0}catch{return!1}}var UN=z("$ZodJWT",($,I)=>{J$.init($,I),$._zod.check=(U)=>{if(Pq(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),wN=z("$ZodCustomStringFormat",($,I)=>{J$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),PX=z("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??DY,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Number(U.value)}catch(D){}let w=U.value;if(typeof w==="number"&&!Number.isNaN(w)&&Number.isFinite(w))return U;let X=typeof w==="number"?Number.isNaN(w)?"NaN":!Number.isFinite(w)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:w,inst:$,...X?{received:X}:{}}),U}}),bN=z("$ZodNumberFormat",($,I)=>{BY.init($,I),PX.init($,I)}),aU=z("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=WY,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(X){}let w=U.value;if(typeof w==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:w,inst:$}),U}}),kX=z("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=bY,$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(w){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),XN=z("$ZodBigIntFormat",($,I)=>{HY.init($,I),kX.init($,I)}),DN=z("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:w,inst:$}),U}}),WN=z("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=GY,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:w,inst:$}),U}}),QN=z("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=QY,$._zod.values=new Set([null]),$._zod.parse=(U,b)=>{let w=U.value;if(w===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:w,inst:$}),U}}),GN=z("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),YN=z("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),NN=z("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),JN=z("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(typeof w==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:w,inst:$}),U}}),BN=z("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(W){}let w=U.value,X=w instanceof Date;if(X&&!Number.isNaN(w.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:w,...X?{received:"Invalid Date"}:{},inst:$}),U}});function Oq($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var HN=z("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!Array.isArray(w))return U.issues.push({expected:"array",code:"invalid_type",input:w,inst:$}),U;U.value=Array(w.length);let X=[];for(let D=0;D<w.length;D++){let W=w[D],Q=I.element._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)X.push(Q.then((G)=>Oq(G,U,D)));else Oq(Q,U,D)}if(X.length)return Promise.all(X).then(()=>U);return U}});function SX($,I,U,b){if($.issues.length)I.issues.push(...G6(U,$.issues));if($.value===void 0){if(U in b)I.value[U]=void 0}else I.value[U]=$.value}function kq($){let I=Object.keys($.shape);for(let b of I)if(!$.shape?.[b]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let U=RG($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Rq($,I,U,b,w,X){let D=[],W=w.keySet,Q=w.catchall._zod,G=Q.def.type;for(let Y in I){if(W.has(Y))continue;if(G==="never"){D.push(Y);continue}let J=Q.run({value:I[Y],issues:[]},b);if(J instanceof Promise)$.push(J.then((H)=>SX(H,U,Y,I)));else SX(J,U,Y,I)}if(D.length)U.issues.push({code:"unrecognized_keys",keys:D,input:I,inst:X});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var Tq=z("$ZodObject",($,I)=>{if(o.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let W=I.shape;Object.defineProperty(I,"shape",{get:()=>{let Q={...W};return Object.defineProperty(I,"shape",{value:Q}),Q}})}let b=o1(()=>kq(I));s($._zod,"propValues",()=>{let W=I.shape,Q={};for(let G in W){let Y=W[G]._zod;if(Y.values){Q[G]??(Q[G]=new Set);for(let J of Y.values)Q[G].add(J)}}return Q});let w=b1,X=I.catchall,D;$._zod.parse=(W,Q)=>{D??(D=b.value);let G=W.value;if(!w(G))return W.issues.push({expected:"object",code:"invalid_type",input:G,inst:$}),W;W.value={};let Y=[],J=D.shape;for(let H of D.keys){let A=J[H]._zod.run({value:G[H],issues:[]},Q);if(A instanceof Promise)Y.push(A.then((O)=>SX(O,W,H,G)));else SX(A,W,H,G)}if(!X)return Y.length?Promise.all(Y).then(()=>W):W;return Rq(Y,G,W,Q,b.value,$)}}),AN=z("$ZodObjectJIT",($,I)=>{Tq.init($,I);let U=$._zod.parse,b=o1(()=>kq(I)),w=(H)=>{let B=new qX(["shape","payload","ctx"]),A=b.value,O=(P)=>{let h=WX(P);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};B.write("const input = payload.value;");let V=Object.create(null),q=0;for(let P of A.keys)V[P]=`key_${q++}`;B.write("const newResult = {};");for(let P of A.keys){let h=V[P],l=WX(P);B.write(`const ${h} = ${O(P)};`),B.write(`
46
+ if (${h}.issues.length) {
47
+ payload.issues = payload.issues.concat(${h}.issues.map(iss => ({
48
48
  ...iss,
49
49
  path: iss.path ? [${l}, ...iss.path] : [${l}]
50
50
  })));
51
51
  }
52
52
 
53
53
 
54
- if (${x}.value === undefined) {
54
+ if (${h}.value === undefined) {
55
55
  if (${l} in input) {
56
56
  newResult[${l}] = undefined;
57
57
  }
58
58
  } else {
59
- newResult[${l}] = ${x}.value;
59
+ newResult[${l}] = ${h}.value;
60
60
  }
61
61
 
62
- `)}J.write("payload.value = newResult;"),J.write("return payload;");let k=J.compile();return(P,x)=>k(H,P,x)},X,D=b1,W=!fU.jitless,G=W&&zG.value,N=I.catchall,B;$._zod.parse=(H,J)=>{B??(B=b.value);let A=H.value;if(!D(A))return H.issues.push({expected:"object",code:"invalid_type",input:A,inst:$}),H;if(W&&G&&J?.async===!1&&J.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,J),!N)return H;return Hq([],A,H,J,B,$)}return U(H,J)}});function Iq($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!_4(X));if(w.length===1)return I.value=w[0].value,w[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))}),I}var aU=z("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((w)=>w._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((w)=>w._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((w)=>w._zod.values))return new Set(I.options.flatMap((w)=>Array.from(w._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((w)=>w._zod.pattern)){let w=I.options.map((X)=>X._zod.pattern);return new RegExp(`^(${w.map((X)=>lU(X.source)).join("|")})$`)}return});let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else{if(G.issues.length===0)return G;W.push(G)}}if(!D)return Iq(W,w,$,X);return Promise.all(W).then((Q)=>{return Iq(Q,w,$,X)})}});function Uq($,I,U,b){let w=$.filter((X)=>X.issues.length===0);if(w.length===1)return I.value=w[0].value,I;if(w.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var DY=z("$ZodXor",($,I)=>{aU.init($,I),I.inclusive=!1;let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else W.push(G)}if(!D)return Uq(W,w,$,X);return Promise.all(W).then((Q)=>{return Uq(Q,w,$,X)})}}),WY=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,aU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=n1(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues?.[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!b1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:D,path:[I.discriminator],inst:$}),w}}),QY=z("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return wq(U,Q,G)});return wq(U,X,D)}});function VN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(T4($)&&T4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=VN($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=VN(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function wq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(_4($))return $;let b=VN(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var FX=z("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(b,w)=>{let X=b.value;if(!Array.isArray(X))return b.issues.push({input:X,inst:$,expected:"tuple",code:"invalid_type"}),b;b.value=[];let D=[],W=[...U].reverse().findIndex((N)=>N._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let N=X.length>U.length,B=X.length<Q-1;if(N||B)return b.issues.push({...N?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let N of U){if(G++,G>=X.length){if(G>=Q)continue}let B=N._zod.run({value:X[G],issues:[]},w);if(B instanceof Promise)D.push(B.then((H)=>OX(H,b,G)));else OX(B,b,G)}if(I.rest){let N=X.slice(U.length);for(let B of N){G++;let H=I.rest._zod.run({value:B,issues:[]},w);if(H instanceof Promise)D.push(H.then((J)=>OX(J,b,G)));else OX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function OX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var GY=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!T4(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[],D=I.keyType._zod.values;if(D){U.value={};let W=new Set;for(let G of D)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){W.add(typeof G==="number"?G.toString():G);let N=I.valueType._zod.run({value:w[G],issues:[]},b);if(N instanceof Promise)X.push(N.then((B)=>{if(B.issues.length)U.issues.push(...G6(G,B.issues));U.value[G]=B.value}));else{if(N.issues.length)U.issues.push(...G6(G,N.issues));U.value[G]=N.value}}let Q;for(let G in w)if(!W.has(G))Q=Q??[],Q.push(G);if(Q&&Q.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:Q})}else{U.value={};for(let W of Reflect.ownKeys(w)){if(W==="__proto__")continue;let Q=I.keyType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(Q.issues.length){if(I.mode==="loose")U.value[W]=w[W];else U.issues.push({code:"invalid_key",origin:"record",issues:Q.issues.map((N)=>U6(N,b,P$())),input:W,path:[W],inst:$});continue}let G=I.valueType._zod.run({value:w[W],issues:[]},b);if(G instanceof Promise)X.push(G.then((N)=>{if(N.issues.length)U.issues.push(...G6(W,N.issues));U.value[Q.value]=N.value}));else{if(G.issues.length)U.issues.push(...G6(W,G.issues));U.value[Q.value]=G.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}}),NY=z("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:w,inst:$}),U;let X=[];U.value=new Map;for(let[D,W]of w){let Q=I.keyType._zod.run({value:D,issues:[]},b),G=I.valueType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise||G instanceof Promise)X.push(Promise.all([Q,G]).then(([N,B])=>{bq(N,B,U,D,w,$,b)}));else bq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function bq($,I,U,b,w,X,D){if($.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:w,inst:X,issues:$.issues.map((W)=>U6(W,D,P$()))});if(I.issues.length)if(cU.has(typeof b))U.issues.push(...G6(b,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:w,inst:X,key:b,issues:I.issues.map((W)=>U6(W,D,P$()))});U.value.set($.value,I.value)}var YY=z("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Set))return U.issues.push({input:w,inst:$,expected:"set",code:"invalid_type"}),U;let X=[];U.value=new Set;for(let D of w){let W=I.valueType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)X.push(W.then((Q)=>Xq(Q,U)));else Xq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Xq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var BY=z("$ZodEnum",($,I)=>{o.init($,I);let U=uU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>cU.has(typeof w)).map((w)=>typeof w==="string"?L6(w):w.toString()).join("|")})$`),$._zod.parse=(w,X)=>{let D=w.value;if(b.has(D))return w;return w.issues.push({code:"invalid_value",values:U,input:D,inst:$}),w}}),JY=z("$ZodLiteral",($,I)=>{if(o.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((b)=>typeof b==="string"?L6(b):b?L6(b.toString()):String(b)).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if(U.has(X))return b;return b.issues.push({code:"invalid_value",values:I.values,input:X,inst:$}),b}}),HY=z("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(w instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:w,inst:$}),U}}),AY=z("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new m6;return U.value=w,U}});function Dq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var OY=z("$ZodOptional",($,I)=>{o.init($,I),$._zod.optin="optional",$._zod.optout="optional",s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional"){let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Dq(X,U.value));return Dq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),zY=z("$ZodNullable",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${lU(U.source)}|null)$`):void 0}),s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),LY=z("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Wq(X,I));return Wq(w,I)}});function Wq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var KY=z("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),vY=z("$ZodNonOptional",($,I)=>{o.init($,I),s($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Qq(X,$));return Qq(w,$)}});function Qq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var VY=z("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1("ZodSuccess");let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{return U.value=X.issues.length===0,U});return U.value=w.issues.length===0,U}}),qY=z("$ZodCatch",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>U6(D,b,P$()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>U6(X,b,P$()))},input:U.value}),U.issues=[];return U}}),FY=z("$ZodNaN",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),MY=z("$ZodPipe",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if(b.direction==="backward"){let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>zX(D,I.in,b));return zX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>zX(X,I.out,b));return zX(w,I.out,b)}});function zX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var eU=z("$ZodCodec",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if((b.direction||"forward")==="forward"){let X=I.in._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>LX(D,I,b));return LX(X,I,b)}}});function LX($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let w=I.transform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.out,U));return KX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>KX($,X,I.in,U));return KX($,w,I.in,U)}}function KX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var jY=z("$ZodReadonly",($,I)=>{o.init($,I),s($._zod,"propValues",()=>I.innerType._zod.propValues),s($._zod,"values",()=>I.innerType._zod.values),s($._zod,"optin",()=>I.innerType?._zod?.optin),s($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(Gq);return Gq(w)}});function Gq($){return $.value=Object.freeze($.value),$}var EY=z("$ZodTemplateLiteral",($,I)=>{o.init($,I);let U=[];for(let b of I.parts)if(typeof b==="object"&&b!==null){if(!b._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...b._zod.traits].shift()}`);let w=b._zod.pattern instanceof RegExp?b._zod.pattern.source:b._zod.pattern;if(!w)throw new Error(`Invalid template literal part: ${b._zod.traits}`);let X=w.startsWith("^")?1:0,D=w.endsWith("$")?w.length-1:w.length;U.push(w.slice(X,D))}else if(b===null||KG.has(typeof b))U.push(L6(`${b}`));else throw new Error(`Invalid template literal part: ${b}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(b,w)=>{if(typeof b.value!=="string")return b.issues.push({input:b.value,inst:$,expected:"template_literal",code:"invalid_type"}),b;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(b.value))return b.issues.push({input:b.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),b;return b}}),SY=z("$ZodFunction",($,I)=>{return o.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...b){let w=$._def.input?UX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return UX($._def.output,X);return X}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...b){let w=$._def.input?await wX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await wX($._def.output,X);return X}},$._zod.parse=(U,b)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let b=$.constructor;if(Array.isArray(U[0]))return new b({type:"function",input:new FX({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new b({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),PY=z("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return Promise.resolve(U.value).then((w)=>I.innerType._zod.run({value:w,issues:[]},b))}}),kY=z("$ZodLazy",($,I)=>{o.init($,I),s($._zod,"innerType",()=>I.getter()),s($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,b)=>{return $._zod.innerType._zod.run(U,b)}}),RY=z("$ZodCustom",($,I)=>{A$.init($,I),o.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>Nq(X,U,b,$));Nq(w,U,b,$);return}});function Nq($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(i1(w))}}var b0={};v6(b0,{zhTW:()=>K7,zhCN:()=>L7,yo:()=>v7,vi:()=>z7,ur:()=>O7,uk:()=>w0,ua:()=>A7,tr:()=>H7,th:()=>J7,ta:()=>B7,sv:()=>Y7,sl:()=>N7,ru:()=>G7,pt:()=>Q7,ps:()=>D7,pl:()=>W7,ota:()=>X7,no:()=>b7,nl:()=>w7,ms:()=>U7,mk:()=>I7,lt:()=>$7,ko:()=>sY,km:()=>$0,kh:()=>eY,ka:()=>aY,ja:()=>tY,it:()=>pY,is:()=>dY,id:()=>oY,hu:()=>iY,he:()=>nY,frCA:()=>rY,fr:()=>mY,fi:()=>cY,fa:()=>lY,es:()=>uY,eo:()=>yY,en:()=>sU,de:()=>fY,da:()=>hY,cs:()=>xY,ca:()=>gY,bg:()=>CY,be:()=>ZY,az:()=>_Y,ar:()=>TY});var jf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(w)=>{switch(w.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${w.expected}، ولكن تم إدخال ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(w.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return` أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()} ${D.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()} ${D.unit}`;return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${w.prefix}"`;if(X.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${X.suffix}"`;if(X.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${X.includes}"`;if(X.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${X.pattern}`;return`${b[X.format]??w.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${w.divisor}`;case"unrecognized_keys":return`معرف${w.keys.length>1?"ات":""} غريب${w.keys.length>1?"ة":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${w.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${w.origin}`;default:return"مدخل غير مقبول"}}};function TY(){return{localeError:jf()}}var Ef=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${w.expected}, daxil olan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Yanlış dəyər: gözlənilən ${j(w.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Yanlış mətn: "${X.prefix}" ilə başlamalıdır`;if(X.format==="ends_with")return`Yanlış mətn: "${X.suffix}" ilə bitməlidir`;if(X.format==="includes")return`Yanlış mətn: "${X.includes}" daxil olmalıdır`;if(X.format==="regex")return`Yanlış mətn: ${X.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[X.format]??w.format}`}case"not_multiple_of":return`Yanlış ədəd: ${w.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${w.keys.length>1?"lar":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${w.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function _Y(){return{localeError:Ef()}}function Oq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Sf=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"лік";case"object":{if(Array.isArray(w))return"масіў";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(w)=>{switch(w.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${w.expected}, атрымана ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Няправільны ўвод: чакалася ${j(w.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Oq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна ${D.verb} ${X}${w.maximum.toString()} ${Q}`}return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна быць ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Oq(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта малы: чакалася, што ${w.origin} павінна ${D.verb} ${X}${w.minimum.toString()} ${Q}`}return`Занадта малы: чакалася, што ${w.origin} павінна быць ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${X.prefix}"`;if(X.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${X.suffix}"`;if(X.format==="includes")return`Няправільны радок: павінен змяшчаць "${X.includes}"`;if(X.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${X.pattern}`;return`Няправільны ${b[X.format]??w.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${w.keys.length>1?"ключы":"ключ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${w.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${w.origin}`;default:return"Няправільны ўвод"}}};function ZY(){return{localeError:Sf()}}var Pf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},kf=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(b){return $[b]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(b)=>{switch(b.code){case"invalid_type":return`Невалиден вход: очакван ${b.expected}, получен ${Pf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Невалиден вход: очакван ${j(b.values[0])}`;return`Невалидна опция: очаквано едно от ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Твърде голямо: очаква се ${b.origin??"стойност"} да съдържа ${w}${b.maximum.toString()} ${X.unit??"елемента"}`;return`Твърде голямо: очаква се ${b.origin??"стойност"} да бъде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Твърде малко: очаква се ${b.origin} да съдържа ${w}${b.minimum.toString()} ${X.unit}`;return`Твърде малко: очаква се ${b.origin} да бъде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Невалиден низ: трябва да започва с "${w.prefix}"`;if(w.format==="ends_with")return`Невалиден низ: трябва да завършва с "${w.suffix}"`;if(w.format==="includes")return`Невалиден низ: трябва да включва "${w.includes}"`;if(w.format==="regex")return`Невалиден низ: трябва да съвпада с ${w.pattern}`;let X="Невалиден";if(w.format==="emoji")X="Невалидно";if(w.format==="datetime")X="Невалидно";if(w.format==="date")X="Невалидна";if(w.format==="time")X="Невалидно";if(w.format==="duration")X="Невалидна";return`${X} ${U[w.format]??b.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${b.divisor}`;case"unrecognized_keys":return`Неразпознат${b.keys.length>1?"и":""} ключ${b.keys.length>1?"ове":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${b.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${b.origin}`;default:return"Невалиден вход"}}};function CY(){return{localeError:kf()}}var Rf=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(w)=>{switch(w.code){case"invalid_type":return`Tipus invàlid: s'esperava ${w.expected}, s'ha rebut ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Valor invàlid: s'esperava ${j(w.values[0])}`;return`Opció invàlida: s'esperava una de ${L(w.values," o ")}`;case"too_big":{let X=w.inclusive?"com a màxim":"menys de",D=I(w.origin);if(D)return`Massa gran: s'esperava que ${w.origin??"el valor"} contingués ${X} ${w.maximum.toString()} ${D.unit??"elements"}`;return`Massa gran: s'esperava que ${w.origin??"el valor"} fos ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"com a mínim":"més de",D=I(w.origin);if(D)return`Massa petit: s'esperava que ${w.origin} contingués ${X} ${w.minimum.toString()} ${D.unit}`;return`Massa petit: s'esperava que ${w.origin} fos ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Format invàlid: ha de començar amb "${X.prefix}"`;if(X.format==="ends_with")return`Format invàlid: ha d'acabar amb "${X.suffix}"`;if(X.format==="includes")return`Format invàlid: ha d'incloure "${X.includes}"`;if(X.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${X.pattern}`;return`Format invàlid per a ${b[X.format]??w.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${w.divisor}`;case"unrecognized_keys":return`Clau${w.keys.length>1?"s":""} no reconeguda${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${w.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${w.origin}`;default:return"Entrada invàlida"}}};function gY(){return{localeError:Rf()}}var Tf=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(w))return"pole";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(w)=>{switch(w.code){case"invalid_type":return`Neplatný vstup: očekáváno ${w.expected}, obdrženo ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neplatný vstup: očekáváno ${j(w.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí mít ${X}${w.maximum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí být ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí mít ${X}${w.minimum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí být ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neplatný řetězec: musí začínat na "${X.prefix}"`;if(X.format==="ends_with")return`Neplatný řetězec: musí končit na "${X.suffix}"`;if(X.format==="includes")return`Neplatný řetězec: musí obsahovat "${X.includes}"`;if(X.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${X.pattern}`;return`Neplatný formát ${b[X.format]??w.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${w.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${L(w.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${w.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${w.origin}`;default:return"Neplatný vstup"}}};function xY(){return{localeError:Tf()}}var _f=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"tal";case"object":{if(Array.isArray(D))return"liste";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name;return"objekt"}}return W},X={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Ugyldigt input: forventede ${b(D.expected)}, fik ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Ugyldig værdi: forventede ${j(D.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`For stor: forventede ${G??"value"} ${Q.verb} ${W} ${D.maximum.toString()} ${Q.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${W} ${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`For lille: forventede ${G} ${Q.verb} ${W} ${D.minimum.toString()} ${Q.unit}`;return`For lille: forventede ${G} havde ${W} ${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Ugyldig streng: skal starte med "${W.prefix}"`;if(W.format==="ends_with")return`Ugyldig streng: skal ende med "${W.suffix}"`;if(W.format==="includes")return`Ugyldig streng: skal indeholde "${W.includes}"`;if(W.format==="regex")return`Ugyldig streng: skal matche mønsteret ${W.pattern}`;return`Ugyldig ${X[W.format]??D.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${L(D.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${D.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${D.origin}`;default:return"Ugyldigt input"}}};function hY(){return{localeError:_f()}}var Zf=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"Zahl";case"object":{if(Array.isArray(w))return"Array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(w)=>{switch(w.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${w.expected}, erhalten ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ungültige Eingabe: erwartet ${j(w.values[0])}`;return`Ungültige Option: erwartet eine von ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ${D.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ist`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ${D.unit} hat`;return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ist`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ungültiger String: muss mit "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ungültiger String: muss mit "${X.suffix}" enden`;if(X.format==="includes")return`Ungültiger String: muss "${X.includes}" enthalten`;if(X.format==="regex")return`Ungültiger String: muss dem Muster ${X.pattern} entsprechen`;return`Ungültig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${w.divisor} sein`;case"unrecognized_keys":return`${w.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${w.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${w.origin}`;default:return"Ungültige Eingabe"}}};function fY(){return{localeError:Zf()}}var Cf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},gf=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${Cf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${j(b.values[0])}`;return`Invalid option: expected one of ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function sU(){return{localeError:gf()}}var xf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},hf=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(b){return $[b]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(b)=>{switch(b.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${b.expected}, riceviĝis ${xf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendiĝis ${j(b.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()} ${X.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Tro malgranda: atendiĝis ke ${b.origin} havu ${w}${b.minimum.toString()} ${X.unit}`;return`Tro malgranda: atendiĝis ke ${b.origin} estu ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${w.prefix}"`;if(w.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${w.suffix}"`;if(w.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${w.includes}"`;if(w.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${w.pattern}`;return`Nevalida ${U[w.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} ŝlosilo${b.keys.length>1?"j":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function yY(){return{localeError:hf()}}var ff=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"number";case"object":{if(Array.isArray(D))return"array";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype)return D.constructor.name;return"object"}}return W},X={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(D)=>{switch(D.code){case"invalid_type":return`Entrada inválida: se esperaba ${b(D.expected)}, recibido ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Entrada inválida: se esperaba ${j(D.values[0])}`;return`Opción inválida: se esperaba una de ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${W}${D.maximum.toString()} ${Q.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${W}${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado pequeño: se esperaba que ${G} tuviera ${W}${D.minimum.toString()} ${Q.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${W}${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Cadena inválida: debe comenzar con "${W.prefix}"`;if(W.format==="ends_with")return`Cadena inválida: debe terminar en "${W.suffix}"`;if(W.format==="includes")return`Cadena inválida: debe incluir "${W.includes}"`;if(W.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${W.pattern}`;return`Inválido ${X[W.format]??D.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${D.divisor}`;case"unrecognized_keys":return`Llave${D.keys.length>1?"s":""} desconocida${D.keys.length>1?"s":""}: ${L(D.keys,", ")}`;case"invalid_key":return`Llave inválida en ${b(D.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${b(D.origin)}`;default:return"Entrada inválida"}}};function uY(){return{localeError:ff()}}var yf=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"آرایه";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(w)=>{switch(w.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${w.expected} می‌بود، ${U(w.input)} دریافت شد`;case"invalid_value":if(w.values.length===1)return`ورودی نامعتبر: می‌بایست ${j(w.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${L(w.values,"|")} می‌بود`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} باشد`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} باشد`;return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} باشد`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`رشته نامعتبر: باید با "${X.prefix}" شروع شود`;if(X.format==="ends_with")return`رشته نامعتبر: باید با "${X.suffix}" تمام شود`;if(X.format==="includes")return`رشته نامعتبر: باید شامل "${X.includes}" باشد`;if(X.format==="regex")return`رشته نامعتبر: باید با الگوی ${X.pattern} مطابقت داشته باشد`;return`${b[X.format]??w.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${w.divisor} باشد`;case"unrecognized_keys":return`کلید${w.keys.length>1?"های":""} ناشناس: ${L(w.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${w.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${w.origin}`;default:return"ورودی نامعتبر"}}};function lY(){return{localeError:yf()}}var uf=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(w)=>{switch(w.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${w.expected}, oli ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Virheellinen syöte: täytyy olla ${j(w.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Liian suuri: ${D.subject} täytyy olla ${X}${w.maximum.toString()} ${D.unit}`.trim();return`Liian suuri: arvon täytyy olla ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Liian pieni: ${D.subject} täytyy olla ${X}${w.minimum.toString()} ${D.unit}`.trim();return`Liian pieni: arvon täytyy olla ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${X.prefix}"`;if(X.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${X.suffix}"`;if(X.format==="includes")return`Virheellinen syöte: täytyy sisältää "${X.includes}"`;if(X.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${X.pattern}`;return`Virheellinen ${b[X.format]??w.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${w.divisor} monikerta`;case"unrecognized_keys":return`${w.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(w.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function cY(){return{localeError:uf()}}var lf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombre";case"object":{if(Array.isArray(w))return"tableau";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : ${w.expected} attendu, ${U(w.input)} reçu`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : ${j(w.values[0])} attendu`;return`Option invalide : une valeur parmi ${L(w.values,"|")} attendue`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Trop grand : ${w.origin??"valeur"} doit ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"élément(s)"}`;return`Trop grand : ${w.origin??"valeur"} doit être ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Trop petit : ${w.origin} doit ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : ${w.origin} doit être ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function mY(){return{localeError:lf()}}var cf=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : attendu ${w.expected}, reçu ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : attendu ${j(w.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"≤":"<",D=I(w.origin);if(D)return`Trop grand : attendu que ${w.origin??"la valeur"} ait ${X}${w.maximum.toString()} ${D.unit}`;return`Trop grand : attendu que ${w.origin??"la valeur"} soit ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"≥":">",D=I(w.origin);if(D)return`Trop petit : attendu que ${w.origin} ait ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : attendu que ${w.origin} soit ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au motif ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function rY(){return{localeError:cf()}}var mf=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(G)=>G?$[G]:void 0,b=(G)=>{let N=U(G);if(N)return N.label;return G??$.unknown.label},w=(G)=>`ה${b(G)}`,X=(G)=>{return(U(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},D=(G)=>{if(!G)return null;return I[G]??null},W=(G)=>{let N=typeof G;switch(N){case"number":return Number.isNaN(G)?"NaN":"number";case"object":{if(Array.isArray(G))return"array";if(G===null)return"null";if(Object.getPrototypeOf(G)!==Object.prototype&&G.constructor)return G.constructor.name;return"object"}default:return N}},Q={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(G)=>{switch(G.code){case"invalid_type":{let N=G.expected,B=b(N),H=W(G.input),J=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${B}, התקבל ${J}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let N=G.values.map((J)=>j(J));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${N[0]} או ${N[1]}`;let B=N[N.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${N.slice(0,-1).join(", ")} או ${B}`}case"too_big":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.longLabel??"ארוך"} מדי: ${B} צריכה להכיל ${G.maximum.toString()} ${N?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${N?.unit??""} או פחות`:`פחות מ-${G.maximum} ${N?.unit??""}`;return`גדול מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",J=X(G.origin??"value");if(N?.unit)return`${N.longLabel} מדי: ${B} ${J} ${H}${G.maximum.toString()} ${N.unit}`;return`${N?.longLabel??"גדול"} מדי: ${B} ${J} ${H}${G.maximum.toString()}`}case"too_small":{let N=D(G.origin),B=w(G.origin??"value");if(G.origin==="string")return`${N?.shortLabel??"קצר"} מדי: ${B} צריכה להכיל ${G.minimum.toString()} ${N?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${B} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let V=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${B} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${N?.unit??""} או יותר`:`יותר מ-${G.minimum} ${N?.unit??""}`;return`קטן מדי: ${B} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",J=X(G.origin??"value");if(N?.unit)return`${N.shortLabel} מדי: ${B} ${J} ${H}${G.minimum.toString()} ${N.unit}`;return`${N?.shortLabel??"קטן"} מדי: ${B} ${J} ${H}${G.minimum.toString()}`}case"invalid_format":{let N=G;if(N.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${N.prefix}"`;if(N.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${N.suffix}"`;if(N.format==="includes")return`המחרוזת חייבת לכלול "${N.includes}"`;if(N.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${N.pattern}`;let B=Q[N.format],H=B?.label??N.format,A=(B?.gender??"m")==="f"?"תקינה":"תקין";return`${H} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${L(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${w(G.origin??"array")}`;default:return"קלט לא תקין"}}};function nY(){return{localeError:mf()}}var rf=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"szám";case"object":{if(Array.isArray(w))return"tömb";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(w)=>{switch(w.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${w.expected}, a kapott érték ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(w.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Túl nagy: ${w.origin??"érték"} mérete túl nagy ${X}${w.maximum.toString()} ${D.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${w.origin??"érték"} túl nagy: ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Túl kicsi: a bemeneti érték ${w.origin} mérete túl kicsi ${X}${w.minimum.toString()} ${D.unit}`;return`Túl kicsi: a bemeneti érték ${w.origin} túl kicsi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Érvénytelen string: "${X.prefix}" értékkel kell kezdődnie`;if(X.format==="ends_with")return`Érvénytelen string: "${X.suffix}" értékkel kell végződnie`;if(X.format==="includes")return`Érvénytelen string: "${X.includes}" értéket kell tartalmaznia`;if(X.format==="regex")return`Érvénytelen string: ${X.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[X.format]??w.format}`}case"not_multiple_of":return`Érvénytelen szám: ${w.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${w.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${w.origin}`;default:return"Érvénytelen bemenet"}}};function iY(){return{localeError:rf()}}var nf=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input tidak valid: diharapkan ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak valid: diharapkan ${j(w.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: diharapkan ${w.origin??"value"} memiliki ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: diharapkan ${w.origin??"value"} menjadi ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: diharapkan ${w.origin} memiliki ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: diharapkan ${w.origin} menjadi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak valid: harus dimulai dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak valid: harus berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak valid: harus menyertakan "${X.includes}"`;if(X.format==="regex")return`String tidak valid: harus sesuai pola ${X.pattern}`;return`${b[X.format]??w.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${w.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${w.origin}`;default:return"Input tidak valid"}}};function oY(){return{localeError:nf()}}var of=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},df=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(b){return $[b]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(b)=>{switch(b.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${of(b.input)} þar sem á að vera ${b.expected}`;case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(b.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} hafi ${w}${b.maximum.toString()} ${X.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} sé ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Of lítið: gert er ráð fyrir að ${b.origin} hafi ${w}${b.minimum.toString()} ${X.unit}`;return`Of lítið: gert er ráð fyrir að ${b.origin} sé ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ógildur strengur: verður að byrja á "${w.prefix}"`;if(w.format==="ends_with")return`Ógildur strengur: verður að enda á "${w.suffix}"`;if(w.format==="includes")return`Ógildur strengur: verður að innihalda "${w.includes}"`;if(w.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${w.pattern}`;return`Rangt ${U[w.format]??b.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`Óþekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${L(b.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${b.origin}`;default:return"Rangt gildi"}}};function dY(){return{localeError:df()}}var pf=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numero";case"object":{if(Array.isArray(w))return"vettore";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input non valido: atteso ${w.expected}, ricevuto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input non valido: atteso ${j(w.values[0])}`;return`Opzione non valida: atteso uno tra ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Troppo grande: ${w.origin??"valore"} deve avere ${X}${w.maximum.toString()} ${D.unit??"elementi"}`;return`Troppo grande: ${w.origin??"valore"} deve essere ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Troppo piccolo: ${w.origin} deve avere ${X}${w.minimum.toString()} ${D.unit}`;return`Troppo piccolo: ${w.origin} deve essere ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Stringa non valida: deve iniziare con "${X.prefix}"`;if(X.format==="ends_with")return`Stringa non valida: deve terminare con "${X.suffix}"`;if(X.format==="includes")return`Stringa non valida: deve includere "${X.includes}"`;if(X.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${w.divisor}`;case"unrecognized_keys":return`Chiav${w.keys.length>1?"i":"e"} non riconosciut${w.keys.length>1?"e":"a"}: ${L(w.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${w.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${w.origin}`;default:return"Input non valido"}}};function pY(){return{localeError:pf()}}var tf=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"数値";case"object":{if(Array.isArray(w))return"配列";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(w)=>{switch(w.code){case"invalid_type":return`無効な入力: ${w.expected}が期待されましたが、${U(w.input)}が入力されました`;case"invalid_value":if(w.values.length===1)return`無効な入力: ${j(w.values[0])}が期待されました`;return`無効な選択: ${L(w.values,"、")}のいずれかである必要があります`;case"too_big":{let X=w.inclusive?"以下である":"より小さい",D=I(w.origin);if(D)return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${D.unit??"要素"}${X}必要があります`;return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${X}必要があります`}case"too_small":{let X=w.inclusive?"以上である":"より大きい",D=I(w.origin);if(D)return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${D.unit}${X}必要があります`;return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${X}必要があります`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無効な文字列: "${X.prefix}"で始まる必要があります`;if(X.format==="ends_with")return`無効な文字列: "${X.suffix}"で終わる必要があります`;if(X.format==="includes")return`無効な文字列: "${X.includes}"を含む必要があります`;if(X.format==="regex")return`無効な文字列: パターン${X.pattern}に一致する必要があります`;return`無効な${b[X.format]??w.format}`}case"not_multiple_of":return`無効な数値: ${w.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${w.keys.length>1?"群":""}: ${L(w.keys,"、")}`;case"invalid_key":return`${w.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${w.origin}内の無効な値`;default:return"無効な入力"}}};function tY(){return{localeError:tf()}}var af=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},ef=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(b){return $[b]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(b)=>{switch(b.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${b.expected}, მიღებული ${af(b.input)}`;case"invalid_value":if(b.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(b.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${L(b.values,"|")}-დან`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} ${X.verb} ${w}${b.maximum.toString()} ${X.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} იყოს ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} ${X.verb} ${w}${b.minimum.toString()} ${X.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} იყოს ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${w.prefix}"-ით`;if(w.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${w.suffix}"-ით`;if(w.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${w.includes}"-ს`;if(w.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${w.pattern}`;return`არასწორი ${U[w.format]??b.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${b.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${b.keys.length>1?"ები":"ი"}: ${L(b.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${b.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${b.origin}-ში`;default:return"არასწორი შეყვანა"}}};function aY(){return{localeError:ef()}}var sf=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(w))return"អារេ (Array)";if(w===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(w)=>{switch(w.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w.expected} ប៉ុន្តែទទួលបាន ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(w.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()} ${D.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()} ${D.unit}`;return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${X.prefix}"`;if(X.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${X.suffix}"`;if(X.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${X.includes}"`;if(X.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${X.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[X.format]??w.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${w.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${L(w.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function $0(){return{localeError:sf()}}function eY(){return $0()}var $y=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(w)=>{switch(w.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${w.expected}, 받은 타입은 ${U(w.input)}입니다`;case"invalid_value":if(w.values.length===1)return`잘못된 입력: 값은 ${j(w.values[0])} 이어야 합니다`;return`잘못된 옵션: ${L(w.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let X=w.inclusive?"이하":"미만",D=X==="미만"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()} ${X}${D}`}case"too_small":{let X=w.inclusive?"이상":"초과",D=X==="이상"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()} ${X}${D}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`잘못된 문자열: "${X.prefix}"(으)로 시작해야 합니다`;if(X.format==="ends_with")return`잘못된 문자열: "${X.suffix}"(으)로 끝나야 합니다`;if(X.format==="includes")return`잘못된 문자열: "${X.includes}"을(를) 포함해야 합니다`;if(X.format==="regex")return`잘못된 문자열: 정규식 ${X.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[X.format]??w.format}`}case"not_multiple_of":return`잘못된 숫자: ${w.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${L(w.keys,", ")}`;case"invalid_key":return`잘못된 키: ${w.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${w.origin}`;default:return"잘못된 입력"}}};function sY(){return{localeError:$y()}}var Iy=($)=>{return U0(typeof $,$)},U0=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},I0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function zq($){let I=Math.abs($),U=I%10,b=I%100;if(b>=11&&b<=19||U===0)return"many";if(U===1)return"one";return"few"}var Uy=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(b,w,X,D){let W=$[b]??null;if(W===null)return W;return{unit:W.unit[w],verb:W.verb[D][X?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(b)=>{switch(b.code){case"invalid_type":return`Gautas tipas ${Iy(b.input)}, o tikėtasi - ${U0(b.expected)}`;case"invalid_value":if(b.values.length===1)return`Privalo būti ${j(b.values[0])}`;return`Privalo būti vienas iš ${L(b.values,"|")} pasirinkimų`;case"too_big":{let w=U0(b.origin),X=I(b.origin,zq(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=U0(b.origin),X=I(b.origin,zq(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${I0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${I0(w??b.origin??"reikšmė")} turi būti ${D} ${b.minimum.toString()} ${X?.unit}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Eilutė privalo prasidėti "${w.prefix}"`;if(w.format==="ends_with")return`Eilutė privalo pasibaigti "${w.suffix}"`;if(w.format==="includes")return`Eilutė privalo įtraukti "${w.includes}"`;if(w.format==="regex")return`Eilutė privalo atitikti ${w.pattern}`;return`Neteisingas ${U[w.format]??b.format}`}case"not_multiple_of":return`Skaičius privalo būti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${L(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=U0(b.origin);return`${I0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function $7(){return{localeError:Uy()}}var wy=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"број";case"object":{if(Array.isArray(w))return"низа";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(w)=>{switch(w.code){case"invalid_type":return`Грешен внес: се очекува ${w.expected}, примено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Invalid input: expected ${j(w.values[0])}`;return`Грешана опција: се очекува една ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Премногу голем: се очекува ${w.origin??"вредноста"} да има ${X}${w.maximum.toString()} ${D.unit??"елементи"}`;return`Премногу голем: се очекува ${w.origin??"вредноста"} да биде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Премногу мал: се очекува ${w.origin} да има ${X}${w.minimum.toString()} ${D.unit}`;return`Премногу мал: се очекува ${w.origin} да биде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неважечка низа: мора да започнува со "${X.prefix}"`;if(X.format==="ends_with")return`Неважечка низа: мора да завршува со "${X.suffix}"`;if(X.format==="includes")return`Неважечка низа: мора да вклучува "${X.includes}"`;if(X.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${L(w.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${w.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${w.origin}`;default:return"Грешен внес"}}};function I7(){return{localeError:wy()}}var by=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombor";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input tidak sah: dijangka ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak sah: dijangka ${j(w.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: dijangka ${w.origin??"nilai"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: dijangka ${w.origin??"nilai"} adalah ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: dijangka ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: dijangka ${w.origin} adalah ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak sah: mesti bermula dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak sah: mesti mengandungi "${X.includes}"`;if(X.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${X.pattern}`;return`${b[X.format]??w.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${w.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${w.origin}`;default:return"Input tidak sah"}}};function U7(){return{localeError:by()}}var Xy=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"getal";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(w)=>{switch(w.code){case"invalid_type":return`Ongeldige invoer: verwacht ${w.expected}, ontving ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ongeldige invoer: verwacht ${j(w.values[0])}`;return`Ongeldige optie: verwacht één van ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Te groot: verwacht dat ${w.origin??"waarde"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elementen"}`;return`Te groot: verwacht dat ${w.origin??"waarde"} ${X}${w.maximum.toString()} is`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Te klein: verwacht dat ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Te klein: verwacht dat ${w.origin} ${X}${w.minimum.toString()} is`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ongeldige tekst: moet met "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ongeldige tekst: moet op "${X.suffix}" eindigen`;if(X.format==="includes")return`Ongeldige tekst: moet "${X.includes}" bevatten`;if(X.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${X.pattern}`;return`Ongeldig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${w.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${w.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${w.origin}`;default:return"Ongeldige invoer"}}};function w7(){return{localeError:Xy()}}var Dy=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"tall";case"object":{if(Array.isArray(w))return"liste";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Ugyldig input: forventet ${w.expected}, fikk ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ugyldig verdi: forventet ${j(w.values[0])}`;return`Ugyldig valg: forventet en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()} ${D.unit??"elementer"}`;return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()} ${D.unit}`;return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ugyldig streng: må starte med "${X.prefix}"`;if(X.format==="ends_with")return`Ugyldig streng: må ende med "${X.suffix}"`;if(X.format==="includes")return`Ugyldig streng: må inneholde "${X.includes}"`;if(X.format==="regex")return`Ugyldig streng: må matche mønsteret ${X.pattern}`;return`Ugyldig ${b[X.format]??w.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${w.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${w.origin}`;default:return"Ugyldig input"}}};function b7(){return{localeError:Dy()}}var Wy=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numara";case"object":{if(Array.isArray(w))return"saf";if(w===null)return"gayb";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(w)=>{switch(w.code){case"invalid_type":return`Fâsit giren: umulan ${w.expected}, alınan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Fâsit giren: umulan ${j(w.values[0])}`;return`Fâsit tercih: mûteberler ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} ${D.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} olmalıydı.`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} ${D.unit} sahip olmalıydı.`;return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} olmalıydı.`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Fâsit metin: "${X.prefix}" ile başlamalı.`;if(X.format==="ends_with")return`Fâsit metin: "${X.suffix}" ile bitmeli.`;if(X.format==="includes")return`Fâsit metin: "${X.includes}" ihtivâ etmeli.`;if(X.format==="regex")return`Fâsit metin: ${X.pattern} nakşına uymalı.`;return`Fâsit ${b[X.format]??w.format}`}case"not_multiple_of":return`Fâsit sayı: ${w.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${w.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function X7(){return{localeError:Wy()}}var Qy=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"ارې";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(w)=>{switch(w.code){case"invalid_type":return`ناسم ورودي: باید ${w.expected} وای, مګر ${U(w.input)} ترلاسه شو`;case"invalid_value":if(w.values.length===1)return`ناسم ورودي: باید ${j(w.values[0])} وای`;return`ناسم انتخاب: باید یو له ${L(w.values,"|")} څخه وای`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} وي`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} ولري`;return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} وي`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ناسم متن: باید د "${X.prefix}" سره پیل شي`;if(X.format==="ends_with")return`ناسم متن: باید د "${X.suffix}" سره پای ته ورسيږي`;if(X.format==="includes")return`ناسم متن: باید "${X.includes}" ولري`;if(X.format==="regex")return`ناسم متن: باید د ${X.pattern} سره مطابقت ولري`;return`${b[X.format]??w.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${w.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${w.keys.length>1?"کلیډونه":"کلیډ"}: ${L(w.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${w.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${w.origin} کې`;default:return"ناسمه ورودي"}}};function D7(){return{localeError:Qy()}}var Gy=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"liczba";case"object":{if(Array.isArray(w))return"tablica";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(w)=>{switch(w.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${w.expected}, otrzymano ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(w.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Za duża wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.maximum.toString()} ${D.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Za mała wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.minimum.toString()} ${D.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${X.prefix}"`;if(X.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${X.suffix}"`;if(X.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${X.includes}"`;if(X.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${X.pattern}`;return`Nieprawidłow(y/a/e) ${b[X.format]??w.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${w.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${w.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${w.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function W7(){return{localeError:Gy()}}var Ny=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"número";case"object":{if(Array.isArray(w))return"array";if(w===null)return"nulo";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(w)=>{switch(w.code){case"invalid_type":return`Tipo inválido: esperado ${w.expected}, recebido ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrada inválida: esperado ${j(w.values[0])}`;return`Opção inválida: esperada uma das ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Muito grande: esperado que ${w.origin??"valor"} tivesse ${X}${w.maximum.toString()} ${D.unit??"elementos"}`;return`Muito grande: esperado que ${w.origin??"valor"} fosse ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Muito pequeno: esperado que ${w.origin} tivesse ${X}${w.minimum.toString()} ${D.unit}`;return`Muito pequeno: esperado que ${w.origin} fosse ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Texto inválido: deve começar com "${X.prefix}"`;if(X.format==="ends_with")return`Texto inválido: deve terminar com "${X.suffix}"`;if(X.format==="includes")return`Texto inválido: deve incluir "${X.includes}"`;if(X.format==="regex")return`Texto inválido: deve corresponder ao padrão ${X.pattern}`;return`${b[X.format]??w.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${w.divisor}`;case"unrecognized_keys":return`Chave${w.keys.length>1?"s":""} desconhecida${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Chave inválida em ${w.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${w.origin}`;default:return"Campo inválido"}}};function Q7(){return{localeError:Ny()}}function Lq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var Yy=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"массив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(w)=>{switch(w.code){case"invalid_type":return`Неверный ввод: ожидалось ${w.expected}, получено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неверный ввод: ожидалось ${j(w.values[0])}`;return`Неверный вариант: ожидалось одно из ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Lq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет иметь ${X}${w.maximum.toString()} ${Q}`}return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Lq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком маленькое значение: ожидалось, что ${w.origin} будет иметь ${X}${w.minimum.toString()} ${Q}`}return`Слишком маленькое значение: ожидалось, что ${w.origin} будет ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неверная строка: должна начинаться с "${X.prefix}"`;if(X.format==="ends_with")return`Неверная строка: должна заканчиваться на "${X.suffix}"`;if(X.format==="includes")return`Неверная строка: должна содержать "${X.includes}"`;if(X.format==="regex")return`Неверная строка: должна соответствовать шаблону ${X.pattern}`;return`Неверный ${b[X.format]??w.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспознанн${w.keys.length>1?"ые":"ый"} ключ${w.keys.length>1?"и":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${w.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${w.origin}`;default:return"Неверные входные данные"}}};function G7(){return{localeError:Yy()}}var By=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"število";case"object":{if(Array.isArray(w))return"tabela";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(w)=>{switch(w.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${w.expected}, prejeto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neveljaven vnos: pričakovano ${j(w.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} imelo ${X}${w.maximum.toString()} ${D.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Premajhno: pričakovano, da bo ${w.origin} imelo ${X}${w.minimum.toString()} ${D.unit}`;return`Premajhno: pričakovano, da bo ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neveljaven niz: mora se začeti z "${X.prefix}"`;if(X.format==="ends_with")return`Neveljaven niz: mora se končati z "${X.suffix}"`;if(X.format==="includes")return`Neveljaven niz: mora vsebovati "${X.includes}"`;if(X.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${X.pattern}`;return`Neveljaven ${b[X.format]??w.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${w.divisor}`;case"unrecognized_keys":return`Neprepoznan${w.keys.length>1?"i ključi":" ključ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${w.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${w.origin}`;default:return"Neveljaven vnos"}}};function N7(){return{localeError:By()}}var Jy=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"antal";case"object":{if(Array.isArray(w))return"lista";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(w)=>{switch(w.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${w.expected}, fick ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ogiltig inmatning: förväntat ${j(w.values[0])}`;return`Ogiltigt val: förväntade en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`För stor(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`För stor(t): förväntat ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()} ${D.unit}`;return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ogiltig sträng: måste börja med "${X.prefix}"`;if(X.format==="ends_with")return`Ogiltig sträng: måste sluta med "${X.suffix}"`;if(X.format==="includes")return`Ogiltig sträng: måste innehålla "${X.includes}"`;if(X.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${X.pattern}"`;return`Ogiltig(t) ${b[X.format]??w.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${w.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${w.origin??"värdet"}`;default:return"Ogiltig input"}}};function Y7(){return{localeError:Jy()}}var Hy=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(w))return"அணி";if(w===null)return"வெறுமை";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w.expected}, பெறப்பட்டது ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(w.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(w.values,"|")} இல் ஒன்று`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ${D.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ${D.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`தவறான சரம்: "${X.prefix}" இல் தொடங்க வேண்டும்`;if(X.format==="ends_with")return`தவறான சரம்: "${X.suffix}" இல் முடிவடைய வேண்டும்`;if(X.format==="includes")return`தவறான சரம்: "${X.includes}" ஐ உள்ளடக்க வேண்டும்`;if(X.format==="regex")return`தவறான சரம்: ${X.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[X.format]??w.format}`}case"not_multiple_of":return`தவறான எண்: ${w.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${w.keys.length>1?"கள்":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${w.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function B7(){return{localeError:Hy()}}var Ay=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(w))return"อาร์เรย์ (Array)";if(w===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(w)=>{switch(w.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w.expected} แต่ได้รับ ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(w.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"ไม่เกิน":"น้อยกว่า",D=I(w.origin);if(D)return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()} ${D.unit??"รายการ"}`;return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"อย่างน้อย":"มากกว่า",D=I(w.origin);if(D)return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()} ${D.unit}`;return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${X.prefix}"`;if(X.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${X.suffix}"`;if(X.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${X.includes}" อยู่ในข้อความ`;if(X.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${X.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[X.format]??w.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${w.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${L(w.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${w.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${w.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function J7(){return{localeError:Ay()}}var Oy=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},zy=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(b){return $[b]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(b)=>{switch(b.code){case"invalid_type":return`Geçersiz değer: beklenen ${b.expected}, alınan ${Oy(b.input)}`;case"invalid_value":if(b.values.length===1)return`Geçersiz değer: beklenen ${j(b.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()} ${X.unit??"öğe"}`;return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()} ${X.unit}`;return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Geçersiz metin: "${w.prefix}" ile başlamalı`;if(w.format==="ends_with")return`Geçersiz metin: "${w.suffix}" ile bitmeli`;if(w.format==="includes")return`Geçersiz metin: "${w.includes}" içermeli`;if(w.format==="regex")return`Geçersiz metin: ${w.pattern} desenine uymalı`;return`Geçersiz ${U[w.format]??b.format}`}case"not_multiple_of":return`Geçersiz sayı: ${b.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${b.keys.length>1?"lar":""}: ${L(b.keys,", ")}`;case"invalid_key":return`${b.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${b.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function H7(){return{localeError:zy()}}var Ly=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"масив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(w)=>{switch(w.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${w.expected}, отримано ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неправильні вхідні дані: очікується ${j(w.values[0])}`;return`Неправильна опція: очікується одне з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Занадто велике: очікується, що ${w.origin??"значення"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"елементів"}`;return`Занадто велике: очікується, що ${w.origin??"значення"} буде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Занадто мале: очікується, що ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Занадто мале: очікується, що ${w.origin} буде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неправильний рядок: повинен починатися з "${X.prefix}"`;if(X.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${X.suffix}"`;if(X.format==="includes")return`Неправильний рядок: повинен містити "${X.includes}"`;if(X.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${X.pattern}`;return`Неправильний ${b[X.format]??w.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${w.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${w.keys.length>1?"і":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${w.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${w.origin}`;default:return"Неправильні вхідні дані"}}};function w0(){return{localeError:Ly()}}function A7(){return w0()}var Ky=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"نمبر";case"object":{if(Array.isArray(w))return"آرے";if(w===null)return"نل";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(w)=>{switch(w.code){case"invalid_type":return`غلط ان پٹ: ${w.expected} متوقع تھا، ${U(w.input)} موصول ہوا`;case"invalid_value":if(w.values.length===1)return`غلط ان پٹ: ${j(w.values[0])} متوقع تھا`;return`غلط آپشن: ${L(w.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`بہت بڑا: ${w.origin??"ویلیو"} کے ${X}${w.maximum.toString()} ${D.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${w.origin??"ویلیو"} کا ${X}${w.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`بہت چھوٹا: ${w.origin} کے ${X}${w.minimum.toString()} ${D.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${w.origin} کا ${X}${w.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`غلط سٹرنگ: "${X.prefix}" سے شروع ہونا چاہیے`;if(X.format==="ends_with")return`غلط سٹرنگ: "${X.suffix}" پر ختم ہونا چاہیے`;if(X.format==="includes")return`غلط سٹرنگ: "${X.includes}" شامل ہونا چاہیے`;if(X.format==="regex")return`غلط سٹرنگ: پیٹرن ${X.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[X.format]??w.format}`}case"not_multiple_of":return`غلط نمبر: ${w.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${w.keys.length>1?"ز":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`${w.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${w.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function O7(){return{localeError:Ky()}}var vy=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"số";case"object":{if(Array.isArray(w))return"mảng";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(w)=>{switch(w.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${w.expected}, nhận được ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(w.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"phần tử"}`;return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Quá nhỏ: mong đợi ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Quá nhỏ: mong đợi ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${X.prefix}"`;if(X.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${X.suffix}"`;if(X.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${X.includes}"`;if(X.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${X.pattern}`;return`${b[X.format]??w.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${w.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${L(w.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${w.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${w.origin}`;default:return"Đầu vào không hợp lệ"}}};function z7(){return{localeError:vy()}}var Vy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(w))return"数组";if(w===null)return"空值(null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(w)=>{switch(w.code){case"invalid_type":return`无效输入:期望 ${w.expected},实际接收 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`无效输入:期望 ${j(w.values[0])}`;return`无效选项:期望以下之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()} ${D.unit??"个元素"}`;return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`无效字符串:必须以 "${X.prefix}" 开头`;if(X.format==="ends_with")return`无效字符串:必须以 "${X.suffix}" 结尾`;if(X.format==="includes")return`无效字符串:必须包含 "${X.includes}"`;if(X.format==="regex")return`无效字符串:必须满足正则表达式 ${X.pattern}`;return`无效${b[X.format]??w.format}`}case"not_multiple_of":return`无效数字:必须是 ${w.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${w.origin} 中包含无效值(value)`;default:return"无效输入"}}};function L7(){return{localeError:Vy()}}var qy=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(w)=>{switch(w.code){case"invalid_type":return`無效的輸入值:預期為 ${w.expected},但收到 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`無效的輸入值:預期為 ${j(w.values[0])}`;return`無效的選項:預期為以下其中之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()} ${D.unit??"個元素"}`;return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()} ${D.unit}`;return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無效的字串:必須以 "${X.prefix}" 開頭`;if(X.format==="ends_with")return`無效的字串:必須以 "${X.suffix}" 結尾`;if(X.format==="includes")return`無效的字串:必須包含 "${X.includes}"`;if(X.format==="regex")return`無效的字串:必須符合格式 ${X.pattern}`;return`無效的 ${b[X.format]??w.format}`}case"not_multiple_of":return`無效的數字:必須為 ${w.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${w.keys.length>1?"們":""}:${L(w.keys,"、")}`;case"invalid_key":return`${w.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${w.origin} 中有無效的值`;default:return"無效的輸入值"}}};function K7(){return{localeError:qy()}}var Fy=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(w))return"akopọ";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(w)=>{switch(w.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${w.expected}, àmọ̀ a rí ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(w.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${w.origin??"iye"} ${D.verb} ${X}${w.maximum} ${D.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${X}${w.maximum}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Kéré ju: a ní láti jẹ́ pé ${w.origin} ${D.verb} ${X}${w.minimum} ${D.unit}`;return`Kéré ju: a ní láti jẹ́ ${X}${w.minimum}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${X.prefix}"`;if(X.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${X.suffix}"`;if(X.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${X.includes}"`;if(X.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${X.pattern}`;return`Aṣìṣe: ${b[X.format]??w.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${w.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${L(w.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${w.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${w.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function v7(){return{localeError:Fy()}}var Kq,V7=Symbol("ZodOutput"),q7=Symbol("ZodInput");class F7{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let b={...U,...this._map.get($)};return Object.keys(b).length?b:void 0}return this._map.get($)}has($){return this._map.has($)}}function MX(){return new F7}(Kq=globalThis).__zod_globalRegistry??(Kq.__zod_globalRegistry=MX());var d$=globalThis.__zod_globalRegistry;function M7($,I){return new $({type:"string",...S(I)})}function j7($,I){return new $({type:"string",coerce:!0,...S(I)})}function jX($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function X0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function EX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function SX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function PX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function kX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function D0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function RX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function TX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function _X($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function gX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function xX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function E7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var S7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function P7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function k7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function R7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function T7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function _7($,I){return new $({type:"number",checks:[],...S(I)})}function Z7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function C7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function g7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function x7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function h7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function f7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function y7($,I){return new $({type:"boolean",...S(I)})}function u7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function l7($,I){return new $({type:"bigint",...S(I)})}function c7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function m7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function r7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function n7($,I){return new $({type:"symbol",...S(I)})}function i7($,I){return new $({type:"undefined",...S(I)})}function o7($,I){return new $({type:"null",...S(I)})}function d7($){return new $({type:"any"})}function p7($){return new $({type:"unknown"})}function t7($,I){return new $({type:"never",...S(I)})}function a7($,I){return new $({type:"void",...S(I)})}function e7($,I){return new $({type:"date",...S(I)})}function s7($,I){return new $({type:"date",coerce:!0,...S(I)})}function $5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!1})}function N6($,I){return new JX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new HX({check:"greater_than",...S(I),value:$,inclusive:!0})}function nX($){return n6(0,$)}function iX($){return r6(0,$)}function oX($){return N6(0,$)}function dX($){return p$(0,$)}function Z4($,I){return new UN({check:"multiple_of",...S(I),value:$})}function W1($,I){return new XN({check:"max_size",...S(I),maximum:$})}function C4($,I){return new DN({check:"min_size",...S(I),minimum:$})}function e1($,I){return new WN({check:"size_equals",...S(I),size:$})}function Q1($,I){return new QN({check:"max_length",...S(I),maximum:$})}function b4($,I){return new GN({check:"min_length",...S(I),minimum:$})}function G1($,I){return new NN({check:"length_equals",...S(I),length:$})}function s1($,I){return new YN({check:"string_format",format:"regex",...S(I),pattern:$})}function $I($){return new BN({check:"string_format",format:"lowercase",...S($)})}function II($){return new JN({check:"string_format",format:"uppercase",...S($)})}function UI($,I){return new HN({check:"string_format",format:"includes",...S(I),includes:$})}function wI($,I){return new AN({check:"string_format",format:"starts_with",...S(I),prefix:$})}function bI($,I){return new ON({check:"string_format",format:"ends_with",...S(I),suffix:$})}function pX($,I,U){return new zN({check:"property",property:$,schema:I,...S(U)})}function XI($,I){return new LN({check:"mime_type",mime:$,...S(I)})}function Z6($){return new KN({check:"overwrite",tx:$})}function DI($){return Z6((I)=>I.normalize($))}function WI(){return Z6(($)=>$.trim())}function QI(){return Z6(($)=>$.toLowerCase())}function GI(){return Z6(($)=>$.toUpperCase())}function NI(){return Z6(($)=>OG($))}function I5($,I,U){return new $({type:"array",element:I,...S(U)})}function jy($,I,U){return new $({type:"union",options:I,...S(U)})}function Ey($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function Sy($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function Py($,I,U){return new $({type:"intersection",left:I,right:U})}function ky($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function Ry($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function Ty($,I,U,b){return new $({type:"map",keyType:I,valueType:U,...S(b)})}function _y($,I,U){return new $({type:"set",valueType:I,...S(U)})}function Zy($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function Cy($,I,U){return new $({type:"enum",entries:I,...S(U)})}function gy($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function U5($,I){return new $({type:"file",...S(I)})}function xy($,I){return new $({type:"transform",transform:I})}function hy($,I){return new $({type:"optional",innerType:I})}function fy($,I){return new $({type:"nullable",innerType:I})}function yy($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():LG(U)}})}function uy($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function ly($,I){return new $({type:"success",innerType:I})}function cy($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function my($,I,U){return new $({type:"pipe",in:I,out:U})}function ry($,I){return new $({type:"readonly",innerType:I})}function ny($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function iy($,I){return new $({type:"lazy",getter:I})}function oy($,I){return new $({type:"promise",innerType:I})}function w5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function b5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function X5($){let I=vq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(i1(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(i1(w))}},$(U.value,U)});return I}function vq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function D5($){let I=new A$({check:"describe"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,description:$})}],I._zod.check=()=>{},I}function W5($){let I=new A$({check:"meta"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,...$})}],I._zod.check=()=>{},I}function Q5($,I){let U=S(I),b=U.truthy??["true","1","yes","on","y","enabled"],w=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")b=b.map((J)=>typeof J==="string"?J.toLowerCase():J),w=w.map((J)=>typeof J==="string"?J.toLowerCase():J);let X=new Set(b),D=new Set(w),W=$.Codec??eU,Q=$.Boolean??tU,N=new($.String??D1)({type:"string",error:U.error}),B=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:N,out:B,transform:(J,A)=>{let O=J;if(U.case!=="sensitive")O=O.toLowerCase();if(X.has(O))return!0;else if(D.has(O))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...X,...D],input:A.value,inst:H,continue:!1}),{}},reverseTransform:(J,A)=>{if(J===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function YI($,I,U,b={}){let w=S(b),X={...S(b),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(W)=>U.test(W),...w};if(U instanceof RegExp)X.pattern=U;return new $(X)}function g4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??d$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function G$($,I,U={path:[],schemaPath:[]}){var b;let w=$._zod.def,X=I.seen.get($);if(X){if(X.count++,U.schemaPath.includes($))X.cycle=U.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let N={...U,schemaPath:[...U.schemaPath,$],path:U.path},B=$._zod.parent;if(B)D.ref=B,G$(B,I,N),I.seen.get(B).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,N);else{let H=D.schema,J=I.processors[w.type];if(!J)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);J($,I,H,N)}}let Q=I.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(I.io==="input"&&t$($))delete D.schema.examples,delete D.schema.default;if(I.io==="input"&&D.schema._prefault)(b=D.schema).default??(b.default=D.schema._prefault);return delete D.schema._prefault,I.seen.get($).schema}function x4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(X)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let N=$.external.registry.get(X[0])?.id,B=$.external.uri??((J)=>J);if(N)return{ref:B(N)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${B("__shared")}#/${D}/${H}`}}if(X[1]===U)return{ref:"#"};let Q=`${"#"}/${D}/`,G=X[1].schema.id??`__schema${$.counter++}`;return{defId:G,ref:Q+G}},w=(X)=>{if(X[1].schema.$ref)return;let D=X[1],{ref:W,defId:Q}=b(X);if(D.def={...D.schema},Q)D.defId=Q;let G=D.schema;for(let N in G)delete G[N];G.$ref=W};if($.cycles==="throw")for(let X of $.seen.entries()){let D=X[1];if(D.cycle)throw new Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
62
+ `)}B.write("payload.value = newResult;"),B.write("return payload;");let k=B.compile();return(P,h)=>k(H,P,h)},X,D=b1,W=!yU.jitless,G=W&&SG.value,Y=I.catchall,J;$._zod.parse=(H,B)=>{J??(J=b.value);let A=H.value;if(!D(A))return H.issues.push({expected:"object",code:"invalid_type",input:A,inst:$}),H;if(W&&G&&B?.async===!1&&B.jitless!==!0){if(!X)X=w(I.shape);if(H=X(H,B),!Y)return H;return Rq([],A,H,B,J,$)}return U(H,B)}});function zq($,I,U,b){for(let X of $)if(X.issues.length===0)return I.value=X.value,I;let w=$.filter((X)=>!Z4(X));if(w.length===1)return I.value=w[0].value,w[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))}),I}var eU=z("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((w)=>w._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((w)=>w._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((w)=>w._zod.values))return new Set(I.options.flatMap((w)=>Array.from(w._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((w)=>w._zod.pattern)){let w=I.options.map((X)=>X._zod.pattern);return new RegExp(`^(${w.map((X)=>cU(X.source)).join("|")})$`)}return});let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else{if(G.issues.length===0)return G;W.push(G)}}if(!D)return zq(W,w,$,X);return Promise.all(W).then((Q)=>{return zq(Q,w,$,X)})}});function Lq($,I,U,b){let w=$.filter((X)=>X.issues.length===0);if(w.length===1)return I.value=w[0].value,I;if(w.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((X)=>X.issues.map((D)=>U6(D,b,P$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var ON=z("$ZodXor",($,I)=>{eU.init($,I),I.inclusive=!1;let U=I.options.length===1,b=I.options[0]._zod.run;$._zod.parse=(w,X)=>{if(U)return b(w,X);let D=!1,W=[];for(let Q of I.options){let G=Q._zod.run({value:w.value,issues:[]},X);if(G instanceof Promise)W.push(G),D=!0;else W.push(G)}if(!D)return Lq(W,w,$,X);return Promise.all(W).then((Q)=>{return Lq(Q,w,$,X)})}}),zN=z("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,eU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let w={};for(let X of I.options){let D=X._zod.propValues;if(!D||Object.keys(D).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(X)}"`);for(let[W,Q]of Object.entries(D)){if(!w[W])w[W]=new Set;for(let G of Q)w[W].add(G)}}return w});let b=o1(()=>{let w=I.options,X=new Map;for(let D of w){let W=D._zod.propValues?.[I.discriminator];if(!W||W.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(D)}"`);for(let Q of W){if(X.has(Q))throw new Error(`Duplicate discriminator value "${String(Q)}"`);X.set(Q,D)}}return X});$._zod.parse=(w,X)=>{let D=w.value;if(!b1(D))return w.issues.push({code:"invalid_type",expected:"object",input:D,inst:$}),w;let W=b.value.get(D?.[I.discriminator]);if(W)return W._zod.run(w,X);if(I.unionFallback)return U(w,X);return w.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:D,path:[I.discriminator],inst:$}),w}}),LN=z("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value,X=I.left._zod.run({value:w,issues:[]},b),D=I.right._zod.run({value:w,issues:[]},b);if(X instanceof Promise||D instanceof Promise)return Promise.all([X,D]).then(([Q,G])=>{return Kq(U,Q,G)});return Kq(U,X,D)}});function TY($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(_4($)&&_4(I)){let U=Object.keys(I),b=Object.keys($).filter((X)=>U.indexOf(X)!==-1),w={...$,...I};for(let X of b){let D=TY($[X],I[X]);if(!D.valid)return{valid:!1,mergeErrorPath:[X,...D.mergeErrorPath]};w[X]=D.data}return{valid:!0,data:w}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let b=0;b<$.length;b++){let w=$[b],X=I[b],D=TY(w,X);if(!D.valid)return{valid:!1,mergeErrorPath:[b,...D.mergeErrorPath]};U.push(D.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Kq($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(Z4($))return $;let b=TY(I.value,U.value);if(!b.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var RX=z("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(b,w)=>{let X=b.value;if(!Array.isArray(X))return b.issues.push({input:X,inst:$,expected:"tuple",code:"invalid_type"}),b;b.value=[];let D=[],W=[...U].reverse().findIndex((Y)=>Y._zod.optin!=="optional"),Q=W===-1?0:U.length-W;if(!I.rest){let Y=X.length>U.length,J=X.length<Q-1;if(Y||J)return b.issues.push({...Y?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:X,inst:$,origin:"array"}),b}let G=-1;for(let Y of U){if(G++,G>=X.length){if(G>=Q)continue}let J=Y._zod.run({value:X[G],issues:[]},w);if(J instanceof Promise)D.push(J.then((H)=>MX(H,b,G)));else MX(J,b,G)}if(I.rest){let Y=X.slice(U.length);for(let J of Y){G++;let H=I.rest._zod.run({value:J,issues:[]},w);if(H instanceof Promise)D.push(H.then((B)=>MX(B,b,G)));else MX(H,b,G)}}if(D.length)return Promise.all(D).then(()=>b);return b}});function MX($,I,U){if($.issues.length)I.issues.push(...G6(U,$.issues));I.value[U]=$.value}var KN=z("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!_4(w))return U.issues.push({expected:"record",code:"invalid_type",input:w,inst:$}),U;let X=[],D=I.keyType._zod.values;if(D){U.value={};let W=new Set;for(let G of D)if(typeof G==="string"||typeof G==="number"||typeof G==="symbol"){W.add(typeof G==="number"?G.toString():G);let Y=I.valueType._zod.run({value:w[G],issues:[]},b);if(Y instanceof Promise)X.push(Y.then((J)=>{if(J.issues.length)U.issues.push(...G6(G,J.issues));U.value[G]=J.value}));else{if(Y.issues.length)U.issues.push(...G6(G,Y.issues));U.value[G]=Y.value}}let Q;for(let G in w)if(!W.has(G))Q=Q??[],Q.push(G);if(Q&&Q.length>0)U.issues.push({code:"unrecognized_keys",input:w,inst:$,keys:Q})}else{U.value={};for(let W of Reflect.ownKeys(w)){if(W==="__proto__")continue;let Q=I.keyType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(Q.issues.length){if(I.mode==="loose")U.value[W]=w[W];else U.issues.push({code:"invalid_key",origin:"record",issues:Q.issues.map((Y)=>U6(Y,b,P$())),input:W,path:[W],inst:$});continue}let G=I.valueType._zod.run({value:w[W],issues:[]},b);if(G instanceof Promise)X.push(G.then((Y)=>{if(Y.issues.length)U.issues.push(...G6(W,Y.issues));U.value[Q.value]=Y.value}));else{if(G.issues.length)U.issues.push(...G6(W,G.issues));U.value[Q.value]=G.value}}}if(X.length)return Promise.all(X).then(()=>U);return U}}),vN=z("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:w,inst:$}),U;let X=[];U.value=new Map;for(let[D,W]of w){let Q=I.keyType._zod.run({value:D,issues:[]},b),G=I.valueType._zod.run({value:W,issues:[]},b);if(Q instanceof Promise||G instanceof Promise)X.push(Promise.all([Q,G]).then(([Y,J])=>{vq(Y,J,U,D,w,$,b)}));else vq(Q,G,U,D,w,$,b)}if(X.length)return Promise.all(X).then(()=>U);return U}});function vq($,I,U,b,w,X,D){if($.issues.length)if(mU.has(typeof b))U.issues.push(...G6(b,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:w,inst:X,issues:$.issues.map((W)=>U6(W,D,P$()))});if(I.issues.length)if(mU.has(typeof b))U.issues.push(...G6(b,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:w,inst:X,key:b,issues:I.issues.map((W)=>U6(W,D,P$()))});U.value.set($.value,I.value)}var VN=z("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(!(w instanceof Set))return U.issues.push({input:w,inst:$,expected:"set",code:"invalid_type"}),U;let X=[];U.value=new Set;for(let D of w){let W=I.valueType._zod.run({value:D,issues:[]},b);if(W instanceof Promise)X.push(W.then((Q)=>Vq(Q,U)));else Vq(W,U)}if(X.length)return Promise.all(X).then(()=>U);return U}});function Vq($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var qN=z("$ZodEnum",($,I)=>{o.init($,I);let U=lU(I.entries),b=new Set(U);$._zod.values=b,$._zod.pattern=new RegExp(`^(${U.filter((w)=>mU.has(typeof w)).map((w)=>typeof w==="string"?L6(w):w.toString()).join("|")})$`),$._zod.parse=(w,X)=>{let D=w.value;if(b.has(D))return w;return w.issues.push({code:"invalid_value",values:U,input:D,inst:$}),w}}),MN=z("$ZodLiteral",($,I)=>{if(o.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((b)=>typeof b==="string"?L6(b):b?L6(b.toString()):String(b)).join("|")})$`),$._zod.parse=(b,w)=>{let X=b.value;if(U.has(X))return b;return b.issues.push({code:"invalid_value",values:I.values,input:X,inst:$}),b}}),FN=z("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{let w=U.value;if(w instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:w,inst:$}),U}}),jN=z("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);let w=I.transform(U.value,U);if(b.async)return(w instanceof Promise?w:Promise.resolve(w)).then((D)=>{return U.value=D,U});if(w instanceof Promise)throw new m6;return U.value=w,U}});function qq($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var EN=z("$ZodOptional",($,I)=>{o.init($,I),$._zod.optin="optional",$._zod.optout="optional",s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${cU(U.source)})?$`):void 0}),$._zod.parse=(U,b)=>{if(I.innerType._zod.optin==="optional"){let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>qq(X,U.value));return qq(w,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,b)}}),SN=z("$ZodNullable",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${cU(U.source)}|null)$`):void 0}),s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,b)=>{if(U.value===null)return U;return I.innerType._zod.run(U,b)}}),PN=z("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)return U.value=I.defaultValue,U;let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Mq(X,I));return Mq(w,I)}});function Mq($,I){if($.value===void 0)$.value=I.defaultValue;return $}var kN=z("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,b)}}),RN=z("$ZodNonOptional",($,I)=>{o.init($,I),s($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(U,b)=>{let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>Fq(X,$));return Fq(w,$)}});function Fq($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var TN=z("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1("ZodSuccess");let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{return U.value=X.issues.length===0,U});return U.value=w.issues.length===0,U}}),_N=z("$ZodCatch",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>{if(U.value=X.value,X.issues.length)U.value=I.catchValue({...U,error:{issues:X.issues.map((D)=>U6(D,b,P$()))},input:U.value}),U.issues=[];return U});if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((X)=>U6(X,b,P$()))},input:U.value}),U.issues=[];return U}}),ZN=z("$ZodNaN",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),CN=z("$ZodPipe",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if(b.direction==="backward"){let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>FX(D,I.in,b));return FX(X,I.in,b)}let w=I.in._zod.run(U,b);if(w instanceof Promise)return w.then((X)=>FX(X,I.out,b));return FX(w,I.out,b)}});function FX($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var sU=z("$ZodCodec",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,b)=>{if((b.direction||"forward")==="forward"){let X=I.in._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>jX(D,I,b));return jX(X,I,b)}else{let X=I.out._zod.run(U,b);if(X instanceof Promise)return X.then((D)=>jX(D,I,b));return jX(X,I,b)}}});function jX($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let w=I.transform($.value,$);if(w instanceof Promise)return w.then((X)=>EX($,X,I.out,U));return EX($,w,I.out,U)}else{let w=I.reverseTransform($.value,$);if(w instanceof Promise)return w.then((X)=>EX($,X,I.in,U));return EX($,w,I.in,U)}}function EX($,I,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},b)}var gN=z("$ZodReadonly",($,I)=>{o.init($,I),s($._zod,"propValues",()=>I.innerType._zod.propValues),s($._zod,"values",()=>I.innerType._zod.values),s($._zod,"optin",()=>I.innerType?._zod?.optin),s($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,b)=>{if(b.direction==="backward")return I.innerType._zod.run(U,b);let w=I.innerType._zod.run(U,b);if(w instanceof Promise)return w.then(jq);return jq(w)}});function jq($){return $.value=Object.freeze($.value),$}var xN=z("$ZodTemplateLiteral",($,I)=>{o.init($,I);let U=[];for(let b of I.parts)if(typeof b==="object"&&b!==null){if(!b._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...b._zod.traits].shift()}`);let w=b._zod.pattern instanceof RegExp?b._zod.pattern.source:b._zod.pattern;if(!w)throw new Error(`Invalid template literal part: ${b._zod.traits}`);let X=w.startsWith("^")?1:0,D=w.endsWith("$")?w.length-1:w.length;U.push(w.slice(X,D))}else if(b===null||kG.has(typeof b))U.push(L6(`${b}`));else throw new Error(`Invalid template literal part: ${b}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(b,w)=>{if(typeof b.value!=="string")return b.issues.push({input:b.value,inst:$,expected:"template_literal",code:"invalid_type"}),b;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(b.value))return b.issues.push({input:b.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),b;return b}}),hN=z("$ZodFunction",($,I)=>{return o.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...b){let w=$._def.input?GX($._def.input,b):b,X=Reflect.apply(U,this,w);if($._def.output)return GX($._def.output,X);return X}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...b){let w=$._def.input?await YX($._def.input,b):b,X=await Reflect.apply(U,this,w);if($._def.output)return await YX($._def.output,X);return X}},$._zod.parse=(U,b)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let b=$.constructor;if(Array.isArray(U[0]))return new b({type:"function",input:new RX({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new b({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),fN=z("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,b)=>{return Promise.resolve(U.value).then((w)=>I.innerType._zod.run({value:w,issues:[]},b))}}),yN=z("$ZodLazy",($,I)=>{o.init($,I),s($._zod,"innerType",()=>I.getter()),s($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,b)=>{return $._zod.innerType._zod.run(U,b)}}),uN=z("$ZodCustom",($,I)=>{A$.init($,I),o.init($,I),$._zod.parse=(U,b)=>{return U},$._zod.check=(U)=>{let b=U.value,w=I.fn(b);if(w instanceof Promise)return w.then((X)=>Eq(X,U,b,$));Eq(w,U,b,$);return}});function Eq($,I,U,b){if(!$){let w={code:"custom",input:U,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)w.params=b._zod.def.params;I.issues.push(d1(w))}}var X0={};v6(X0,{zhTW:()=>k7,zhCN:()=>P7,yo:()=>R7,vi:()=>S7,ur:()=>E7,uk:()=>b0,ua:()=>j7,tr:()=>F7,th:()=>M7,ta:()=>q7,sv:()=>V7,sl:()=>v7,ru:()=>K7,pt:()=>L7,ps:()=>O7,pl:()=>z7,ota:()=>A7,no:()=>H7,nl:()=>B7,ms:()=>J7,mk:()=>N7,lt:()=>Y7,ko:()=>G7,km:()=>I0,kh:()=>Q7,ka:()=>W7,ja:()=>D7,it:()=>X7,is:()=>b7,id:()=>w7,hu:()=>U7,he:()=>I7,frCA:()=>$7,fr:()=>sN,fi:()=>eN,fa:()=>aN,es:()=>tN,eo:()=>pN,en:()=>$0,de:()=>dN,da:()=>oN,cs:()=>iN,ca:()=>nN,bg:()=>rN,be:()=>mN,az:()=>cN,ar:()=>lN});var mf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(w)=>{switch(w.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${w.expected}، ولكن تم إدخال ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(w.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return` أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()} ${D.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${w.origin??"القيمة"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()} ${D.unit}`;return`أصغر من اللازم: يفترض لـ ${w.origin} أن يكون ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${w.prefix}"`;if(X.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${X.suffix}"`;if(X.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${X.includes}"`;if(X.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${X.pattern}`;return`${b[X.format]??w.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${w.divisor}`;case"unrecognized_keys":return`معرف${w.keys.length>1?"ات":""} غريب${w.keys.length>1?"ة":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${w.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${w.origin}`;default:return"مدخل غير مقبول"}}};function lN(){return{localeError:mf()}}var rf=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${w.expected}, daxil olan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Yanlış dəyər: gözlənilən ${j(w.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`Çox böyük: gözlənilən ${w.origin??"dəyər"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`Çox kiçik: gözlənilən ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Yanlış mətn: "${X.prefix}" ilə başlamalıdır`;if(X.format==="ends_with")return`Yanlış mətn: "${X.suffix}" ilə bitməlidir`;if(X.format==="includes")return`Yanlış mətn: "${X.includes}" daxil olmalıdır`;if(X.format==="regex")return`Yanlış mətn: ${X.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[X.format]??w.format}`}case"not_multiple_of":return`Yanlış ədəd: ${w.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${w.keys.length>1?"lar":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${w.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function cN(){return{localeError:rf()}}function _q($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var nf=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"лік";case"object":{if(Array.isArray(w))return"масіў";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(w)=>{switch(w.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${w.expected}, атрымана ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Няправільны ўвод: чакалася ${j(w.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=_q(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна ${D.verb} ${X}${w.maximum.toString()} ${Q}`}return`Занадта вялікі: чакалася, што ${w.origin??"значэнне"} павінна быць ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=_q(W,D.unit.one,D.unit.few,D.unit.many);return`Занадта малы: чакалася, што ${w.origin} павінна ${D.verb} ${X}${w.minimum.toString()} ${Q}`}return`Занадта малы: чакалася, што ${w.origin} павінна быць ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${X.prefix}"`;if(X.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${X.suffix}"`;if(X.format==="includes")return`Няправільны радок: павінен змяшчаць "${X.includes}"`;if(X.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${X.pattern}`;return`Няправільны ${b[X.format]??w.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${w.keys.length>1?"ключы":"ключ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${w.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${w.origin}`;default:return"Няправільны ўвод"}}};function mN(){return{localeError:nf()}}var of=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},df=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(b){return $[b]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(b)=>{switch(b.code){case"invalid_type":return`Невалиден вход: очакван ${b.expected}, получен ${of(b.input)}`;case"invalid_value":if(b.values.length===1)return`Невалиден вход: очакван ${j(b.values[0])}`;return`Невалидна опция: очаквано едно от ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Твърде голямо: очаква се ${b.origin??"стойност"} да съдържа ${w}${b.maximum.toString()} ${X.unit??"елемента"}`;return`Твърде голямо: очаква се ${b.origin??"стойност"} да бъде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Твърде малко: очаква се ${b.origin} да съдържа ${w}${b.minimum.toString()} ${X.unit}`;return`Твърде малко: очаква се ${b.origin} да бъде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Невалиден низ: трябва да започва с "${w.prefix}"`;if(w.format==="ends_with")return`Невалиден низ: трябва да завършва с "${w.suffix}"`;if(w.format==="includes")return`Невалиден низ: трябва да включва "${w.includes}"`;if(w.format==="regex")return`Невалиден низ: трябва да съвпада с ${w.pattern}`;let X="Невалиден";if(w.format==="emoji")X="Невалидно";if(w.format==="datetime")X="Невалидно";if(w.format==="date")X="Невалидна";if(w.format==="time")X="Невалидно";if(w.format==="duration")X="Невалидна";return`${X} ${U[w.format]??b.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${b.divisor}`;case"unrecognized_keys":return`Неразпознат${b.keys.length>1?"и":""} ключ${b.keys.length>1?"ове":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${b.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${b.origin}`;default:return"Невалиден вход"}}};function rN(){return{localeError:df()}}var pf=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(w)=>{switch(w.code){case"invalid_type":return`Tipus invàlid: s'esperava ${w.expected}, s'ha rebut ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Valor invàlid: s'esperava ${j(w.values[0])}`;return`Opció invàlida: s'esperava una de ${L(w.values," o ")}`;case"too_big":{let X=w.inclusive?"com a màxim":"menys de",D=I(w.origin);if(D)return`Massa gran: s'esperava que ${w.origin??"el valor"} contingués ${X} ${w.maximum.toString()} ${D.unit??"elements"}`;return`Massa gran: s'esperava que ${w.origin??"el valor"} fos ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"com a mínim":"més de",D=I(w.origin);if(D)return`Massa petit: s'esperava que ${w.origin} contingués ${X} ${w.minimum.toString()} ${D.unit}`;return`Massa petit: s'esperava que ${w.origin} fos ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Format invàlid: ha de començar amb "${X.prefix}"`;if(X.format==="ends_with")return`Format invàlid: ha d'acabar amb "${X.suffix}"`;if(X.format==="includes")return`Format invàlid: ha d'incloure "${X.includes}"`;if(X.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${X.pattern}`;return`Format invàlid per a ${b[X.format]??w.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${w.divisor}`;case"unrecognized_keys":return`Clau${w.keys.length>1?"s":""} no reconeguda${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${w.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${w.origin}`;default:return"Entrada invàlida"}}};function nN(){return{localeError:pf()}}var tf=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(w))return"pole";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(w)=>{switch(w.code){case"invalid_type":return`Neplatný vstup: očekáváno ${w.expected}, obdrženo ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neplatný vstup: očekáváno ${j(w.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí mít ${X}${w.maximum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš velká: ${w.origin??"hodnota"} musí být ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí mít ${X}${w.minimum.toString()} ${D.unit??"prvků"}`;return`Hodnota je příliš malá: ${w.origin??"hodnota"} musí být ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neplatný řetězec: musí začínat na "${X.prefix}"`;if(X.format==="ends_with")return`Neplatný řetězec: musí končit na "${X.suffix}"`;if(X.format==="includes")return`Neplatný řetězec: musí obsahovat "${X.includes}"`;if(X.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${X.pattern}`;return`Neplatný formát ${b[X.format]??w.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${w.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${L(w.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${w.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${w.origin}`;default:return"Neplatný vstup"}}};function iN(){return{localeError:tf()}}var af=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"tal";case"object":{if(Array.isArray(D))return"liste";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype&&D.constructor)return D.constructor.name;return"objekt"}}return W},X={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Ugyldigt input: forventede ${b(D.expected)}, fik ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Ugyldig værdi: forventede ${j(D.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`For stor: forventede ${G??"value"} ${Q.verb} ${W} ${D.maximum.toString()} ${Q.unit??"elementer"}`;return`For stor: forventede ${G??"value"} havde ${W} ${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`For lille: forventede ${G} ${Q.verb} ${W} ${D.minimum.toString()} ${Q.unit}`;return`For lille: forventede ${G} havde ${W} ${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Ugyldig streng: skal starte med "${W.prefix}"`;if(W.format==="ends_with")return`Ugyldig streng: skal ende med "${W.suffix}"`;if(W.format==="includes")return`Ugyldig streng: skal indeholde "${W.includes}"`;if(W.format==="regex")return`Ugyldig streng: skal matche mønsteret ${W.pattern}`;return`Ugyldig ${X[W.format]??D.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${D.divisor}`;case"unrecognized_keys":return`${D.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${L(D.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${D.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${D.origin}`;default:return"Ugyldigt input"}}};function oN(){return{localeError:af()}}var ef=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"Zahl";case"object":{if(Array.isArray(w))return"Array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(w)=>{switch(w.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${w.expected}, erhalten ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ungültige Eingabe: erwartet ${j(w.values[0])}`;return`Ungültige Option: erwartet eine von ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ${D.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${w.origin??"Wert"} ${X}${w.maximum.toString()} ist`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ${D.unit} hat`;return`Zu klein: erwartet, dass ${w.origin} ${X}${w.minimum.toString()} ist`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ungültiger String: muss mit "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ungültiger String: muss mit "${X.suffix}" enden`;if(X.format==="includes")return`Ungültiger String: muss "${X.includes}" enthalten`;if(X.format==="regex")return`Ungültiger String: muss dem Muster ${X.pattern} entsprechen`;return`Ungültig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${w.divisor} sein`;case"unrecognized_keys":return`${w.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${w.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${w.origin}`;default:return"Ungültige Eingabe"}}};function dN(){return{localeError:ef()}}var sf=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},$y=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function I(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${sf(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${j(b.values[0])}`;return`Invalid option: expected one of ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Too big: expected ${b.origin??"value"} to have ${w}${b.maximum.toString()} ${X.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Too small: expected ${b.origin} to have ${w}${b.minimum.toString()} ${X.unit}`;return`Too small: expected ${b.origin} to be ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Invalid string: must start with "${w.prefix}"`;if(w.format==="ends_with")return`Invalid string: must end with "${w.suffix}"`;if(w.format==="includes")return`Invalid string: must include "${w.includes}"`;if(w.format==="regex")return`Invalid string: must match pattern ${w.pattern}`;return`Invalid ${U[w.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function $0(){return{localeError:$y()}}var Iy=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Uy=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(b){return $[b]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(b)=>{switch(b.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${b.expected}, riceviĝis ${Iy(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendiĝis ${j(b.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()} ${X.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Tro malgranda: atendiĝis ke ${b.origin} havu ${w}${b.minimum.toString()} ${X.unit}`;return`Tro malgranda: atendiĝis ke ${b.origin} estu ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${w.prefix}"`;if(w.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${w.suffix}"`;if(w.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${w.includes}"`;if(w.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${w.pattern}`;return`Nevalida ${U[w.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} ŝlosilo${b.keys.length>1?"j":""}: ${L(b.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function pN(){return{localeError:Uy()}}var wy=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(D){return $[D]??null}function b(D){return I[D]??D}let w=(D)=>{let W=typeof D;switch(W){case"number":return Number.isNaN(D)?"NaN":"number";case"object":{if(Array.isArray(D))return"array";if(D===null)return"null";if(Object.getPrototypeOf(D)!==Object.prototype)return D.constructor.name;return"object"}}return W},X={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(D)=>{switch(D.code){case"invalid_type":return`Entrada inválida: se esperaba ${b(D.expected)}, recibido ${b(w(D.input))}`;case"invalid_value":if(D.values.length===1)return`Entrada inválida: se esperaba ${j(D.values[0])}`;return`Opción inválida: se esperaba una de ${L(D.values,"|")}`;case"too_big":{let W=D.inclusive?"<=":"<",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado grande: se esperaba que ${G??"valor"} tuviera ${W}${D.maximum.toString()} ${Q.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${G??"valor"} fuera ${W}${D.maximum.toString()}`}case"too_small":{let W=D.inclusive?">=":">",Q=U(D.origin),G=b(D.origin);if(Q)return`Demasiado pequeño: se esperaba que ${G} tuviera ${W}${D.minimum.toString()} ${Q.unit}`;return`Demasiado pequeño: se esperaba que ${G} fuera ${W}${D.minimum.toString()}`}case"invalid_format":{let W=D;if(W.format==="starts_with")return`Cadena inválida: debe comenzar con "${W.prefix}"`;if(W.format==="ends_with")return`Cadena inválida: debe terminar en "${W.suffix}"`;if(W.format==="includes")return`Cadena inválida: debe incluir "${W.includes}"`;if(W.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${W.pattern}`;return`Inválido ${X[W.format]??D.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${D.divisor}`;case"unrecognized_keys":return`Llave${D.keys.length>1?"s":""} desconocida${D.keys.length>1?"s":""}: ${L(D.keys,", ")}`;case"invalid_key":return`Llave inválida en ${b(D.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${b(D.origin)}`;default:return"Entrada inválida"}}};function tN(){return{localeError:wy()}}var by=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"آرایه";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(w)=>{switch(w.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${w.expected} می‌بود، ${U(w.input)} دریافت شد`;case"invalid_value":if(w.values.length===1)return`ورودی نامعتبر: می‌بایست ${j(w.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${L(w.values,"|")} می‌بود`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${w.origin??"مقدار"} باید ${X}${w.maximum.toString()} باشد`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} باشد`;return`خیلی کوچک: ${w.origin} باید ${X}${w.minimum.toString()} باشد`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`رشته نامعتبر: باید با "${X.prefix}" شروع شود`;if(X.format==="ends_with")return`رشته نامعتبر: باید با "${X.suffix}" تمام شود`;if(X.format==="includes")return`رشته نامعتبر: باید شامل "${X.includes}" باشد`;if(X.format==="regex")return`رشته نامعتبر: باید با الگوی ${X.pattern} مطابقت داشته باشد`;return`${b[X.format]??w.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${w.divisor} باشد`;case"unrecognized_keys":return`کلید${w.keys.length>1?"های":""} ناشناس: ${L(w.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${w.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${w.origin}`;default:return"ورودی نامعتبر"}}};function aN(){return{localeError:by()}}var Xy=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(w)=>{switch(w.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${w.expected}, oli ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Virheellinen syöte: täytyy olla ${j(w.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Liian suuri: ${D.subject} täytyy olla ${X}${w.maximum.toString()} ${D.unit}`.trim();return`Liian suuri: arvon täytyy olla ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Liian pieni: ${D.subject} täytyy olla ${X}${w.minimum.toString()} ${D.unit}`.trim();return`Liian pieni: arvon täytyy olla ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${X.prefix}"`;if(X.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${X.suffix}"`;if(X.format==="includes")return`Virheellinen syöte: täytyy sisältää "${X.includes}"`;if(X.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${X.pattern}`;return`Virheellinen ${b[X.format]??w.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${w.divisor} monikerta`;case"unrecognized_keys":return`${w.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(w.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function eN(){return{localeError:Xy()}}var Dy=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombre";case"object":{if(Array.isArray(w))return"tableau";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : ${w.expected} attendu, ${U(w.input)} reçu`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : ${j(w.values[0])} attendu`;return`Option invalide : une valeur parmi ${L(w.values,"|")} attendue`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Trop grand : ${w.origin??"valeur"} doit ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"élément(s)"}`;return`Trop grand : ${w.origin??"valeur"} doit être ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Trop petit : ${w.origin} doit ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : ${w.origin} doit être ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function sN(){return{localeError:Dy()}}var Wy=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(w)=>{switch(w.code){case"invalid_type":return`Entrée invalide : attendu ${w.expected}, reçu ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrée invalide : attendu ${j(w.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"≤":"<",D=I(w.origin);if(D)return`Trop grand : attendu que ${w.origin??"la valeur"} ait ${X}${w.maximum.toString()} ${D.unit}`;return`Trop grand : attendu que ${w.origin??"la valeur"} soit ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"≥":">",D=I(w.origin);if(D)return`Trop petit : attendu que ${w.origin} ait ${X}${w.minimum.toString()} ${D.unit}`;return`Trop petit : attendu que ${w.origin} soit ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chaîne invalide : doit commencer par "${X.prefix}"`;if(X.format==="ends_with")return`Chaîne invalide : doit se terminer par "${X.suffix}"`;if(X.format==="includes")return`Chaîne invalide : doit inclure "${X.includes}"`;if(X.format==="regex")return`Chaîne invalide : doit correspondre au motif ${X.pattern}`;return`${b[X.format]??w.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${w.divisor}`;case"unrecognized_keys":return`Clé${w.keys.length>1?"s":""} non reconnue${w.keys.length>1?"s":""} : ${L(w.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${w.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${w.origin}`;default:return"Entrée invalide"}}};function $7(){return{localeError:Wy()}}var Qy=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(G)=>G?$[G]:void 0,b=(G)=>{let Y=U(G);if(Y)return Y.label;return G??$.unknown.label},w=(G)=>`ה${b(G)}`,X=(G)=>{return(U(G)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},D=(G)=>{if(!G)return null;return I[G]??null},W=(G)=>{let Y=typeof G;switch(Y){case"number":return Number.isNaN(G)?"NaN":"number";case"object":{if(Array.isArray(G))return"array";if(G===null)return"null";if(Object.getPrototypeOf(G)!==Object.prototype&&G.constructor)return G.constructor.name;return"object"}default:return Y}},Q={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(G)=>{switch(G.code){case"invalid_type":{let Y=G.expected,J=b(Y),H=W(G.input),B=$[H]?.label??H;return`קלט לא תקין: צריך להיות ${J}, התקבל ${B}`}case"invalid_value":{if(G.values.length===1)return`ערך לא תקין: הערך חייב להיות ${j(G.values[0])}`;let Y=G.values.map((B)=>j(B));if(G.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let J=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${J}`}case"too_big":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${J} צריכה להכיל ${G.maximum.toString()} ${Y?.unit??""} ${G.inclusive?"או פחות":"לכל היותר"}`.trim();if(G.origin==="number"){let A=G.inclusive?`קטן או שווה ל-${G.maximum}`:`קטן מ-${G.maximum}`;return`גדול מדי: ${J} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך",O=G.inclusive?`${G.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${G.maximum} ${Y?.unit??""}`;return`גדול מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?"<=":"<",B=X(G.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${J} ${B} ${H}${G.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${J} ${B} ${H}${G.maximum.toString()}`}case"too_small":{let Y=D(G.origin),J=w(G.origin??"value");if(G.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${J} צריכה להכיל ${G.minimum.toString()} ${Y?.unit??""} ${G.inclusive?"או יותר":"לפחות"}`.trim();if(G.origin==="number"){let A=G.inclusive?`גדול או שווה ל-${G.minimum}`:`גדול מ-${G.minimum}`;return`קטן מדי: ${J} צריך להיות ${A}`}if(G.origin==="array"||G.origin==="set"){let A=G.origin==="set"?"צריכה":"צריך";if(G.minimum===1&&G.inclusive){let V=G.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${J} ${A} להכיל ${V}`}let O=G.inclusive?`${G.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${G.minimum} ${Y?.unit??""}`;return`קטן מדי: ${J} ${A} להכיל ${O}`.trim()}let H=G.inclusive?">=":">",B=X(G.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${J} ${B} ${H}${G.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${J} ${B} ${H}${G.minimum.toString()}`}case"invalid_format":{let Y=G;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let J=Q[Y.format],H=J?.label??Y.format,A=(J?.gender??"m")==="f"?"תקינה":"תקין";return`${H} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${G.divisor}`;case"unrecognized_keys":return`מפתח${G.keys.length>1?"ות":""} לא מזוה${G.keys.length>1?"ים":"ה"}: ${L(G.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${w(G.origin??"array")}`;default:return"קלט לא תקין"}}};function I7(){return{localeError:Qy()}}var Gy=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"szám";case"object":{if(Array.isArray(w))return"tömb";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(w)=>{switch(w.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${w.expected}, a kapott érték ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(w.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Túl nagy: ${w.origin??"érték"} mérete túl nagy ${X}${w.maximum.toString()} ${D.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${w.origin??"érték"} túl nagy: ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Túl kicsi: a bemeneti érték ${w.origin} mérete túl kicsi ${X}${w.minimum.toString()} ${D.unit}`;return`Túl kicsi: a bemeneti érték ${w.origin} túl kicsi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Érvénytelen string: "${X.prefix}" értékkel kell kezdődnie`;if(X.format==="ends_with")return`Érvénytelen string: "${X.suffix}" értékkel kell végződnie`;if(X.format==="includes")return`Érvénytelen string: "${X.includes}" értéket kell tartalmaznia`;if(X.format==="regex")return`Érvénytelen string: ${X.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[X.format]??w.format}`}case"not_multiple_of":return`Érvénytelen szám: ${w.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${w.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${w.origin}`;default:return"Érvénytelen bemenet"}}};function U7(){return{localeError:Gy()}}var Yy=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input tidak valid: diharapkan ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak valid: diharapkan ${j(w.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: diharapkan ${w.origin??"value"} memiliki ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: diharapkan ${w.origin??"value"} menjadi ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: diharapkan ${w.origin} memiliki ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: diharapkan ${w.origin} menjadi ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak valid: harus dimulai dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak valid: harus berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak valid: harus menyertakan "${X.includes}"`;if(X.format==="regex")return`String tidak valid: harus sesuai pola ${X.pattern}`;return`${b[X.format]??w.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${w.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${w.origin}`;default:return"Input tidak valid"}}};function w7(){return{localeError:Yy()}}var Ny=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Jy=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(b){return $[b]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(b)=>{switch(b.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Ny(b.input)} þar sem á að vera ${b.expected}`;case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert ráð fyrir ${j(b.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} hafi ${w}${b.maximum.toString()} ${X.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} sé ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Of lítið: gert er ráð fyrir að ${b.origin} hafi ${w}${b.minimum.toString()} ${X.unit}`;return`Of lítið: gert er ráð fyrir að ${b.origin} sé ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ógildur strengur: verður að byrja á "${w.prefix}"`;if(w.format==="ends_with")return`Ógildur strengur: verður að enda á "${w.suffix}"`;if(w.format==="includes")return`Ógildur strengur: verður að innihalda "${w.includes}"`;if(w.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${w.pattern}`;return`Rangt ${U[w.format]??b.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`Óþekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${L(b.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${b.origin}`;default:return"Rangt gildi"}}};function b7(){return{localeError:Jy()}}var By=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numero";case"object":{if(Array.isArray(w))return"vettore";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input non valido: atteso ${w.expected}, ricevuto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input non valido: atteso ${j(w.values[0])}`;return`Opzione non valida: atteso uno tra ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Troppo grande: ${w.origin??"valore"} deve avere ${X}${w.maximum.toString()} ${D.unit??"elementi"}`;return`Troppo grande: ${w.origin??"valore"} deve essere ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Troppo piccolo: ${w.origin} deve avere ${X}${w.minimum.toString()} ${D.unit}`;return`Troppo piccolo: ${w.origin} deve essere ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Stringa non valida: deve iniziare con "${X.prefix}"`;if(X.format==="ends_with")return`Stringa non valida: deve terminare con "${X.suffix}"`;if(X.format==="includes")return`Stringa non valida: deve includere "${X.includes}"`;if(X.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${w.divisor}`;case"unrecognized_keys":return`Chiav${w.keys.length>1?"i":"e"} non riconosciut${w.keys.length>1?"e":"a"}: ${L(w.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${w.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${w.origin}`;default:return"Input non valido"}}};function X7(){return{localeError:By()}}var Hy=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"数値";case"object":{if(Array.isArray(w))return"配列";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(w)=>{switch(w.code){case"invalid_type":return`無効な入力: ${w.expected}が期待されましたが、${U(w.input)}が入力されました`;case"invalid_value":if(w.values.length===1)return`無効な入力: ${j(w.values[0])}が期待されました`;return`無効な選択: ${L(w.values,"、")}のいずれかである必要があります`;case"too_big":{let X=w.inclusive?"以下である":"より小さい",D=I(w.origin);if(D)return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${D.unit??"要素"}${X}必要があります`;return`大きすぎる値: ${w.origin??"値"}は${w.maximum.toString()}${X}必要があります`}case"too_small":{let X=w.inclusive?"以上である":"より大きい",D=I(w.origin);if(D)return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${D.unit}${X}必要があります`;return`小さすぎる値: ${w.origin}は${w.minimum.toString()}${X}必要があります`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無効な文字列: "${X.prefix}"で始まる必要があります`;if(X.format==="ends_with")return`無効な文字列: "${X.suffix}"で終わる必要があります`;if(X.format==="includes")return`無効な文字列: "${X.includes}"を含む必要があります`;if(X.format==="regex")return`無効な文字列: パターン${X.pattern}に一致する必要があります`;return`無効な${b[X.format]??w.format}`}case"not_multiple_of":return`無効な数値: ${w.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${w.keys.length>1?"群":""}: ${L(w.keys,"、")}`;case"invalid_key":return`${w.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${w.origin}内の無効な値`;default:return"無効な入力"}}};function D7(){return{localeError:Hy()}}var Ay=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},Oy=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(b){return $[b]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(b)=>{switch(b.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${b.expected}, მიღებული ${Ay(b.input)}`;case"invalid_value":if(b.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${j(b.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${L(b.values,"|")}-დან`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} ${X.verb} ${w}${b.maximum.toString()} ${X.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} იყოს ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} ${X.verb} ${w}${b.minimum.toString()} ${X.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} იყოს ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${w.prefix}"-ით`;if(w.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${w.suffix}"-ით`;if(w.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${w.includes}"-ს`;if(w.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${w.pattern}`;return`არასწორი ${U[w.format]??b.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${b.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${b.keys.length>1?"ები":"ი"}: ${L(b.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${b.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${b.origin}-ში`;default:return"არასწორი შეყვანა"}}};function W7(){return{localeError:Oy()}}var zy=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(w))return"អារេ (Array)";if(w===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(w)=>{switch(w.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w.expected} ប៉ុន្តែទទួលបាន ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(w.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()} ${D.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${w.origin??"តម្លៃ"} ${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()} ${D.unit}`;return`តូចពេក៖ ត្រូវការ ${w.origin} ${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${X.prefix}"`;if(X.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${X.suffix}"`;if(X.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${X.includes}"`;if(X.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${X.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[X.format]??w.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${w.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${L(w.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${w.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function I0(){return{localeError:zy()}}function Q7(){return I0()}var Ly=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(w)=>{switch(w.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${w.expected}, 받은 타입은 ${U(w.input)}입니다`;case"invalid_value":if(w.values.length===1)return`잘못된 입력: 값은 ${j(w.values[0])} 이어야 합니다`;return`잘못된 옵션: ${L(w.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let X=w.inclusive?"이하":"미만",D=X==="미만"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 큽니다: ${w.maximum.toString()} ${X}${D}`}case"too_small":{let X=w.inclusive?"이상":"초과",D=X==="이상"?"이어야 합니다":"여야 합니다",W=I(w.origin),Q=W?.unit??"요소";if(W)return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()}${Q} ${X}${D}`;return`${w.origin??"값"}이 너무 작습니다: ${w.minimum.toString()} ${X}${D}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`잘못된 문자열: "${X.prefix}"(으)로 시작해야 합니다`;if(X.format==="ends_with")return`잘못된 문자열: "${X.suffix}"(으)로 끝나야 합니다`;if(X.format==="includes")return`잘못된 문자열: "${X.includes}"을(를) 포함해야 합니다`;if(X.format==="regex")return`잘못된 문자열: 정규식 ${X.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[X.format]??w.format}`}case"not_multiple_of":return`잘못된 숫자: ${w.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${L(w.keys,", ")}`;case"invalid_key":return`잘못된 키: ${w.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${w.origin}`;default:return"잘못된 입력"}}};function G7(){return{localeError:Ly()}}var Ky=($)=>{return w0(typeof $,$)},w0=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},U0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function Zq($){let I=Math.abs($),U=I%10,b=I%100;if(b>=11&&b<=19||U===0)return"many";if(U===1)return"one";return"few"}var vy=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(b,w,X,D){let W=$[b]??null;if(W===null)return W;return{unit:W.unit[w],verb:W.verb[D][X?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(b)=>{switch(b.code){case"invalid_type":return`Gautas tipas ${Ky(b.input)}, o tikėtasi - ${w0(b.expected)}`;case"invalid_value":if(b.values.length===1)return`Privalo būti ${j(b.values[0])}`;return`Privalo būti vienas iš ${L(b.values,"|")} pasirinkimų`;case"too_big":{let w=w0(b.origin),X=I(b.origin,Zq(Number(b.maximum)),b.inclusive??!1,"smaller");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.maximum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${U0(w??b.origin??"reikšmė")} turi būti ${D} ${b.maximum.toString()} ${X?.unit}`}case"too_small":{let w=w0(b.origin),X=I(b.origin,Zq(Number(b.minimum)),b.inclusive??!1,"bigger");if(X?.verb)return`${U0(w??b.origin??"reikšmė")} ${X.verb} ${b.minimum.toString()} ${X.unit??"elementų"}`;let D=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${U0(w??b.origin??"reikšmė")} turi būti ${D} ${b.minimum.toString()} ${X?.unit}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Eilutė privalo prasidėti "${w.prefix}"`;if(w.format==="ends_with")return`Eilutė privalo pasibaigti "${w.suffix}"`;if(w.format==="includes")return`Eilutė privalo įtraukti "${w.includes}"`;if(w.format==="regex")return`Eilutė privalo atitikti ${w.pattern}`;return`Neteisingas ${U[w.format]??b.format}`}case"not_multiple_of":return`Skaičius privalo būti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${L(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let w=w0(b.origin);return`${U0(w??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Y7(){return{localeError:vy()}}var Vy=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"број";case"object":{if(Array.isArray(w))return"низа";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(w)=>{switch(w.code){case"invalid_type":return`Грешен внес: се очекува ${w.expected}, примено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Invalid input: expected ${j(w.values[0])}`;return`Грешана опција: се очекува една ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Премногу голем: се очекува ${w.origin??"вредноста"} да има ${X}${w.maximum.toString()} ${D.unit??"елементи"}`;return`Премногу голем: се очекува ${w.origin??"вредноста"} да биде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Премногу мал: се очекува ${w.origin} да има ${X}${w.minimum.toString()} ${D.unit}`;return`Премногу мал: се очекува ${w.origin} да биде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неважечка низа: мора да започнува со "${X.prefix}"`;if(X.format==="ends_with")return`Неважечка низа: мора да завршува со "${X.suffix}"`;if(X.format==="includes")return`Неважечка низа: мора да вклучува "${X.includes}"`;if(X.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${X.pattern}`;return`Invalid ${b[X.format]??w.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${L(w.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${w.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${w.origin}`;default:return"Грешен внес"}}};function N7(){return{localeError:Vy()}}var qy=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nombor";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Input tidak sah: dijangka ${w.expected}, diterima ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Input tidak sah: dijangka ${j(w.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Terlalu besar: dijangka ${w.origin??"nilai"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elemen"}`;return`Terlalu besar: dijangka ${w.origin??"nilai"} adalah ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Terlalu kecil: dijangka ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Terlalu kecil: dijangka ${w.origin} adalah ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`String tidak sah: mesti bermula dengan "${X.prefix}"`;if(X.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${X.suffix}"`;if(X.format==="includes")return`String tidak sah: mesti mengandungi "${X.includes}"`;if(X.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${X.pattern}`;return`${b[X.format]??w.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${w.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(w.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${w.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${w.origin}`;default:return"Input tidak sah"}}};function J7(){return{localeError:qy()}}var My=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"getal";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(w)=>{switch(w.code){case"invalid_type":return`Ongeldige invoer: verwacht ${w.expected}, ontving ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ongeldige invoer: verwacht ${j(w.values[0])}`;return`Ongeldige optie: verwacht één van ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Te groot: verwacht dat ${w.origin??"waarde"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"elementen"}`;return`Te groot: verwacht dat ${w.origin??"waarde"} ${X}${w.maximum.toString()} is`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Te klein: verwacht dat ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Te klein: verwacht dat ${w.origin} ${X}${w.minimum.toString()} is`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ongeldige tekst: moet met "${X.prefix}" beginnen`;if(X.format==="ends_with")return`Ongeldige tekst: moet op "${X.suffix}" eindigen`;if(X.format==="includes")return`Ongeldige tekst: moet "${X.includes}" bevatten`;if(X.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${X.pattern}`;return`Ongeldig: ${b[X.format]??w.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${w.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${w.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${w.origin}`;default:return"Ongeldige invoer"}}};function B7(){return{localeError:My()}}var Fy=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"tall";case"object":{if(Array.isArray(w))return"liste";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Ugyldig input: forventet ${w.expected}, fikk ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ugyldig verdi: forventet ${j(w.values[0])}`;return`Ugyldig valg: forventet en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()} ${D.unit??"elementer"}`;return`For stor(t): forventet ${w.origin??"value"} til å ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()} ${D.unit}`;return`For lite(n): forventet ${w.origin} til å ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ugyldig streng: må starte med "${X.prefix}"`;if(X.format==="ends_with")return`Ugyldig streng: må ende med "${X.suffix}"`;if(X.format==="includes")return`Ugyldig streng: må inneholde "${X.includes}"`;if(X.format==="regex")return`Ugyldig streng: må matche mønsteret ${X.pattern}`;return`Ugyldig ${b[X.format]??w.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${w.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${w.origin}`;default:return"Ugyldig input"}}};function H7(){return{localeError:Fy()}}var jy=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"numara";case"object":{if(Array.isArray(w))return"saf";if(w===null)return"gayb";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(w)=>{switch(w.code){case"invalid_type":return`Fâsit giren: umulan ${w.expected}, alınan ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Fâsit giren: umulan ${j(w.values[0])}`;return`Fâsit tercih: mûteberler ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} ${D.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${w.origin??"value"}, ${X}${w.maximum.toString()} olmalıydı.`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} ${D.unit} sahip olmalıydı.`;return`Fazla küçük: ${w.origin}, ${X}${w.minimum.toString()} olmalıydı.`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Fâsit metin: "${X.prefix}" ile başlamalı.`;if(X.format==="ends_with")return`Fâsit metin: "${X.suffix}" ile bitmeli.`;if(X.format==="includes")return`Fâsit metin: "${X.includes}" ihtivâ etmeli.`;if(X.format==="regex")return`Fâsit metin: ${X.pattern} nakşına uymalı.`;return`Fâsit ${b[X.format]??w.format}`}case"not_multiple_of":return`Fâsit sayı: ${w.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${w.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function A7(){return{localeError:jy()}}var Ey=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"عدد";case"object":{if(Array.isArray(w))return"ارې";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(w)=>{switch(w.code){case"invalid_type":return`ناسم ورودي: باید ${w.expected} وای, مګر ${U(w.input)} ترلاسه شو`;case"invalid_value":if(w.values.length===1)return`ناسم ورودي: باید ${j(w.values[0])} وای`;return`ناسم انتخاب: باید یو له ${L(w.values,"|")} څخه وای`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} ${D.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${w.origin??"ارزښت"} باید ${X}${w.maximum.toString()} وي`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} ${D.unit} ولري`;return`ډیر کوچنی: ${w.origin} باید ${X}${w.minimum.toString()} وي`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`ناسم متن: باید د "${X.prefix}" سره پیل شي`;if(X.format==="ends_with")return`ناسم متن: باید د "${X.suffix}" سره پای ته ورسيږي`;if(X.format==="includes")return`ناسم متن: باید "${X.includes}" ولري`;if(X.format==="regex")return`ناسم متن: باید د ${X.pattern} سره مطابقت ولري`;return`${b[X.format]??w.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${w.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${w.keys.length>1?"کلیډونه":"کلیډ"}: ${L(w.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${w.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${w.origin} کې`;default:return"ناسمه ورودي"}}};function O7(){return{localeError:Ey()}}var Sy=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"liczba";case"object":{if(Array.isArray(w))return"tablica";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(w)=>{switch(w.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${w.expected}, otrzymano ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(w.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Za duża wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.maximum.toString()} ${D.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Za mała wartość: oczekiwano, że ${w.origin??"wartość"} będzie mieć ${X}${w.minimum.toString()} ${D.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${w.origin??"wartość"} będzie wynosić ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${X.prefix}"`;if(X.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${X.suffix}"`;if(X.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${X.includes}"`;if(X.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${X.pattern}`;return`Nieprawidłow(y/a/e) ${b[X.format]??w.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${w.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${w.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${w.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function z7(){return{localeError:Sy()}}var Py=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"número";case"object":{if(Array.isArray(w))return"array";if(w===null)return"nulo";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(w)=>{switch(w.code){case"invalid_type":return`Tipo inválido: esperado ${w.expected}, recebido ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Entrada inválida: esperado ${j(w.values[0])}`;return`Opção inválida: esperada uma das ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Muito grande: esperado que ${w.origin??"valor"} tivesse ${X}${w.maximum.toString()} ${D.unit??"elementos"}`;return`Muito grande: esperado que ${w.origin??"valor"} fosse ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Muito pequeno: esperado que ${w.origin} tivesse ${X}${w.minimum.toString()} ${D.unit}`;return`Muito pequeno: esperado que ${w.origin} fosse ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Texto inválido: deve começar com "${X.prefix}"`;if(X.format==="ends_with")return`Texto inválido: deve terminar com "${X.suffix}"`;if(X.format==="includes")return`Texto inválido: deve incluir "${X.includes}"`;if(X.format==="regex")return`Texto inválido: deve corresponder ao padrão ${X.pattern}`;return`${b[X.format]??w.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${w.divisor}`;case"unrecognized_keys":return`Chave${w.keys.length>1?"s":""} desconhecida${w.keys.length>1?"s":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Chave inválida em ${w.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${w.origin}`;default:return"Campo inválido"}}};function L7(){return{localeError:Py()}}function Cq($,I,U,b){let w=Math.abs($),X=w%10,D=w%100;if(D>=11&&D<=19)return b;if(X===1)return I;if(X>=2&&X<=4)return U;return b}var ky=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"массив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(w)=>{switch(w.code){case"invalid_type":return`Неверный ввод: ожидалось ${w.expected}, получено ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неверный ввод: ожидалось ${j(w.values[0])}`;return`Неверный вариант: ожидалось одно из ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D){let W=Number(w.maximum),Q=Cq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет иметь ${X}${w.maximum.toString()} ${Q}`}return`Слишком большое значение: ожидалось, что ${w.origin??"значение"} будет ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D){let W=Number(w.minimum),Q=Cq(W,D.unit.one,D.unit.few,D.unit.many);return`Слишком маленькое значение: ожидалось, что ${w.origin} будет иметь ${X}${w.minimum.toString()} ${Q}`}return`Слишком маленькое значение: ожидалось, что ${w.origin} будет ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неверная строка: должна начинаться с "${X.prefix}"`;if(X.format==="ends_with")return`Неверная строка: должна заканчиваться на "${X.suffix}"`;if(X.format==="includes")return`Неверная строка: должна содержать "${X.includes}"`;if(X.format==="regex")return`Неверная строка: должна соответствовать шаблону ${X.pattern}`;return`Неверный ${b[X.format]??w.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${w.divisor}`;case"unrecognized_keys":return`Нераспознанн${w.keys.length>1?"ые":"ый"} ключ${w.keys.length>1?"и":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${w.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${w.origin}`;default:return"Неверные входные данные"}}};function K7(){return{localeError:ky()}}var Ry=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"število";case"object":{if(Array.isArray(w))return"tabela";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(w)=>{switch(w.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${w.expected}, prejeto ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Neveljaven vnos: pričakovano ${j(w.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} imelo ${X}${w.maximum.toString()} ${D.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${w.origin??"vrednost"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Premajhno: pričakovano, da bo ${w.origin} imelo ${X}${w.minimum.toString()} ${D.unit}`;return`Premajhno: pričakovano, da bo ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Neveljaven niz: mora se začeti z "${X.prefix}"`;if(X.format==="ends_with")return`Neveljaven niz: mora se končati z "${X.suffix}"`;if(X.format==="includes")return`Neveljaven niz: mora vsebovati "${X.includes}"`;if(X.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${X.pattern}`;return`Neveljaven ${b[X.format]??w.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${w.divisor}`;case"unrecognized_keys":return`Neprepoznan${w.keys.length>1?"i ključi":" ključ"}: ${L(w.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${w.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${w.origin}`;default:return"Neveljaven vnos"}}};function v7(){return{localeError:Ry()}}var Ty=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"antal";case"object":{if(Array.isArray(w))return"lista";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(w)=>{switch(w.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${w.expected}, fick ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ogiltig inmatning: förväntat ${j(w.values[0])}`;return`Ogiltigt val: förväntade en av ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`För stor(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()} ${D.unit??"element"}`;return`För stor(t): förväntat ${w.origin??"värdet"} att ha ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()} ${D.unit}`;return`För lite(t): förväntade ${w.origin??"värdet"} att ha ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ogiltig sträng: måste börja med "${X.prefix}"`;if(X.format==="ends_with")return`Ogiltig sträng: måste sluta med "${X.suffix}"`;if(X.format==="includes")return`Ogiltig sträng: måste innehålla "${X.includes}"`;if(X.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${X.pattern}"`;return`Ogiltig(t) ${b[X.format]??w.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${L(w.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${w.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${w.origin??"värdet"}`;default:return"Ogiltig input"}}};function V7(){return{localeError:Ty()}}var _y=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(w))return"அணி";if(w===null)return"வெறுமை";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w.expected}, பெறப்பட்டது ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(w.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(w.values,"|")} இல் ஒன்று`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ${D.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${w.origin??"மதிப்பு"} ${X}${w.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ${D.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${w.origin} ${X}${w.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`தவறான சரம்: "${X.prefix}" இல் தொடங்க வேண்டும்`;if(X.format==="ends_with")return`தவறான சரம்: "${X.suffix}" இல் முடிவடைய வேண்டும்`;if(X.format==="includes")return`தவறான சரம்: "${X.includes}" ஐ உள்ளடக்க வேண்டும்`;if(X.format==="regex")return`தவறான சரம்: ${X.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[X.format]??w.format}`}case"not_multiple_of":return`தவறான எண்: ${w.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${w.keys.length>1?"கள்":""}: ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${w.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function q7(){return{localeError:_y()}}var Zy=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(w))return"อาร์เรย์ (Array)";if(w===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(w)=>{switch(w.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${w.expected} แต่ได้รับ ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(w.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"ไม่เกิน":"น้อยกว่า",D=I(w.origin);if(D)return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()} ${D.unit??"รายการ"}`;return`เกินกำหนด: ${w.origin??"ค่า"} ควรมี${X} ${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?"อย่างน้อย":"มากกว่า",D=I(w.origin);if(D)return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()} ${D.unit}`;return`น้อยกว่ากำหนด: ${w.origin} ควรมี${X} ${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${X.prefix}"`;if(X.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${X.suffix}"`;if(X.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${X.includes}" อยู่ในข้อความ`;if(X.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${X.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[X.format]??w.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${w.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${L(w.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${w.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${w.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function M7(){return{localeError:Zy()}}var Cy=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},gy=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(b){return $[b]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(b)=>{switch(b.code){case"invalid_type":return`Geçersiz değer: beklenen ${b.expected}, alınan ${Cy(b.input)}`;case"invalid_value":if(b.values.length===1)return`Geçersiz değer: beklenen ${j(b.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",X=I(b.origin);if(X)return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()} ${X.unit??"öğe"}`;return`Çok büyük: beklenen ${b.origin??"değer"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",X=I(b.origin);if(X)return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()} ${X.unit}`;return`Çok küçük: beklenen ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Geçersiz metin: "${w.prefix}" ile başlamalı`;if(w.format==="ends_with")return`Geçersiz metin: "${w.suffix}" ile bitmeli`;if(w.format==="includes")return`Geçersiz metin: "${w.includes}" içermeli`;if(w.format==="regex")return`Geçersiz metin: ${w.pattern} desenine uymalı`;return`Geçersiz ${U[w.format]??b.format}`}case"not_multiple_of":return`Geçersiz sayı: ${b.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${b.keys.length>1?"lar":""}: ${L(b.keys,", ")}`;case"invalid_key":return`${b.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${b.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function F7(){return{localeError:gy()}}var xy=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"число";case"object":{if(Array.isArray(w))return"масив";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(w)=>{switch(w.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${w.expected}, отримано ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Неправильні вхідні дані: очікується ${j(w.values[0])}`;return`Неправильна опція: очікується одне з ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Занадто велике: очікується, що ${w.origin??"значення"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"елементів"}`;return`Занадто велике: очікується, що ${w.origin??"значення"} буде ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Занадто мале: очікується, що ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Занадто мале: очікується, що ${w.origin} буде ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Неправильний рядок: повинен починатися з "${X.prefix}"`;if(X.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${X.suffix}"`;if(X.format==="includes")return`Неправильний рядок: повинен містити "${X.includes}"`;if(X.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${X.pattern}`;return`Неправильний ${b[X.format]??w.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${w.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${w.keys.length>1?"і":""}: ${L(w.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${w.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${w.origin}`;default:return"Неправильні вхідні дані"}}};function b0(){return{localeError:xy()}}function j7(){return b0()}var hy=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"نمبر";case"object":{if(Array.isArray(w))return"آرے";if(w===null)return"نل";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(w)=>{switch(w.code){case"invalid_type":return`غلط ان پٹ: ${w.expected} متوقع تھا، ${U(w.input)} موصول ہوا`;case"invalid_value":if(w.values.length===1)return`غلط ان پٹ: ${j(w.values[0])} متوقع تھا`;return`غلط آپشن: ${L(w.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`بہت بڑا: ${w.origin??"ویلیو"} کے ${X}${w.maximum.toString()} ${D.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${w.origin??"ویلیو"} کا ${X}${w.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`بہت چھوٹا: ${w.origin} کے ${X}${w.minimum.toString()} ${D.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${w.origin} کا ${X}${w.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`غلط سٹرنگ: "${X.prefix}" سے شروع ہونا چاہیے`;if(X.format==="ends_with")return`غلط سٹرنگ: "${X.suffix}" پر ختم ہونا چاہیے`;if(X.format==="includes")return`غلط سٹرنگ: "${X.includes}" شامل ہونا چاہیے`;if(X.format==="regex")return`غلط سٹرنگ: پیٹرن ${X.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[X.format]??w.format}`}case"not_multiple_of":return`غلط نمبر: ${w.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${w.keys.length>1?"ز":""}: ${L(w.keys,"، ")}`;case"invalid_key":return`${w.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${w.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function E7(){return{localeError:hy()}}var fy=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"số";case"object":{if(Array.isArray(w))return"mảng";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(w)=>{switch(w.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${w.expected}, nhận được ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(w.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${D.verb} ${X}${w.maximum.toString()} ${D.unit??"phần tử"}`;return`Quá lớn: mong đợi ${w.origin??"giá trị"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Quá nhỏ: mong đợi ${w.origin} ${D.verb} ${X}${w.minimum.toString()} ${D.unit}`;return`Quá nhỏ: mong đợi ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${X.prefix}"`;if(X.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${X.suffix}"`;if(X.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${X.includes}"`;if(X.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${X.pattern}`;return`${b[X.format]??w.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${w.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${L(w.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${w.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${w.origin}`;default:return"Đầu vào không hợp lệ"}}};function S7(){return{localeError:fy()}}var yy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(w))return"数组";if(w===null)return"空值(null)";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(w)=>{switch(w.code){case"invalid_type":return`无效输入:期望 ${w.expected},实际接收 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`无效输入:期望 ${j(w.values[0])}`;return`无效选项:期望以下之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()} ${D.unit??"个元素"}`;return`数值过大:期望 ${w.origin??"值"} ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()} ${D.unit}`;return`数值过小:期望 ${w.origin} ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`无效字符串:必须以 "${X.prefix}" 开头`;if(X.format==="ends_with")return`无效字符串:必须以 "${X.suffix}" 结尾`;if(X.format==="includes")return`无效字符串:必须包含 "${X.includes}"`;if(X.format==="regex")return`无效字符串:必须满足正则表达式 ${X.pattern}`;return`无效${b[X.format]??w.format}`}case"not_multiple_of":return`无效数字:必须是 ${w.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${L(w.keys,", ")}`;case"invalid_key":return`${w.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${w.origin} 中包含无效值(value)`;default:return"无效输入"}}};function P7(){return{localeError:yy()}}var uy=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(w)=>{switch(w.code){case"invalid_type":return`無效的輸入值:預期為 ${w.expected},但收到 ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`無效的輸入值:預期為 ${j(w.values[0])}`;return`無效的選項:預期為以下其中之一 ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()} ${D.unit??"個元素"}`;return`數值過大:預期 ${w.origin??"值"} 應為 ${X}${w.maximum.toString()}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()} ${D.unit}`;return`數值過小:預期 ${w.origin} 應為 ${X}${w.minimum.toString()}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`無效的字串:必須以 "${X.prefix}" 開頭`;if(X.format==="ends_with")return`無效的字串:必須以 "${X.suffix}" 結尾`;if(X.format==="includes")return`無效的字串:必須包含 "${X.includes}"`;if(X.format==="regex")return`無效的字串:必須符合格式 ${X.pattern}`;return`無效的 ${b[X.format]??w.format}`}case"not_multiple_of":return`無效的數字:必須為 ${w.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${w.keys.length>1?"們":""}:${L(w.keys,"、")}`;case"invalid_key":return`${w.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${w.origin} 中有無效的值`;default:return"無效的輸入值"}}};function k7(){return{localeError:uy()}}var ly=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(w){return $[w]??null}let U=(w)=>{let X=typeof w;switch(X){case"number":return Number.isNaN(w)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(w))return"akopọ";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name}}return X},b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(w)=>{switch(w.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${w.expected}, àmọ̀ a rí ${U(w.input)}`;case"invalid_value":if(w.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${j(w.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${L(w.values,"|")}`;case"too_big":{let X=w.inclusive?"<=":"<",D=I(w.origin);if(D)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${w.origin??"iye"} ${D.verb} ${X}${w.maximum} ${D.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${X}${w.maximum}`}case"too_small":{let X=w.inclusive?">=":">",D=I(w.origin);if(D)return`Kéré ju: a ní láti jẹ́ pé ${w.origin} ${D.verb} ${X}${w.minimum} ${D.unit}`;return`Kéré ju: a ní láti jẹ́ ${X}${w.minimum}`}case"invalid_format":{let X=w;if(X.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${X.prefix}"`;if(X.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${X.suffix}"`;if(X.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${X.includes}"`;if(X.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${X.pattern}`;return`Aṣìṣe: ${b[X.format]??w.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${w.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${L(w.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${w.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${w.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function R7(){return{localeError:ly()}}var gq,T7=Symbol("ZodOutput"),_7=Symbol("ZodInput");class Z7{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let b={...U,...this._map.get($)};return Object.keys(b).length?b:void 0}return this._map.get($)}has($){return this._map.has($)}}function TX(){return new Z7}(gq=globalThis).__zod_globalRegistry??(gq.__zod_globalRegistry=TX());var d$=globalThis.__zod_globalRegistry;function C7($,I){return new $({type:"string",...S(I)})}function g7($,I){return new $({type:"string",coerce:!0,...S(I)})}function _X($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...S(I)})}function D0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...S(I)})}function ZX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...S(I)})}function CX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(I)})}function gX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(I)})}function xX($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(I)})}function W0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...S(I)})}function hX($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...S(I)})}function fX($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(I)})}function yX($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...S(I)})}function uX($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(I)})}function lX($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...S(I)})}function cX($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...S(I)})}function mX($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(I)})}function rX($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(I)})}function nX($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(I)})}function x7($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...S(I)})}function iX($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(I)})}function oX($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(I)})}function dX($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...S(I)})}function pX($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...S(I)})}function tX($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...S(I)})}function aX($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...S(I)})}var h7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function f7($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(I)})}function y7($,I){return new $({type:"string",format:"date",check:"string_format",...S(I)})}function u7($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...S(I)})}function l7($,I){return new $({type:"string",format:"duration",check:"string_format",...S(I)})}function c7($,I){return new $({type:"number",checks:[],...S(I)})}function m7($,I){return new $({type:"number",coerce:!0,checks:[],...S(I)})}function r7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...S(I)})}function n7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...S(I)})}function i7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...S(I)})}function o7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...S(I)})}function d7($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...S(I)})}function p7($,I){return new $({type:"boolean",...S(I)})}function t7($,I){return new $({type:"boolean",coerce:!0,...S(I)})}function a7($,I){return new $({type:"bigint",...S(I)})}function e7($,I){return new $({type:"bigint",coerce:!0,...S(I)})}function s7($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(I)})}function $5($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(I)})}function I5($,I){return new $({type:"symbol",...S(I)})}function U5($,I){return new $({type:"undefined",...S(I)})}function w5($,I){return new $({type:"null",...S(I)})}function b5($){return new $({type:"any"})}function X5($){return new $({type:"unknown"})}function D5($,I){return new $({type:"never",...S(I)})}function W5($,I){return new $({type:"void",...S(I)})}function Q5($,I){return new $({type:"date",...S(I)})}function G5($,I){return new $({type:"date",coerce:!0,...S(I)})}function Y5($,I){return new $({type:"nan",...S(I)})}function r6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!1})}function Y6($,I){return new vX({check:"less_than",...S(I),value:$,inclusive:!0})}function n6($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!1})}function p$($,I){return new VX({check:"greater_than",...S(I),value:$,inclusive:!0})}function eX($){return n6(0,$)}function sX($){return r6(0,$)}function $D($){return Y6(0,$)}function ID($){return p$(0,$)}function C4($,I){return new JY({check:"multiple_of",...S(I),value:$})}function W1($,I){return new AY({check:"max_size",...S(I),maximum:$})}function g4($,I){return new OY({check:"min_size",...S(I),minimum:$})}function $I($,I){return new zY({check:"size_equals",...S(I),size:$})}function Q1($,I){return new LY({check:"max_length",...S(I),maximum:$})}function X4($,I){return new KY({check:"min_length",...S(I),minimum:$})}function G1($,I){return new vY({check:"length_equals",...S(I),length:$})}function II($,I){return new VY({check:"string_format",format:"regex",...S(I),pattern:$})}function UI($){return new qY({check:"string_format",format:"lowercase",...S($)})}function wI($){return new MY({check:"string_format",format:"uppercase",...S($)})}function bI($,I){return new FY({check:"string_format",format:"includes",...S(I),includes:$})}function XI($,I){return new jY({check:"string_format",format:"starts_with",...S(I),prefix:$})}function DI($,I){return new EY({check:"string_format",format:"ends_with",...S(I),suffix:$})}function UD($,I,U){return new SY({check:"property",property:$,schema:I,...S(U)})}function WI($,I){return new PY({check:"mime_type",mime:$,...S(I)})}function Z6($){return new kY({check:"overwrite",tx:$})}function QI($){return Z6((I)=>I.normalize($))}function GI(){return Z6(($)=>$.trim())}function YI(){return Z6(($)=>$.toLowerCase())}function NI(){return Z6(($)=>$.toUpperCase())}function JI(){return Z6(($)=>EG($))}function N5($,I,U){return new $({type:"array",element:I,...S(U)})}function my($,I,U){return new $({type:"union",options:I,...S(U)})}function ry($,I,U){return new $({type:"union",options:I,inclusive:!1,...S(U)})}function ny($,I,U,b){return new $({type:"union",options:U,discriminator:I,...S(b)})}function iy($,I,U){return new $({type:"intersection",left:I,right:U})}function oy($,I,U,b){let w=U instanceof o;return new $({type:"tuple",items:I,rest:w?U:null,...S(w?b:U)})}function dy($,I,U,b){return new $({type:"record",keyType:I,valueType:U,...S(b)})}function py($,I,U,b){return new $({type:"map",keyType:I,valueType:U,...S(b)})}function ty($,I,U){return new $({type:"set",valueType:I,...S(U)})}function ay($,I,U){let b=Array.isArray(I)?Object.fromEntries(I.map((w)=>[w,w])):I;return new $({type:"enum",entries:b,...S(U)})}function ey($,I,U){return new $({type:"enum",entries:I,...S(U)})}function sy($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...S(U)})}function J5($,I){return new $({type:"file",...S(I)})}function $u($,I){return new $({type:"transform",transform:I})}function Iu($,I){return new $({type:"optional",innerType:I})}function Uu($,I){return new $({type:"nullable",innerType:I})}function wu($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():PG(U)}})}function bu($,I,U){return new $({type:"nonoptional",innerType:I,...S(U)})}function Xu($,I){return new $({type:"success",innerType:I})}function Du($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function Wu($,I,U){return new $({type:"pipe",in:I,out:U})}function Qu($,I){return new $({type:"readonly",innerType:I})}function Gu($,I,U){return new $({type:"template_literal",parts:I,...S(U)})}function Yu($,I){return new $({type:"lazy",getter:I})}function Nu($,I){return new $({type:"promise",innerType:I})}function B5($,I,U){let b=S(U);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:I,...b})}function H5($,I,U){return new $({type:"custom",check:"custom",fn:I,...S(U)})}function A5($){let I=xq((U)=>{return U.addIssue=(b)=>{if(typeof b==="string")U.issues.push(d1(b,U.value,I._zod.def));else{let w=b;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=I),w.continue??(w.continue=!I._zod.def.abort),U.issues.push(d1(w))}},$(U.value,U)});return I}function xq($,I){let U=new A$({check:"custom",...S(I)});return U._zod.check=$,U}function O5($){let I=new A$({check:"describe"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,description:$})}],I._zod.check=()=>{},I}function z5($){let I=new A$({check:"meta"});return I._zod.onattach=[(U)=>{let b=d$.get(U)??{};d$.add(U,{...b,...$})}],I._zod.check=()=>{},I}function L5($,I){let U=S(I),b=U.truthy??["true","1","yes","on","y","enabled"],w=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")b=b.map((B)=>typeof B==="string"?B.toLowerCase():B),w=w.map((B)=>typeof B==="string"?B.toLowerCase():B);let X=new Set(b),D=new Set(w),W=$.Codec??sU,Q=$.Boolean??aU,Y=new($.String??D1)({type:"string",error:U.error}),J=new Q({type:"boolean",error:U.error}),H=new W({type:"pipe",in:Y,out:J,transform:(B,A)=>{let O=B;if(U.case!=="sensitive")O=O.toLowerCase();if(X.has(O))return!0;else if(D.has(O))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...X,...D],input:A.value,inst:H,continue:!1}),{}},reverseTransform:(B,A)=>{if(B===!0)return b[0]||"true";else return w[0]||"false"},error:U.error});return H}function BI($,I,U,b={}){let w=S(b),X={...S(b),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(W)=>U.test(W),...w};if(U instanceof RegExp)X.pattern=U;return new $(X)}function x4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??d$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function G$($,I,U={path:[],schemaPath:[]}){var b;let w=$._zod.def,X=I.seen.get($);if(X){if(X.count++,U.schemaPath.includes($))X.cycle=U.path;return X.schema}let D={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,D);let W=$._zod.toJSONSchema?.();if(W)D.schema=W;else{let Y={...U,schemaPath:[...U.schemaPath,$],path:U.path},J=$._zod.parent;if(J)D.ref=J,G$(J,I,Y),I.seen.get(J).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,D.schema,Y);else{let H=D.schema,B=I.processors[w.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${w.type}`);B($,I,H,Y)}}let Q=I.metadataRegistry.get($);if(Q)Object.assign(D.schema,Q);if(I.io==="input"&&t$($))delete D.schema.examples,delete D.schema.default;if(I.io==="input"&&D.schema._prefault)(b=D.schema).default??(b.default=D.schema._prefault);return delete D.schema._prefault,I.seen.get($).schema}function h4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(X)=>{let D=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let Y=$.external.registry.get(X[0])?.id,J=$.external.uri??((B)=>B);if(Y)return{ref:J(Y)};let H=X[1].defId??X[1].schema.id??`schema${$.counter++}`;return X[1].defId=H,{defId:H,ref:`${J("__shared")}#/${D}/${H}`}}if(X[1]===U)return{ref:"#"};let Q=`${"#"}/${D}/`,G=X[1].schema.id??`__schema${$.counter++}`;return{defId:G,ref:Q+G}},w=(X)=>{if(X[1].schema.$ref)return;let D=X[1],{ref:W,defId:Q}=b(X);if(D.def={...D.schema},Q)D.defId=Q;let G=D.schema;for(let Y in G)delete G[Y];G.$ref=W};if($.cycles==="throw")for(let X of $.seen.entries()){let D=X[1];if(D.cycle)throw new Error(`Cycle detected: #/${D.cycle?.join("/")}/<root>
63
63
 
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of $.seen.entries()){let D=X[1];if(I===X[0]){w(X);continue}if($.external){let Q=$.external.registry.get(X[0])?.id;if(I!==X[0]&&Q){w(X);continue}}if($.metadataRegistry.get(X[0])?.id){w(X);continue}if(D.cycle){w(X);continue}if(D.count>1){if($.reused==="ref"){w(X);continue}}}}function h4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(D)=>{let W=$.seen.get(D),Q=W.def??W.schema,G={...Q};if(W.ref===null)return;let N=W.ref;if(W.ref=null,N){b(N);let B=$.seen.get(N).schema;if(B.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(B);else Object.assign(Q,B),Object.assign(Q,G)}if(!W.isParent)$.override({zodSchema:D,jsonSchema:Q,path:W.path??[]})};for(let D of[...$.seen.entries()].reverse())b(D[0]);let w={};if($.target==="draft-2020-12")w.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")w.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")w.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let D=$.external.registry.get(I)?.id;if(!D)throw new Error("Schema is missing an `id` property");w.$id=$.external.uri(D)}Object.assign(w,U.def??U.schema);let X=$.external?.defs??{};for(let D of $.seen.entries()){let W=D[1];if(W.def&&W.defId)X[W.defId]=W.def}if($.external);else if(Object.keys(X).length>0)if($.target==="draft-2020-12")w.$defs=X;else w.definitions=X;try{let D=JSON.parse(JSON.stringify(w));return Object.defineProperty(D,"~standard",{value:{...I["~standard"],jsonSchema:{input:BI(I,"input"),output:BI(I,"output")}},enumerable:!1,writable:!1}),D}catch(D){throw new Error("Error converting schema to JSON.")}}function t$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let b=$._zod.def;if(b.type==="transform")return!0;if(b.type==="array")return t$(b.element,U);if(b.type==="set")return t$(b.valueType,U);if(b.type==="lazy")return t$(b.getter(),U);if(b.type==="promise"||b.type==="optional"||b.type==="nonoptional"||b.type==="nullable"||b.type==="readonly"||b.type==="default"||b.type==="prefault")return t$(b.innerType,U);if(b.type==="intersection")return t$(b.left,U)||t$(b.right,U);if(b.type==="record"||b.type==="map")return t$(b.keyType,U)||t$(b.valueType,U);if(b.type==="pipe")return t$(b.in,U)||t$(b.out,U);if(b.type==="object"){for(let w in b.shape)if(t$(b.shape[w],U))return!0;return!1}if(b.type==="union"){for(let w of b.options)if(t$(w,U))return!0;return!1}if(b.type==="tuple"){for(let w of b.items)if(t$(w,U))return!0;if(b.rest&&t$(b.rest,U))return!0;return!1}return!1}var G5=($,I={})=>(U)=>{let b=g4({...U,processors:I});return G$($,b),x4(b,$),h4(b,$)},BI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=g4({...b??{},target:w,io:I,processors:{}});return G$($,X),x4(X,$),h4(X,$)};var dy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},N5=($,I,U,b)=>{let w=U;w.type="string";let{minimum:X,maximum:D,format:W,patterns:Q,contentEncoding:G}=$._zod.bag;if(typeof X==="number")w.minLength=X;if(typeof D==="number")w.maxLength=D;if(W){if(w.format=dy[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let N=[...Q];if(N.length===1)w.pattern=N[0].source;else if(N.length>1)w.allOf=[...N.map((B)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},Y5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:N}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof N==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=N,w.exclusiveMinimum=!0;else w.exclusiveMinimum=N;if(typeof X==="number"){if(w.minimum=X,typeof N==="number"&&I.target!=="draft-04")if(N>=X)delete w.minimum;else delete w.exclusiveMinimum}if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.maximum=G,w.exclusiveMaximum=!0;else w.exclusiveMaximum=G;if(typeof D==="number"){if(w.maximum=D,typeof G==="number"&&I.target!=="draft-04")if(G<=D)delete w.maximum;else delete w.exclusiveMaximum}if(typeof Q==="number")w.multipleOf=Q},B5=($,I,U,b)=>{U.type="boolean"},J5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},H5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},A5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},O5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},z5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},L5=($,I,U,b)=>{U.not={}},K5=($,I,U,b)=>{},v5=($,I,U,b)=>{},V5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},q5=($,I,U,b)=>{let w=$._zod.def,X=uU(w.entries);if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";U.enum=X},F5=($,I,U,b)=>{let w=$._zod.def,X=[];for(let D of w.values)if(D===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(D));else X.push(D);if(X.length===0);else if(X.length===1){let D=X[0];if(U.type=D===null?"null":typeof D,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[D];else U.const=D}else{if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";if(X.every((D)=>typeof D==="boolean"))U.type="boolean";if(X.every((D)=>D===null))U.type="null";U.enum=X}},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},j5=($,I,U,b)=>{let w=U,X=$._zod.pattern;if(!X)throw new Error("Pattern not found in template literal");w.type="string",w.pattern=X.source},E5=($,I,U,b)=>{let w=U,X={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:W,mime:Q}=$._zod.bag;if(D!==void 0)X.minLength=D;if(W!==void 0)X.maxLength=W;if(Q)if(Q.length===1)X.contentMediaType=Q[0],Object.assign(w,X);else w.anyOf=Q.map((G)=>{return{...X,contentMediaType:G}});else Object.assign(w,X)},S5=($,I,U,b)=>{U.type="boolean"},P5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},k5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},R5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},_5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Z5=($,I,U,b)=>{let w=U,X=$._zod.def,{minimum:D,maximum:W}=$._zod.bag;if(typeof D==="number")w.minItems=D;if(typeof W==="number")w.maxItems=W;w.type="array",w.items=G$(X.element,I,{...b,path:[...b.path,"items"]})},C5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="object",w.properties={};let D=X.shape;for(let G in D)w.properties[G]=G$(D[G],I,{...b,path:[...b.path,"properties",G]});let W=new Set(Object.keys(D)),Q=new Set([...W].filter((G)=>{let N=X.shape[G]._zod;if(I.io==="input")return N.optin===void 0;else return N.optout===void 0}));if(Q.size>0)w.required=Array.from(Q);if(X.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!X.catchall){if(I.io==="output")w.additionalProperties=!1}else if(X.catchall)w.additionalProperties=G$(X.catchall,I,{...b,path:[...b.path,"additionalProperties"]})},aX=($,I,U,b)=>{let w=$._zod.def,X=w.inclusive===!1,D=w.options.map((W,Q)=>G$(W,I,{...b,path:[...b.path,X?"oneOf":"anyOf",Q]}));if(X)U.oneOf=D;else U.anyOf=D},g5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.left,I,{...b,path:[...b.path,"allOf",0]}),D=G$(w.right,I,{...b,path:[...b.path,"allOf",1]}),W=(G)=>("allOf"in G)&&Object.keys(G).length===1,Q=[...W(X)?X.allOf:[X],...W(D)?D.allOf:[D]];U.allOf=Q},x5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="array";let D=I.target==="draft-2020-12"?"prefixItems":"items",W=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",Q=X.items.map((H,J)=>G$(H,I,{...b,path:[...b.path,D,J]})),G=X.rest?G$(X.rest,I,{...b,path:[...b.path,W,...I.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(w.prefixItems=Q,G)w.items=G}else if(I.target==="openapi-3.0"){if(w.items={anyOf:Q},G)w.items.anyOf.push(G);if(w.minItems=Q.length,!G)w.maxItems=Q.length}else if(w.items=Q,G)w.additionalItems=G;let{minimum:N,maximum:B}=$._zod.bag;if(typeof N==="number")w.minItems=N;if(typeof B==="number")w.maxItems=B},h5=($,I,U,b)=>{let w=U,X=$._zod.def;if(w.type="object",I.target==="draft-07"||I.target==="draft-2020-12")w.propertyNames=G$(X.keyType,I,{...b,path:[...b.path,"propertyNames"]});w.additionalProperties=G$(X.valueType,I,{...b,path:[...b.path,"additionalProperties"]})},f5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.innerType,I,b),D=I.seen.get($);if(I.target==="openapi-3.0")D.ref=w.innerType,U.nullable=!0;else U.anyOf=[X,{type:"null"}]},y5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},u5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.default=JSON.parse(JSON.stringify(w.defaultValue))},l5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);if(X.ref=w.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(w.defaultValue))},c5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType;let D;try{D=w.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=D},m5=($,I,U,b)=>{let w=$._zod.def,X=I.io==="input"?w.in._zod.def.type==="transform"?w.out:w.in:w.out;G$(X,I,b);let D=I.seen.get($);D.ref=X},r5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},n5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},i5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},o5=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},tX={string:N5,number:Y5,boolean:B5,bigint:J5,symbol:H5,null:A5,undefined:O5,void:z5,never:L5,any:K5,unknown:v5,date:V5,enum:q5,literal:F5,nan:M5,template_literal:j5,file:E5,success:S5,custom:P5,function:k5,transform:R5,map:T5,set:_5,array:Z5,object:C5,union:aX,intersection:g5,tuple:x5,record:h5,nullable:f5,nonoptional:y5,default:u5,prefault:l5,catch:c5,pipe:m5,readonly:r5,promise:n5,optional:i5,lazy:o5};function eX($,I){if("_idmap"in $){let b=$,w=g4({...I,processors:tX}),X={};for(let Q of b._idmap.entries()){let[G,N]=Q;G$(N,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,N]=Q;x4(w,N),D[G]=h4(w,N)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=g4({...I,processors:tX});return G$($,U),x4(U,$),h4(U,$)}class d5{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=g4({processors:tX,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return G$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}x4(this.ctx,$);let U=h4(this.ctx,$),{"~standard":b,...w}=U;return w}}var Vq={};var W0={};v6(W0,{xor:()=>JF,xid:()=>xq,void:()=>WF,uuidv7:()=>Pq,uuidv6:()=>Sq,uuidv4:()=>Eq,uuid:()=>jq,url:()=>kq,unknown:()=>N1,union:()=>jD,undefined:()=>XF,ulid:()=>gq,uint64:()=>wF,uint32:()=>$F,tuple:()=>PB,transform:()=>SD,templateLiteral:()=>EF,symbol:()=>bF,superRefine:()=>sB,success:()=>FF,stringbool:()=>CF,stringFormat:()=>oq,string:()=>bD,strictObject:()=>YF,set:()=>LF,refine:()=>eB,record:()=>kB,readonly:()=>iB,promise:()=>SF,preprocess:()=>xF,prefault:()=>yB,pipe:()=>Y0,partialRecord:()=>AF,optional:()=>G0,object:()=>NF,number:()=>BB,nullish:()=>qF,nullable:()=>N0,null:()=>zB,nonoptional:()=>uB,never:()=>MD,nativeEnum:()=>KF,nanoid:()=>_q,nan:()=>MF,meta:()=>_F,map:()=>zF,mac:()=>yq,looseRecord:()=>OF,looseObject:()=>BF,literal:()=>vF,lazy:()=>pB,ksuid:()=>hq,keyof:()=>GF,jwt:()=>iq,json:()=>gF,ipv6:()=>uq,ipv4:()=>fq,intersection:()=>EB,int64:()=>UF,int32:()=>sq,int:()=>XD,instanceof:()=>ZF,httpUrl:()=>Rq,hostname:()=>dq,hex:()=>pq,hash:()=>tq,guid:()=>Mq,function:()=>PF,float64:()=>eq,float32:()=>aq,file:()=>VF,enum:()=>ED,emoji:()=>Tq,email:()=>Fq,e164:()=>nq,discriminatedUnion:()=>HF,describe:()=>TF,date:()=>QF,custom:()=>RF,cuid2:()=>Cq,cuid:()=>Zq,codec:()=>jF,cidrv6:()=>cq,cidrv4:()=>lq,check:()=>kF,catch:()=>mB,boolean:()=>JB,bigint:()=>IF,base64url:()=>rq,base64:()=>mq,array:()=>H0,any:()=>DF,_function:()=>PF,_default:()=>hB,_ZodString:()=>DD,ZodXor:()=>FB,ZodXID:()=>JD,ZodVoid:()=>VB,ZodUnknown:()=>KB,ZodUnion:()=>O0,ZodUndefined:()=>AB,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>BD,ZodType:()=>t,ZodTuple:()=>SB,ZodTransform:()=>CB,ZodTemplateLiteral:()=>oB,ZodSymbol:()=>HB,ZodSuccess:()=>lB,ZodStringFormat:()=>J$,ZodString:()=>AI,ZodSet:()=>TB,ZodRecord:()=>z0,ZodReadonly:()=>nB,ZodPromise:()=>tB,ZodPrefault:()=>fB,ZodPipe:()=>RD,ZodOptional:()=>PD,ZodObject:()=>A0,ZodNumberFormat:()=>Y1,ZodNumber:()=>zI,ZodNullable:()=>gB,ZodNull:()=>OB,ZodNonOptional:()=>kD,ZodNever:()=>vB,ZodNanoID:()=>GD,ZodNaN:()=>rB,ZodMap:()=>RB,ZodMAC:()=>YB,ZodLiteral:()=>_B,ZodLazy:()=>dB,ZodKSUID:()=>HD,ZodJWT:()=>qD,ZodIntersection:()=>jB,ZodIPv6:()=>OD,ZodIPv4:()=>AD,ZodGUID:()=>Q0,ZodFunction:()=>aB,ZodFile:()=>ZB,ZodEnum:()=>HI,ZodEmoji:()=>QD,ZodEmail:()=>WD,ZodE164:()=>VD,ZodDiscriminatedUnion:()=>MB,ZodDefault:()=>xB,ZodDate:()=>J0,ZodCustomStringFormat:()=>OI,ZodCustom:()=>L0,ZodCodec:()=>TD,ZodCatch:()=>cB,ZodCUID2:()=>YD,ZodCUID:()=>ND,ZodCIDRv6:()=>LD,ZodCIDRv4:()=>zD,ZodBoolean:()=>LI,ZodBigIntFormat:()=>FD,ZodBigInt:()=>KI,ZodBase64URL:()=>vD,ZodBase64:()=>KD,ZodArray:()=>qB,ZodAny:()=>LB});var sX={};v6(sX,{uppercase:()=>II,trim:()=>WI,toUpperCase:()=>GI,toLowerCase:()=>QI,startsWith:()=>wI,slugify:()=>NI,size:()=>e1,regex:()=>s1,property:()=>pX,positive:()=>nX,overwrite:()=>Z6,normalize:()=>DI,nonpositive:()=>oX,nonnegative:()=>dX,negative:()=>iX,multipleOf:()=>Z4,minSize:()=>C4,minLength:()=>b4,mime:()=>XI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>N6,lt:()=>r6,lowercase:()=>$I,length:()=>G1,includes:()=>UI,gte:()=>p$,gt:()=>n6,endsWith:()=>bI});var JI={};v6(JI,{time:()=>a5,duration:()=>e5,datetime:()=>p5,date:()=>t5,ZodISOTime:()=>UD,ZodISODuration:()=>wD,ZodISODateTime:()=>$D,ZodISODate:()=>ID});var $D=z("ZodISODateTime",($,I)=>{ZN.init($,I),J$.init($,I)});function p5($){return P7($D,$)}var ID=z("ZodISODate",($,I)=>{CN.init($,I),J$.init($,I)});function t5($){return k7(ID,$)}var UD=z("ZodISOTime",($,I)=>{gN.init($,I),J$.init($,I)});function a5($){return R7(UD,$)}var wD=z("ZodISODuration",($,I)=>{xN.init($,I),J$.init($,I)});function e5($){return T7(wD,$)}var qq=($,I)=>{nU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>oU($,U)},flatten:{value:(U)=>iU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,r1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,r1,2)}},isEmpty:{get(){return $.issues.length===0}}})},ty=z("ZodError",qq),b6=z("ZodError",qq,{Parent:Error});var s5=o1(b6),$B=d1(b6),IB=p1(b6),UB=t1(b6),wB=bX(b6),bB=XX(b6),XB=DX(b6),DB=WX(b6),WB=QX(b6),QB=GX(b6),GB=NX(b6),NB=YX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:BI($,"input"),output:BI($,"output")}}),$.toJSONSchema=G5($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(E.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}))},$.clone=(U,b)=>o$($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>s5($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>IB($,U,b),$.parseAsync=async(U,b)=>$B($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>UB($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>wB($,U,b),$.decode=(U,b)=>bB($,U,b),$.encodeAsync=async(U,b)=>XB($,U,b),$.decodeAsync=async(U,b)=>DB($,U,b),$.safeEncode=(U,b)=>WB($,U,b),$.safeDecode=(U,b)=>QB($,U,b),$.safeEncodeAsync=async(U,b)=>GB($,U,b),$.safeDecodeAsync=async(U,b)=>NB($,U,b),$.refine=(U,b)=>$.check(eB(U,b)),$.superRefine=(U)=>$.check(sB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>G0($),$.nullable=()=>N0($),$.nullish=()=>G0(N0($)),$.nonoptional=(U)=>uB($,U),$.array=()=>H0($),$.or=(U)=>jD([$,U]),$.and=(U)=>EB($,U),$.transform=(U)=>Y0($,SD(U)),$.default=(U)=>hB($,U),$.prefault=(U)=>yB($,U),$.catch=(U)=>mB($,U),$.pipe=(U)=>Y0($,U),$.readonly=()=>iB($),$.describe=(U)=>{let b=$.clone();return d$.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let b=$.clone();return d$.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),DD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>N5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(s1(...b)),$.includes=(...b)=>$.check(UI(...b)),$.startsWith=(...b)=>$.check(wI(...b)),$.endsWith=(...b)=>$.check(bI(...b)),$.min=(...b)=>$.check(b4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(b4(1,...b)),$.lowercase=(b)=>$.check($I(b)),$.uppercase=(b)=>$.check(II(b)),$.trim=()=>$.check(WI()),$.normalize=(...b)=>$.check(DI(...b)),$.toLowerCase=()=>$.check(QI()),$.toUpperCase=()=>$.check(GI()),$.slugify=()=>$.check(NI())}),AI=z("ZodString",($,I)=>{D1.init($,I),DD.init($,I),$.email=(U)=>$.check(jX(WD,U)),$.url=(U)=>$.check(D0(B0,U)),$.jwt=(U)=>$.check(rX(qD,U)),$.emoji=(U)=>$.check(RX(QD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.uuid=(U)=>$.check(EX(i6,U)),$.uuidv4=(U)=>$.check(SX(i6,U)),$.uuidv6=(U)=>$.check(PX(i6,U)),$.uuidv7=(U)=>$.check(kX(i6,U)),$.nanoid=(U)=>$.check(TX(GD,U)),$.guid=(U)=>$.check(X0(Q0,U)),$.cuid=(U)=>$.check(_X(ND,U)),$.cuid2=(U)=>$.check(ZX(YD,U)),$.ulid=(U)=>$.check(CX(BD,U)),$.base64=(U)=>$.check(lX(KD,U)),$.base64url=(U)=>$.check(cX(vD,U)),$.xid=(U)=>$.check(gX(JD,U)),$.ksuid=(U)=>$.check(xX(HD,U)),$.ipv4=(U)=>$.check(hX(AD,U)),$.ipv6=(U)=>$.check(fX(OD,U)),$.cidrv4=(U)=>$.check(yX(zD,U)),$.cidrv6=(U)=>$.check(uX(LD,U)),$.e164=(U)=>$.check(mX(VD,U)),$.datetime=(U)=>$.check(p5(U)),$.date=(U)=>$.check(t5(U)),$.time=(U)=>$.check(a5(U)),$.duration=(U)=>$.check(e5(U))});function bD($){return M7(AI,$)}var J$=z("ZodStringFormat",($,I)=>{B$.init($,I),DD.init($,I)}),WD=z("ZodEmail",($,I)=>{MN.init($,I),J$.init($,I)});function Fq($){return jX(WD,$)}var Q0=z("ZodGUID",($,I)=>{qN.init($,I),J$.init($,I)});function Mq($){return X0(Q0,$)}var i6=z("ZodUUID",($,I)=>{FN.init($,I),J$.init($,I)});function jq($){return EX(i6,$)}function Eq($){return SX(i6,$)}function Sq($){return PX(i6,$)}function Pq($){return kX(i6,$)}var B0=z("ZodURL",($,I)=>{jN.init($,I),J$.init($,I)});function kq($){return D0(B0,$)}function Rq($){return D0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var QD=z("ZodEmoji",($,I)=>{EN.init($,I),J$.init($,I)});function Tq($){return RX(QD,$)}var GD=z("ZodNanoID",($,I)=>{SN.init($,I),J$.init($,I)});function _q($){return TX(GD,$)}var ND=z("ZodCUID",($,I)=>{PN.init($,I),J$.init($,I)});function Zq($){return _X(ND,$)}var YD=z("ZodCUID2",($,I)=>{kN.init($,I),J$.init($,I)});function Cq($){return ZX(YD,$)}var BD=z("ZodULID",($,I)=>{RN.init($,I),J$.init($,I)});function gq($){return CX(BD,$)}var JD=z("ZodXID",($,I)=>{TN.init($,I),J$.init($,I)});function xq($){return gX(JD,$)}var HD=z("ZodKSUID",($,I)=>{_N.init($,I),J$.init($,I)});function hq($){return xX(HD,$)}var AD=z("ZodIPv4",($,I)=>{hN.init($,I),J$.init($,I)});function fq($){return hX(AD,$)}var YB=z("ZodMAC",($,I)=>{yN.init($,I),J$.init($,I)});function yq($){return E7(YB,$)}var OD=z("ZodIPv6",($,I)=>{fN.init($,I),J$.init($,I)});function uq($){return fX(OD,$)}var zD=z("ZodCIDRv4",($,I)=>{uN.init($,I),J$.init($,I)});function lq($){return yX(zD,$)}var LD=z("ZodCIDRv6",($,I)=>{lN.init($,I),J$.init($,I)});function cq($){return uX(LD,$)}var KD=z("ZodBase64",($,I)=>{mN.init($,I),J$.init($,I)});function mq($){return lX(KD,$)}var vD=z("ZodBase64URL",($,I)=>{rN.init($,I),J$.init($,I)});function rq($){return cX(vD,$)}var VD=z("ZodE164",($,I)=>{nN.init($,I),J$.init($,I)});function nq($){return mX(VD,$)}var qD=z("ZodJWT",($,I)=>{iN.init($,I),J$.init($,I)});function iq($){return rX(qD,$)}var OI=z("ZodCustomStringFormat",($,I)=>{oN.init($,I),J$.init($,I)});function oq($,I,U={}){return YI(OI,$,I,U)}function dq($){return YI(OI,"hostname",K6.hostname,$)}function pq($){return YI(OI,"hex",K6.hex,$)}function tq($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return YI(OI,b,w,I)}var zI=z("ZodNumber",($,I)=>{VX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>Y5($,b,w,X),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.int=(b)=>$.check(XD(b)),$.safe=(b)=>$.check(XD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(N6(0,b)),$.multipleOf=(b,w)=>$.check(Z4(b,w)),$.step=(b,w)=>$.check(Z4(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function BB($){return _7(zI,$)}var Y1=z("ZodNumberFormat",($,I)=>{dN.init($,I),zI.init($,I)});function XD($){return C7(Y1,$)}function aq($){return g7(Y1,$)}function eq($){return x7(Y1,$)}function sq($){return h7(Y1,$)}function $F($){return f7(Y1,$)}var LI=z("ZodBoolean",($,I)=>{tU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>B5($,U,b,w)});function JB($){return y7(LI,$)}var KI=z("ZodBigInt",($,I)=>{qX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>J5($,b,w,X),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(N6(b,w)),$.max=(b,w)=>$.check(N6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(N6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(Z4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function IF($){return l7(KI,$)}var FD=z("ZodBigIntFormat",($,I)=>{pN.init($,I),KI.init($,I)});function UF($){return m7(FD,$)}function wF($){return r7(FD,$)}var HB=z("ZodSymbol",($,I)=>{tN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>H5($,U,b,w)});function bF($){return n7(HB,$)}var AB=z("ZodUndefined",($,I)=>{aN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>O5($,U,b,w)});function XF($){return i7(AB,$)}var OB=z("ZodNull",($,I)=>{eN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>A5($,U,b,w)});function zB($){return o7(OB,$)}var LB=z("ZodAny",($,I)=>{sN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>K5($,U,b,w)});function DF(){return d7(LB)}var KB=z("ZodUnknown",($,I)=>{$Y.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>v5($,U,b,w)});function N1(){return p7(KB)}var vB=z("ZodNever",($,I)=>{IY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>L5($,U,b,w)});function MD($){return t7(vB,$)}var VB=z("ZodVoid",($,I)=>{UY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>z5($,U,b,w)});function WF($){return a7(VB,$)}var J0=z("ZodDate",($,I)=>{wY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(N6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function QF($){return e7(J0,$)}var qB=z("ZodArray",($,I)=>{bY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(b4(U,b)),$.nonempty=(U)=>$.check(b4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function H0($,I){return I5(qB,$,I)}function GF($){let I=$._zod.def.shape;return ED(Object.keys(I))}var A0=z("ZodObject",($,I)=>{XY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ED(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:N1()}),$.loose=()=>$.clone({...$._zod.def,catchall:N1()}),$.strict=()=>$.clone({...$._zod.def,catchall:MD()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(PD,$,U[0]),$.required=(...U)=>E.required(kD,$,U[0])});function NF($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new A0(U)}function YF($,I){return new A0({type:"object",shape:$,catchall:MD(),...E.normalizeParams(I)})}function BF($,I){return new A0({type:"object",shape:$,catchall:N1(),...E.normalizeParams(I)})}var O0=z("ZodUnion",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function jD($,I){return new O0({type:"union",options:$,...E.normalizeParams(I)})}var FB=z("ZodXor",($,I)=>{O0.init($,I),DY.init($,I),$._zod.processJSONSchema=(U,b,w)=>aX($,U,b,w),$.options=I.options});function JF($,I){return new FB({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var MB=z("ZodDiscriminatedUnion",($,I)=>{O0.init($,I),WY.init($,I)});function HF($,I,U){return new MB({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var jB=z("ZodIntersection",($,I)=>{QY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function EB($,I){return new jB({type:"intersection",left:$,right:I})}var SB=z("ZodTuple",($,I)=>{FX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function PB($,I,U){let b=I instanceof o,w=b?U:I;return new SB({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var z0=z("ZodRecord",($,I)=>{GY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function kB($,I,U){return new z0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function AF($,I,U){let b=o$($);return b._zod.values=void 0,new z0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function OF($,I,U){return new z0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var RB=z("ZodMap",($,I)=>{NY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>T5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function zF($,I,U){return new RB({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var TB=z("ZodSet",($,I)=>{YY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>_5($,U,b,w),$.min=(...U)=>$.check(C4(...U)),$.nonempty=(U)=>$.check(C4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check(e1(...U))});function LF($,I){return new TB({type:"set",valueType:$,...E.normalizeParams(I)})}var HI=z("ZodEnum",($,I)=>{BY.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>q5($,b,w,X),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new HI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ED($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new HI({type:"enum",entries:U,...E.normalizeParams(I)})}function KF($,I){return new HI({type:"enum",entries:$,...E.normalizeParams(I)})}var _B=z("ZodLiteral",($,I)=>{JY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function vF($,I){return new _B({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var ZB=z("ZodFile",($,I)=>{HY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w),$.min=(U,b)=>$.check(C4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(XI(Array.isArray(U)?U:[U],b))});function VF($){return U5(ZB,$)}var CB=z("ZodTransform",($,I)=>{AY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(E.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),U.issues.push(E.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function SD($){return new CB({type:"transform",transform:$})}var PD=z("ZodOptional",($,I)=>{OY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function G0($){return new PD({type:"optional",innerType:$})}var gB=z("ZodNullable",($,I)=>{zY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new gB({type:"nullable",innerType:$})}function qF($){return G0(N0($))}var xB=z("ZodDefault",($,I)=>{LY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function hB($,I){return new xB({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var fB=z("ZodPrefault",($,I)=>{KY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function yB($,I){return new fB({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var kD=z("ZodNonOptional",($,I)=>{vY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function uB($,I){return new kD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var lB=z("ZodSuccess",($,I)=>{VY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function FF($){return new lB({type:"success",innerType:$})}var cB=z("ZodCatch",($,I)=>{qY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function mB($,I){return new cB({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var rB=z("ZodNaN",($,I)=>{FY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>M5($,U,b,w)});function MF($){return $5(rB,$)}var RD=z("ZodPipe",($,I)=>{MY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.in=I.in,$.out=I.out});function Y0($,I){return new RD({type:"pipe",in:$,out:I})}var TD=z("ZodCodec",($,I)=>{RD.init($,I),eU.init($,I)});function jF($,I,U){return new TD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var nB=z("ZodReadonly",($,I)=>{jY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function iB($){return new nB({type:"readonly",innerType:$})}var oB=z("ZodTemplateLiteral",($,I)=>{EY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function EF($,I){return new oB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var dB=z("ZodLazy",($,I)=>{kY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function pB($){return new dB({type:"lazy",getter:$})}var tB=z("ZodPromise",($,I)=>{PY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function SF($){return new tB({type:"promise",innerType:$})}var aB=z("ZodFunction",($,I)=>{SY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function PF($){return new aB({type:"function",input:Array.isArray($?.input)?PB($?.input):$?.input??H0(N1()),output:$?.output??N1()})}var L0=z("ZodCustom",($,I)=>{RY.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function kF($){let I=new A$({check:"custom"});return I._zod.check=$,I}function RF($,I){return w5(L0,$??(()=>!0),I)}function eB($,I={}){return b5(L0,$,I)}function sB($){return X5($)}var TF=D5,_F=W5;function ZF($,I={error:`Input not instance of ${$.name}`}){let U=new L0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var CF=(...$)=>Q5({Codec:TD,Boolean:LI,String:AI},...$);function gF($){let I=pB(()=>{return jD([bD($),BB(),JB(),zB(),H0(I),kB(bD(),I)])});return I}function xF($,I){return Y0(SD($),I)}var ey={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function sy($){P$({customError:$})}function $u(){return P$().customError}var $J;(function($){})($J||($J={}));var _={...W0,...sX,iso:JI};function Iu($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function Uu($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let b=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===b){let w=U[1];if(!w||!I.defs[w])throw new Error(`Reference not found: ${$}`);return I.defs[w]}throw new Error(`Reference not found: ${$}`)}function hF($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let w=$.$ref;if(I.refs.has(w))return I.refs.get(w);if(I.processing.has(w))return _.lazy(()=>{if(!I.refs.has(w))throw new Error(`Circular reference not resolved: ${w}`);return I.refs.get(w)});I.processing.add(w);let X=Uu(w,I),D=u$(X,I);return I.refs.set(w,D),I.processing.delete(w),D}if($.enum!==void 0){let w=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&w.length===1&&w[0]===null)return _.null();if(w.length===0)return _.never();if(w.length===1)return _.literal(w[0]);if(w.every((D)=>typeof D==="string"))return _.enum(w);let X=w.map((D)=>_.literal(D));if(X.length<2)return X[0];return _.union([X[0],X[1],...X.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let w=U.map((X)=>{let D={...$,type:X};return hF(D,I)});if(w.length===0)return _.never();if(w.length===1)return w[0];return _.union(w)}if(!U)return _.any();let b;switch(U){case"string":{let w=_.string();if($.format){let X=$.format;if(X==="email")w=w.check(_.email());else if(X==="uri"||X==="uri-reference")w=w.check(_.url());else if(X==="uuid"||X==="guid")w=w.check(_.uuid());else if(X==="date-time")w=w.check(_.iso.datetime());else if(X==="date")w=w.check(_.iso.date());else if(X==="time")w=w.check(_.iso.time());else if(X==="duration")w=w.check(_.iso.duration());else if(X==="ipv4")w=w.check(_.ipv4());else if(X==="ipv6")w=w.check(_.ipv6());else if(X==="mac")w=w.check(_.mac());else if(X==="cidr")w=w.check(_.cidrv4());else if(X==="cidr-v6")w=w.check(_.cidrv6());else if(X==="base64")w=w.check(_.base64());else if(X==="base64url")w=w.check(_.base64url());else if(X==="e164")w=w.check(_.e164());else if(X==="jwt")w=w.check(_.jwt());else if(X==="emoji")w=w.check(_.emoji());else if(X==="nanoid")w=w.check(_.nanoid());else if(X==="cuid")w=w.check(_.cuid());else if(X==="cuid2")w=w.check(_.cuid2());else if(X==="ulid")w=w.check(_.ulid());else if(X==="xid")w=w.check(_.xid());else if(X==="ksuid")w=w.check(_.ksuid())}if(typeof $.minLength==="number")w=w.min($.minLength);if(typeof $.maxLength==="number")w=w.max($.maxLength);if($.pattern)w=w.regex(new RegExp($.pattern));b=w;break}case"number":case"integer":{let w=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")w=w.min($.minimum);if(typeof $.maximum==="number")w=w.max($.maximum);if(typeof $.exclusiveMinimum==="number")w=w.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")w=w.gt($.minimum);if(typeof $.exclusiveMaximum==="number")w=w.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")w=w.lt($.maximum);if(typeof $.multipleOf==="number")w=w.multipleOf($.multipleOf);b=w;break}case"boolean":{b=_.boolean();break}case"null":{b=_.null();break}case"object":{let w={},X=$.properties||{},D=new Set($.required||[]);for(let[Q,G]of Object.entries(X)){let N=u$(G,I);w[Q]=D.has(Q)?N:N.optional()}if($.propertyNames){let Q=u$($.propertyNames,I),G=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(w).length===0){b=_.record(Q,G);break}let N=_.object(w).passthrough(),B=_.looseRecord(Q,G);b=_.intersection(N,B);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),N=[];for(let H of G){let J=u$(Q[H],I),A=_.string().regex(new RegExp(H));N.push(_.looseRecord(A,J))}let B=[];if(Object.keys(w).length>0)B.push(_.object(w).passthrough());if(B.push(...N),B.length===0)b=_.object({}).passthrough();else if(B.length===1)b=B[0];else{let H=_.intersection(B[0],B[1]);for(let J=2;J<B.length;J++)H=_.intersection(H,B[J]);b=H}break}let W=_.object(w);if($.additionalProperties===!1)b=W.strict();else if(typeof $.additionalProperties==="object")b=W.catchall(u$($.additionalProperties,I));else b=W.passthrough();break}case"array":{let{prefixItems:w,items:X}=$;if(w&&Array.isArray(w)){let D=w.map((Q)=>u$(Q,I)),W=X&&typeof X==="object"&&!Array.isArray(X)?u$(X,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(Array.isArray(X)){let D=X.map((Q)=>u$(Q,I)),W=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(X!==void 0){let D=u$(X,I),W=_.array(D);if(typeof $.minItems==="number")W=W.min($.minItems);if(typeof $.maxItems==="number")W=W.max($.maxItems);b=W}else b=_.array(_.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)b=b.describe($.description);if($.default!==void 0)b=b.default($.default);return b}function u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=hF($,I),b=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((D)=>u$(D,I)),X=_.union(w);U=b?_.intersection(U,X):X}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((D)=>u$(D,I)),X=_.xor(w);U=b?_.intersection(U,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=b?U:_.any();else{let w=b?U:u$($.allOf[0],I),X=b?0:1;for(let D=X;D<$.allOf.length;D++)w=_.intersection(w,u$($.allOf[D],I));U=w}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function fF($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Iu($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var IJ={};v6(IJ,{string:()=>wu,number:()=>bu,date:()=>Wu,boolean:()=>Xu,bigint:()=>Du});function wu($){return j7(AI,$)}function bu($){return Z7(zI,$)}function Xu($){return u7(LI,$)}function Du($){return c7(KI,$)}function Wu($){return s7(J0,$)}P$(sU());var D4=Y.enum(["document","record"]),_D=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],ZD=["literature","document","record","annotation","artifact"],CD=["molecule","reaction"],vI=50,gD=50;var UJ=Y.object({blockType:Y.enum(_D).default("paragraph").describe("Type of block to create. Default: paragraph"),content:Y.string().describe("Text content for the block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:Y.enum(CD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:Y.string().optional().describe("Optional description or notes for the molecule block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var Qu=Y.enum(["text","number","unit","select","boolean"]),Gu=Y.enum(["mandatory","recommended","optional"]),yF=Y.object({key:Y.string().min(1).describe("Stable column key"),label:Y.string().min(1).describe("Human-readable column label"),type:Qu.describe("Column type"),unit:Y.string().optional().describe("Optional display unit"),mandation:Gu.describe("Field importance level"),description:Y.string().optional().describe("Optional field description"),standardRef:Y.string().optional().describe("Optional ontology reference"),options:Y.array(Y.string()).optional().describe("Allowed values for select columns"),hidden:Y.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),VI=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])),uF=Y.enum(["generic","stoichiometry"]),wJ=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),kind:uF.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:Y.string().min(1).describe("Matrix label shown in the editor"),columns:Y.array(yF).max(vI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:Y.array(VI).optional().describe("Matrix rows"),nodeRef:Y.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:Y.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),K0={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var bJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rows:Y.array(VI).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),v0={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var XJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:Y.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:Y.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:Y.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),V0={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var DJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to inspect.")}),q0={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var qI=Y.enum(["procedure","characterization","observation","step"]),FI=Y.object({type:Y.literal("file"),target:Y.enum(["local","server","url"]),path:Y.string().min(1),format:Y.string().min(1),label:Y.string().min(1),instrument:Y.string().optional(),metadata:Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean()])).optional()}),lF=Y.object({artifactId:Y.string().uuid(),role:Y.enum(["input","output","derived_from","referenced"]),context:Y.record(Y.string(),Y.unknown()).optional()}),cF=Y.object({matrixId:Y.string().uuid()}),F0=Y.object({tempId:Y.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:Y.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:Y.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:Y.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:Y.array(lF).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:Y.array(cF).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var mF=Y.enum(["replace","append"]),WJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:Y.array(F0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:mF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:Y.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:Y.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),M0={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var QJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new document"),content:Y.string().optional().describe("Optional initial content in markdown format"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:Y.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:Y.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document.")}),j0={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format."};var GJ=Y.object({title:Y.string().min(1).max(500).describe("Paper title"),doi:Y.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:Y.array(Y.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:Y.string().optional().describe("Journal name"),year:Y.number().int().positive().optional().describe("Publication year"),sourceUrl:Y.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:Y.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:Y.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:Y.string().uuid().optional().describe("Space within workspace"),fetchFullText:Y.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation.")}),E0={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library."};var rF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Nu=["molecule","material","mixture","biomacromolecule"],d$$=Y.enum(Nu),nF=["active","depleted","archived","draft"],xD=Y.enum(rF),MI=Y.enum(nF),Yu=Y.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),NJ=Y.object({id:Y.string().uuid().describe("UUID of the artifact to update."),name:Y.string().min(1).optional().describe("Display name (skip to keep existing)."),description:Y.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:Y.array(Y.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:Yu.optional(),artifactType:xD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:MI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:Y.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId)."}),S0={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var iF=Y.object({cid:Y.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:Y.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:Y.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),YJ=Y.object({name:Y.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:xD.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:Y.string().optional().describe("Plain-text description."),tags:Y.array(Y.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:Y.record(Y.string(),Y.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → transformation_class (required: molecular | sol_gel | polymerization | crystallization | self_assembly | mechanochemistry | biological | other), transformation_summary (free-text for non-molecular), rxn_smiles (molecular only), precursor_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:MI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:Y.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:Y.string().optional().describe("Free-form physical/logical location."),parentId:Y.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:Y.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:Y.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:iF.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:Y.object({nodeId:Y.string().uuid(),role:Y.enum(["input","output","derived_from","referenced"]),context:Y.record(Y.string(),Y.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),P0={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.transformation_class` — one of: molecular, sol_gel, polymerization, crystallization, self_assembly, mechanochemistry, biological, other. For `molecular` reactions also supply `rxn_smiles`. For everything else write a short `transformation_summary` describing what is actually happening. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var BJ=Y.object({title:Y.string().min(1).max(500).describe("Title for the new record."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:Y.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:Y.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:Y.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:Y.array(Y.string().uuid()).optional().describe("User ids participating in this research activity."),initialTree:Y.array(F0).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),k0={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page."].join(" ")};var JJ=Y.object({recordId:Y.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),R0={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var HJ=Y.object({reactionArtifactId:Y.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:Y.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:Y.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:Y.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:Y.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"`, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),label:Y.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),T0={name:"create_matrix_from_reaction_artifact",description:["Derive a stoichiometry matrix from a saved reaction artifact. Walks the artifact's `linkSlots` (typed component slots: reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one matrix row per bound slot using the slot's stoichCoefficient. Stamps `derivedFromArtifactId` on the matrix for provenance.","Frozen invariant: edits to the artifact never propagate forward to the spawned matrix; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Slots without a `defaultArtifactId` are skipped (no row emitted). The user can fill in those rows by hand on the derived matrix.","Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var hD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().optional().describe("Block ID to delete (for single delete)"),blockIds:Y.array(Y.string()).max(gD).optional().describe(`Array of block IDs to delete (batch mode, max ${gD})`)}),Bu=hD.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),_0={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var AJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the matrix to delete."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),Z0={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var Ju=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),OJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),rowIndices:Y.array(Y.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:Ju.optional(),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),C0={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var zJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:Y.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),g0={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var LJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:Y.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:Y.string().min(1).describe("Human-readable node label."),type:qI.describe("Node type."),afterNodeId:Y.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:Y.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:Y.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:Y.array(FI).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),x0={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var KJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),nodeRef:Y.union([Y.string().uuid(),Y.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),h0={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var vJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:Y.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:Y.enum(["input","output","derived_from","referenced"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). `derived_from` = this step's design/procedure was adapted from the artifact (e.g., reaction artifact serving as the recipe template). `referenced` = the step references the artifact without consuming or producing it (e.g., a reaction artifact, equipment manual, or literature item it documents). Pick by direction of flow / nature of the relationship."),context:Y.record(Y.string(),Y.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),f0={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step), `output` (produced/generated), `derived_from` (this step adapts another artifact as its recipe — e.g., a reaction artifact serving as the procedure template), `referenced` (the step references the artifact without consuming/producing — e.g., equipment manuals, literature, reaction artifacts). Pick by direction of flow / nature of the relationship.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var VJ=Y.object({linkId:Y.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),y0={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var qJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),u0={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var oF=Y.object({nodeId:Y.string().uuid().describe("UUID of the node to move/reorder."),parentId:Y.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:Y.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),FJ=Y.object({recordId:Y.string().uuid().describe("Target record UUID. Must be in draft status."),moves:Y.array(oF).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),l0={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var Hu=Y.record(Y.string(),Y.union([Y.string(),Y.number(),Y.boolean(),Y.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),Au=Y.object({rowIndex:Y.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:Hu.optional(),values:VI.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),MJ=Y.object({matrixId:Y.string().uuid().describe("UUID of the target data_matrix."),updates:Y.array(Au).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:Y.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),c0={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var jJ=Y.object({nodeId:Y.string().uuid().describe("UUID of the existing procedure node to update."),label:Y.string().min(1).optional().describe("New label (skip to keep existing)."),type:qI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:Y.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:Y.array(FI).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),m0={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function fD($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function tF($,I,U=150){let b=0,w=Math.min($.length,I.length);while(b<w&&$[b]===I[b])b++;let X=0;while(X<w-b&&$.at(1+X)===I.at(1+X))X++;let D=Math.floor(U/2),W=Math.max(0,b-D),Q=Math.min($.length,$.length-X+D),G=Math.min(I.length,I.length-X+D),N=W>0?"...":"",B=Q<$.length?"...":"",H=G<I.length?"...":"",J=`${N}${$.slice(W,Q)}${B}`,A=`${N}${I.slice(W,G)}${H}`;return`--- before
65
- ${J}
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of $.seen.entries()){let D=X[1];if(I===X[0]){w(X);continue}if($.external){let Q=$.external.registry.get(X[0])?.id;if(I!==X[0]&&Q){w(X);continue}}if($.metadataRegistry.get(X[0])?.id){w(X);continue}if(D.cycle){w(X);continue}if(D.count>1){if($.reused==="ref"){w(X);continue}}}}function f4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let b=(D)=>{let W=$.seen.get(D),Q=W.def??W.schema,G={...Q};if(W.ref===null)return;let Y=W.ref;if(W.ref=null,Y){b(Y);let J=$.seen.get(Y).schema;if(J.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))Q.allOf=Q.allOf??[],Q.allOf.push(J);else Object.assign(Q,J),Object.assign(Q,G)}if(!W.isParent)$.override({zodSchema:D,jsonSchema:Q,path:W.path??[]})};for(let D of[...$.seen.entries()].reverse())b(D[0]);let w={};if($.target==="draft-2020-12")w.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")w.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")w.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let D=$.external.registry.get(I)?.id;if(!D)throw new Error("Schema is missing an `id` property");w.$id=$.external.uri(D)}Object.assign(w,U.def??U.schema);let X=$.external?.defs??{};for(let D of $.seen.entries()){let W=D[1];if(W.def&&W.defId)X[W.defId]=W.def}if($.external);else if(Object.keys(X).length>0)if($.target==="draft-2020-12")w.$defs=X;else w.definitions=X;try{let D=JSON.parse(JSON.stringify(w));return Object.defineProperty(D,"~standard",{value:{...I["~standard"],jsonSchema:{input:HI(I,"input"),output:HI(I,"output")}},enumerable:!1,writable:!1}),D}catch(D){throw new Error("Error converting schema to JSON.")}}function t$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let b=$._zod.def;if(b.type==="transform")return!0;if(b.type==="array")return t$(b.element,U);if(b.type==="set")return t$(b.valueType,U);if(b.type==="lazy")return t$(b.getter(),U);if(b.type==="promise"||b.type==="optional"||b.type==="nonoptional"||b.type==="nullable"||b.type==="readonly"||b.type==="default"||b.type==="prefault")return t$(b.innerType,U);if(b.type==="intersection")return t$(b.left,U)||t$(b.right,U);if(b.type==="record"||b.type==="map")return t$(b.keyType,U)||t$(b.valueType,U);if(b.type==="pipe")return t$(b.in,U)||t$(b.out,U);if(b.type==="object"){for(let w in b.shape)if(t$(b.shape[w],U))return!0;return!1}if(b.type==="union"){for(let w of b.options)if(t$(w,U))return!0;return!1}if(b.type==="tuple"){for(let w of b.items)if(t$(w,U))return!0;if(b.rest&&t$(b.rest,U))return!0;return!1}return!1}var K5=($,I={})=>(U)=>{let b=x4({...U,processors:I});return G$($,b),h4(b,$),f4(b,$)},HI=($,I)=>(U)=>{let{libraryOptions:b,target:w}=U??{},X=x4({...b??{},target:w,io:I,processors:{}});return G$($,X),h4(X,$),f4(X,$)};var Ju={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v5=($,I,U,b)=>{let w=U;w.type="string";let{minimum:X,maximum:D,format:W,patterns:Q,contentEncoding:G}=$._zod.bag;if(typeof X==="number")w.minLength=X;if(typeof D==="number")w.maxLength=D;if(W){if(w.format=Ju[W]??W,w.format==="")delete w.format}if(G)w.contentEncoding=G;if(Q&&Q.size>0){let Y=[...Q];if(Y.length===1)w.pattern=Y[0].source;else if(Y.length>1)w.allOf=[...Y.map((J)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:J.source}))]}},V5=($,I,U,b)=>{let w=U,{minimum:X,maximum:D,format:W,multipleOf:Q,exclusiveMaximum:G,exclusiveMinimum:Y}=$._zod.bag;if(typeof W==="string"&&W.includes("int"))w.type="integer";else w.type="number";if(typeof Y==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.minimum=Y,w.exclusiveMinimum=!0;else w.exclusiveMinimum=Y;if(typeof X==="number"){if(w.minimum=X,typeof Y==="number"&&I.target!=="draft-04")if(Y>=X)delete w.minimum;else delete w.exclusiveMinimum}if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")w.maximum=G,w.exclusiveMaximum=!0;else w.exclusiveMaximum=G;if(typeof D==="number"){if(w.maximum=D,typeof G==="number"&&I.target!=="draft-04")if(G<=D)delete w.maximum;else delete w.exclusiveMaximum}if(typeof Q==="number")w.multipleOf=Q},q5=($,I,U,b)=>{U.type="boolean"},M5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},F5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},j5=($,I,U,b)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},E5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},S5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},P5=($,I,U,b)=>{U.not={}},k5=($,I,U,b)=>{},R5=($,I,U,b)=>{},T5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},_5=($,I,U,b)=>{let w=$._zod.def,X=lU(w.entries);if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";U.enum=X},Z5=($,I,U,b)=>{let w=$._zod.def,X=[];for(let D of w.values)if(D===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else X.push(Number(D));else X.push(D);if(X.length===0);else if(X.length===1){let D=X[0];if(U.type=D===null?"null":typeof D,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[D];else U.const=D}else{if(X.every((D)=>typeof D==="number"))U.type="number";if(X.every((D)=>typeof D==="string"))U.type="string";if(X.every((D)=>typeof D==="boolean"))U.type="boolean";if(X.every((D)=>D===null))U.type="null";U.enum=X}},C5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},g5=($,I,U,b)=>{let w=U,X=$._zod.pattern;if(!X)throw new Error("Pattern not found in template literal");w.type="string",w.pattern=X.source},x5=($,I,U,b)=>{let w=U,X={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:W,mime:Q}=$._zod.bag;if(D!==void 0)X.minLength=D;if(W!==void 0)X.maxLength=W;if(Q)if(Q.length===1)X.contentMediaType=Q[0],Object.assign(w,X);else w.anyOf=Q.map((G)=>{return{...X,contentMediaType:G}});else Object.assign(w,X)},h5=($,I,U,b)=>{U.type="boolean"},f5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},y5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},u5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},l5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},c5=($,I,U,b)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},m5=($,I,U,b)=>{let w=U,X=$._zod.def,{minimum:D,maximum:W}=$._zod.bag;if(typeof D==="number")w.minItems=D;if(typeof W==="number")w.maxItems=W;w.type="array",w.items=G$(X.element,I,{...b,path:[...b.path,"items"]})},r5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="object",w.properties={};let D=X.shape;for(let G in D)w.properties[G]=G$(D[G],I,{...b,path:[...b.path,"properties",G]});let W=new Set(Object.keys(D)),Q=new Set([...W].filter((G)=>{let Y=X.shape[G]._zod;if(I.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(Q.size>0)w.required=Array.from(Q);if(X.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!X.catchall){if(I.io==="output")w.additionalProperties=!1}else if(X.catchall)w.additionalProperties=G$(X.catchall,I,{...b,path:[...b.path,"additionalProperties"]})},bD=($,I,U,b)=>{let w=$._zod.def,X=w.inclusive===!1,D=w.options.map((W,Q)=>G$(W,I,{...b,path:[...b.path,X?"oneOf":"anyOf",Q]}));if(X)U.oneOf=D;else U.anyOf=D},n5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.left,I,{...b,path:[...b.path,"allOf",0]}),D=G$(w.right,I,{...b,path:[...b.path,"allOf",1]}),W=(G)=>("allOf"in G)&&Object.keys(G).length===1,Q=[...W(X)?X.allOf:[X],...W(D)?D.allOf:[D]];U.allOf=Q},i5=($,I,U,b)=>{let w=U,X=$._zod.def;w.type="array";let D=I.target==="draft-2020-12"?"prefixItems":"items",W=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",Q=X.items.map((H,B)=>G$(H,I,{...b,path:[...b.path,D,B]})),G=X.rest?G$(X.rest,I,{...b,path:[...b.path,W,...I.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(w.prefixItems=Q,G)w.items=G}else if(I.target==="openapi-3.0"){if(w.items={anyOf:Q},G)w.items.anyOf.push(G);if(w.minItems=Q.length,!G)w.maxItems=Q.length}else if(w.items=Q,G)w.additionalItems=G;let{minimum:Y,maximum:J}=$._zod.bag;if(typeof Y==="number")w.minItems=Y;if(typeof J==="number")w.maxItems=J},o5=($,I,U,b)=>{let w=U,X=$._zod.def;if(w.type="object",I.target==="draft-07"||I.target==="draft-2020-12")w.propertyNames=G$(X.keyType,I,{...b,path:[...b.path,"propertyNames"]});w.additionalProperties=G$(X.valueType,I,{...b,path:[...b.path,"additionalProperties"]})},d5=($,I,U,b)=>{let w=$._zod.def,X=G$(w.innerType,I,b),D=I.seen.get($);if(I.target==="openapi-3.0")D.ref=w.innerType,U.nullable=!0;else U.anyOf=[X,{type:"null"}]},p5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},t5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.default=JSON.parse(JSON.stringify(w.defaultValue))},a5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);if(X.ref=w.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(w.defaultValue))},e5=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType;let D;try{D=w.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=D},s5=($,I,U,b)=>{let w=$._zod.def,X=I.io==="input"?w.in._zod.def.type==="transform"?w.out:w.in:w.out;G$(X,I,b);let D=I.seen.get($);D.ref=X},$J=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType,U.readOnly=!0},IJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},UJ=($,I,U,b)=>{let w=$._zod.def;G$(w.innerType,I,b);let X=I.seen.get($);X.ref=w.innerType},wJ=($,I,U,b)=>{let w=$._zod.innerType;G$(w,I,b);let X=I.seen.get($);X.ref=w},wD={string:v5,number:V5,boolean:q5,bigint:M5,symbol:F5,null:j5,undefined:E5,void:S5,never:P5,any:k5,unknown:R5,date:T5,enum:_5,literal:Z5,nan:C5,template_literal:g5,file:x5,success:h5,custom:f5,function:y5,transform:u5,map:l5,set:c5,array:m5,object:r5,union:bD,intersection:n5,tuple:i5,record:o5,nullable:d5,nonoptional:p5,default:t5,prefault:a5,catch:e5,pipe:s5,readonly:$J,promise:IJ,optional:UJ,lazy:wJ};function XD($,I){if("_idmap"in $){let b=$,w=x4({...I,processors:wD}),X={};for(let Q of b._idmap.entries()){let[G,Y]=Q;G$(Y,w)}let D={},W={registry:b,uri:I?.uri,defs:X};w.external=W;for(let Q of b._idmap.entries()){let[G,Y]=Q;h4(w,Y),D[G]=f4(w,Y)}if(Object.keys(X).length>0){let Q=w.target==="draft-2020-12"?"$defs":"definitions";D.__shared={[Q]:X}}return{schemas:D}}let U=x4({...I,processors:wD});return G$($,U),h4(U,$),f4(U,$)}class bJ{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=x4({processors:wD,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return G$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}h4(this.ctx,$);let U=f4(this.ctx,$),{"~standard":b,...w}=U;return w}}var hq={};var Q0={};v6(Q0,{xor:()=>kM,xid:()=>eq,void:()=>MM,uuidv7:()=>rq,uuidv6:()=>mq,uuidv4:()=>cq,uuid:()=>lq,url:()=>nq,unknown:()=>Y1,union:()=>_D,undefined:()=>VM,ulid:()=>aq,uint64:()=>KM,uint32:()=>OM,tuple:()=>fJ,transform:()=>CD,templateLiteral:()=>cM,symbol:()=>vM,superRefine:()=>GB,success:()=>yM,stringbool:()=>tM,stringFormat:()=>GM,string:()=>ND,strictObject:()=>SM,set:()=>CM,refine:()=>QB,record:()=>yJ,readonly:()=>UB,promise:()=>mM,preprocess:()=>eM,prefault:()=>pJ,pipe:()=>J0,partialRecord:()=>TM,optional:()=>Y0,object:()=>EM,number:()=>qJ,nullish:()=>fM,nullable:()=>N0,null:()=>SJ,nonoptional:()=>tJ,never:()=>TD,nativeEnum:()=>gM,nanoid:()=>dq,nan:()=>uM,meta:()=>dM,map:()=>ZM,mac:()=>IM,looseRecord:()=>_M,looseObject:()=>PM,literal:()=>xM,lazy:()=>XB,ksuid:()=>sq,keyof:()=>jM,jwt:()=>QM,json:()=>aM,ipv6:()=>UM,ipv4:()=>$M,intersection:()=>xJ,int64:()=>LM,int32:()=>AM,int:()=>JD,instanceof:()=>pM,httpUrl:()=>iq,hostname:()=>YM,hex:()=>NM,hash:()=>JM,guid:()=>uq,function:()=>rM,float64:()=>HM,float32:()=>BM,file:()=>hM,enum:()=>ZD,emoji:()=>oq,email:()=>yq,e164:()=>WM,discriminatedUnion:()=>RM,describe:()=>oM,date:()=>FM,custom:()=>iM,cuid2:()=>tq,cuid:()=>pq,codec:()=>lM,cidrv6:()=>bM,cidrv4:()=>wM,check:()=>nM,catch:()=>sJ,boolean:()=>MJ,bigint:()=>zM,base64url:()=>DM,base64:()=>XM,array:()=>A0,any:()=>qM,_function:()=>rM,_default:()=>oJ,_ZodString:()=>BD,ZodXor:()=>ZJ,ZodXID:()=>vD,ZodVoid:()=>TJ,ZodUnknown:()=>kJ,ZodUnion:()=>z0,ZodUndefined:()=>jJ,ZodUUID:()=>i6,ZodURL:()=>B0,ZodULID:()=>KD,ZodType:()=>t,ZodTuple:()=>hJ,ZodTransform:()=>rJ,ZodTemplateLiteral:()=>wB,ZodSymbol:()=>FJ,ZodSuccess:()=>aJ,ZodStringFormat:()=>B$,ZodString:()=>zI,ZodSet:()=>lJ,ZodRecord:()=>L0,ZodReadonly:()=>IB,ZodPromise:()=>DB,ZodPrefault:()=>dJ,ZodPipe:()=>hD,ZodOptional:()=>gD,ZodObject:()=>O0,ZodNumberFormat:()=>N1,ZodNumber:()=>KI,ZodNullable:()=>nJ,ZodNull:()=>EJ,ZodNonOptional:()=>xD,ZodNever:()=>RJ,ZodNanoID:()=>OD,ZodNaN:()=>$B,ZodMap:()=>uJ,ZodMAC:()=>VJ,ZodLiteral:()=>cJ,ZodLazy:()=>bB,ZodKSUID:()=>VD,ZodJWT:()=>kD,ZodIntersection:()=>gJ,ZodIPv6:()=>MD,ZodIPv4:()=>qD,ZodGUID:()=>G0,ZodFunction:()=>WB,ZodFile:()=>mJ,ZodEnum:()=>OI,ZodEmoji:()=>AD,ZodEmail:()=>HD,ZodE164:()=>PD,ZodDiscriminatedUnion:()=>CJ,ZodDefault:()=>iJ,ZodDate:()=>H0,ZodCustomStringFormat:()=>LI,ZodCustom:()=>K0,ZodCodec:()=>fD,ZodCatch:()=>eJ,ZodCUID2:()=>LD,ZodCUID:()=>zD,ZodCIDRv6:()=>jD,ZodCIDRv4:()=>FD,ZodBoolean:()=>vI,ZodBigIntFormat:()=>RD,ZodBigInt:()=>VI,ZodBase64URL:()=>SD,ZodBase64:()=>ED,ZodArray:()=>_J,ZodAny:()=>PJ});var DD={};v6(DD,{uppercase:()=>wI,trim:()=>GI,toUpperCase:()=>NI,toLowerCase:()=>YI,startsWith:()=>XI,slugify:()=>JI,size:()=>$I,regex:()=>II,property:()=>UD,positive:()=>eX,overwrite:()=>Z6,normalize:()=>QI,nonpositive:()=>$D,nonnegative:()=>ID,negative:()=>sX,multipleOf:()=>C4,minSize:()=>g4,minLength:()=>X4,mime:()=>WI,maxSize:()=>W1,maxLength:()=>Q1,lte:()=>Y6,lt:()=>r6,lowercase:()=>UI,length:()=>G1,includes:()=>bI,gte:()=>p$,gt:()=>n6,endsWith:()=>DI});var AI={};v6(AI,{time:()=>WJ,duration:()=>QJ,datetime:()=>XJ,date:()=>DJ,ZodISOTime:()=>GD,ZodISODuration:()=>YD,ZodISODateTime:()=>WD,ZodISODate:()=>QD});var WD=z("ZodISODateTime",($,I)=>{mY.init($,I),B$.init($,I)});function XJ($){return f7(WD,$)}var QD=z("ZodISODate",($,I)=>{rY.init($,I),B$.init($,I)});function DJ($){return y7(QD,$)}var GD=z("ZodISOTime",($,I)=>{nY.init($,I),B$.init($,I)});function WJ($){return u7(GD,$)}var YD=z("ZodISODuration",($,I)=>{iY.init($,I),B$.init($,I)});function QJ($){return l7(YD,$)}var fq=($,I)=>{iU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>dU($,U)},flatten:{value:(U)=>oU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,i1,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,i1,2)}},isEmpty:{get(){return $.issues.length===0}}})},Hu=z("ZodError",fq),b6=z("ZodError",fq,{Parent:Error});var GJ=p1(b6),YJ=t1(b6),NJ=a1(b6),JJ=e1(b6),BJ=NX(b6),HJ=JX(b6),AJ=BX(b6),OJ=HX(b6),zJ=AX(b6),LJ=OX(b6),KJ=zX(b6),vJ=LX(b6);var t=z("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:HI($,"input"),output:HI($,"output")}}),$.toJSONSchema=K5($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(E.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}))},$.clone=(U,b)=>o$($,U,b),$.brand=()=>$,$.register=(U,b)=>{return U.add($,b),$},$.parse=(U,b)=>GJ($,U,b,{callee:$.parse}),$.safeParse=(U,b)=>NJ($,U,b),$.parseAsync=async(U,b)=>YJ($,U,b,{callee:$.parseAsync}),$.safeParseAsync=async(U,b)=>JJ($,U,b),$.spa=$.safeParseAsync,$.encode=(U,b)=>BJ($,U,b),$.decode=(U,b)=>HJ($,U,b),$.encodeAsync=async(U,b)=>AJ($,U,b),$.decodeAsync=async(U,b)=>OJ($,U,b),$.safeEncode=(U,b)=>zJ($,U,b),$.safeDecode=(U,b)=>LJ($,U,b),$.safeEncodeAsync=async(U,b)=>KJ($,U,b),$.safeDecodeAsync=async(U,b)=>vJ($,U,b),$.refine=(U,b)=>$.check(QB(U,b)),$.superRefine=(U)=>$.check(GB(U)),$.overwrite=(U)=>$.check(Z6(U)),$.optional=()=>Y0($),$.nullable=()=>N0($),$.nullish=()=>Y0(N0($)),$.nonoptional=(U)=>tJ($,U),$.array=()=>A0($),$.or=(U)=>_D([$,U]),$.and=(U)=>xJ($,U),$.transform=(U)=>J0($,CD(U)),$.default=(U)=>oJ($,U),$.prefault=(U)=>pJ($,U),$.catch=(U)=>sJ($,U),$.pipe=(U)=>J0($,U),$.readonly=()=>UB($),$.describe=(U)=>{let b=$.clone();return d$.add(b,{description:U}),b},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let b=$.clone();return d$.add(b,U[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),BD=z("_ZodString",($,I)=>{D1.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>v5($,b,w,X);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...b)=>$.check(II(...b)),$.includes=(...b)=>$.check(bI(...b)),$.startsWith=(...b)=>$.check(XI(...b)),$.endsWith=(...b)=>$.check(DI(...b)),$.min=(...b)=>$.check(X4(...b)),$.max=(...b)=>$.check(Q1(...b)),$.length=(...b)=>$.check(G1(...b)),$.nonempty=(...b)=>$.check(X4(1,...b)),$.lowercase=(b)=>$.check(UI(b)),$.uppercase=(b)=>$.check(wI(b)),$.trim=()=>$.check(GI()),$.normalize=(...b)=>$.check(QI(...b)),$.toLowerCase=()=>$.check(YI()),$.toUpperCase=()=>$.check(NI()),$.slugify=()=>$.check(JI())}),zI=z("ZodString",($,I)=>{D1.init($,I),BD.init($,I),$.email=(U)=>$.check(_X(HD,U)),$.url=(U)=>$.check(W0(B0,U)),$.jwt=(U)=>$.check(aX(kD,U)),$.emoji=(U)=>$.check(hX(AD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.uuid=(U)=>$.check(ZX(i6,U)),$.uuidv4=(U)=>$.check(CX(i6,U)),$.uuidv6=(U)=>$.check(gX(i6,U)),$.uuidv7=(U)=>$.check(xX(i6,U)),$.nanoid=(U)=>$.check(fX(OD,U)),$.guid=(U)=>$.check(D0(G0,U)),$.cuid=(U)=>$.check(yX(zD,U)),$.cuid2=(U)=>$.check(uX(LD,U)),$.ulid=(U)=>$.check(lX(KD,U)),$.base64=(U)=>$.check(dX(ED,U)),$.base64url=(U)=>$.check(pX(SD,U)),$.xid=(U)=>$.check(cX(vD,U)),$.ksuid=(U)=>$.check(mX(VD,U)),$.ipv4=(U)=>$.check(rX(qD,U)),$.ipv6=(U)=>$.check(nX(MD,U)),$.cidrv4=(U)=>$.check(iX(FD,U)),$.cidrv6=(U)=>$.check(oX(jD,U)),$.e164=(U)=>$.check(tX(PD,U)),$.datetime=(U)=>$.check(XJ(U)),$.date=(U)=>$.check(DJ(U)),$.time=(U)=>$.check(WJ(U)),$.duration=(U)=>$.check(QJ(U))});function ND($){return C7(zI,$)}var B$=z("ZodStringFormat",($,I)=>{J$.init($,I),BD.init($,I)}),HD=z("ZodEmail",($,I)=>{CY.init($,I),B$.init($,I)});function yq($){return _X(HD,$)}var G0=z("ZodGUID",($,I)=>{_Y.init($,I),B$.init($,I)});function uq($){return D0(G0,$)}var i6=z("ZodUUID",($,I)=>{ZY.init($,I),B$.init($,I)});function lq($){return ZX(i6,$)}function cq($){return CX(i6,$)}function mq($){return gX(i6,$)}function rq($){return xX(i6,$)}var B0=z("ZodURL",($,I)=>{gY.init($,I),B$.init($,I)});function nq($){return W0(B0,$)}function iq($){return W0(B0,{protocol:/^https?$/,hostname:K6.domain,...E.normalizeParams($)})}var AD=z("ZodEmoji",($,I)=>{xY.init($,I),B$.init($,I)});function oq($){return hX(AD,$)}var OD=z("ZodNanoID",($,I)=>{hY.init($,I),B$.init($,I)});function dq($){return fX(OD,$)}var zD=z("ZodCUID",($,I)=>{fY.init($,I),B$.init($,I)});function pq($){return yX(zD,$)}var LD=z("ZodCUID2",($,I)=>{yY.init($,I),B$.init($,I)});function tq($){return uX(LD,$)}var KD=z("ZodULID",($,I)=>{uY.init($,I),B$.init($,I)});function aq($){return lX(KD,$)}var vD=z("ZodXID",($,I)=>{lY.init($,I),B$.init($,I)});function eq($){return cX(vD,$)}var VD=z("ZodKSUID",($,I)=>{cY.init($,I),B$.init($,I)});function sq($){return mX(VD,$)}var qD=z("ZodIPv4",($,I)=>{oY.init($,I),B$.init($,I)});function $M($){return rX(qD,$)}var VJ=z("ZodMAC",($,I)=>{pY.init($,I),B$.init($,I)});function IM($){return x7(VJ,$)}var MD=z("ZodIPv6",($,I)=>{dY.init($,I),B$.init($,I)});function UM($){return nX(MD,$)}var FD=z("ZodCIDRv4",($,I)=>{tY.init($,I),B$.init($,I)});function wM($){return iX(FD,$)}var jD=z("ZodCIDRv6",($,I)=>{aY.init($,I),B$.init($,I)});function bM($){return oX(jD,$)}var ED=z("ZodBase64",($,I)=>{sY.init($,I),B$.init($,I)});function XM($){return dX(ED,$)}var SD=z("ZodBase64URL",($,I)=>{$N.init($,I),B$.init($,I)});function DM($){return pX(SD,$)}var PD=z("ZodE164",($,I)=>{IN.init($,I),B$.init($,I)});function WM($){return tX(PD,$)}var kD=z("ZodJWT",($,I)=>{UN.init($,I),B$.init($,I)});function QM($){return aX(kD,$)}var LI=z("ZodCustomStringFormat",($,I)=>{wN.init($,I),B$.init($,I)});function GM($,I,U={}){return BI(LI,$,I,U)}function YM($){return BI(LI,"hostname",K6.hostname,$)}function NM($){return BI(LI,"hex",K6.hex,$)}function JM($,I){let U=I?.enc??"hex",b=`${$}_${U}`,w=K6[b];if(!w)throw new Error(`Unrecognized hash format: ${b}`);return BI(LI,b,w,I)}var KI=z("ZodNumber",($,I)=>{PX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>V5($,b,w,X),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.int=(b)=>$.check(JD(b)),$.safe=(b)=>$.check(JD(b)),$.positive=(b)=>$.check(n6(0,b)),$.nonnegative=(b)=>$.check(p$(0,b)),$.negative=(b)=>$.check(r6(0,b)),$.nonpositive=(b)=>$.check(Y6(0,b)),$.multipleOf=(b,w)=>$.check(C4(b,w)),$.step=(b,w)=>$.check(C4(b,w)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function qJ($){return c7(KI,$)}var N1=z("ZodNumberFormat",($,I)=>{bN.init($,I),KI.init($,I)});function JD($){return r7(N1,$)}function BM($){return n7(N1,$)}function HM($){return i7(N1,$)}function AM($){return o7(N1,$)}function OM($){return d7(N1,$)}var vI=z("ZodBoolean",($,I)=>{aU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>q5($,U,b,w)});function MJ($){return p7(vI,$)}var VI=z("ZodBigInt",($,I)=>{kX.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>M5($,b,w,X),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.gt=(b,w)=>$.check(n6(b,w)),$.gte=(b,w)=>$.check(p$(b,w)),$.min=(b,w)=>$.check(p$(b,w)),$.lt=(b,w)=>$.check(r6(b,w)),$.lte=(b,w)=>$.check(Y6(b,w)),$.max=(b,w)=>$.check(Y6(b,w)),$.positive=(b)=>$.check(n6(BigInt(0),b)),$.negative=(b)=>$.check(r6(BigInt(0),b)),$.nonpositive=(b)=>$.check(Y6(BigInt(0),b)),$.nonnegative=(b)=>$.check(p$(BigInt(0),b)),$.multipleOf=(b,w)=>$.check(C4(b,w));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function zM($){return a7(VI,$)}var RD=z("ZodBigIntFormat",($,I)=>{XN.init($,I),VI.init($,I)});function LM($){return s7(RD,$)}function KM($){return $5(RD,$)}var FJ=z("ZodSymbol",($,I)=>{DN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>F5($,U,b,w)});function vM($){return I5(FJ,$)}var jJ=z("ZodUndefined",($,I)=>{WN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>E5($,U,b,w)});function VM($){return U5(jJ,$)}var EJ=z("ZodNull",($,I)=>{QN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>j5($,U,b,w)});function SJ($){return w5(EJ,$)}var PJ=z("ZodAny",($,I)=>{GN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>k5($,U,b,w)});function qM(){return b5(PJ)}var kJ=z("ZodUnknown",($,I)=>{YN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>R5($,U,b,w)});function Y1(){return X5(kJ)}var RJ=z("ZodNever",($,I)=>{NN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>P5($,U,b,w)});function TD($){return D5(RJ,$)}var TJ=z("ZodVoid",($,I)=>{JN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>S5($,U,b,w)});function MM($){return W5(TJ,$)}var H0=z("ZodDate",($,I)=>{BN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>T5($,b,w,X),$.min=(b,w)=>$.check(p$(b,w)),$.max=(b,w)=>$.check(Y6(b,w));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function FM($){return Q5(H0,$)}var _J=z("ZodArray",($,I)=>{HN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>m5($,U,b,w),$.element=I.element,$.min=(U,b)=>$.check(X4(U,b)),$.nonempty=(U)=>$.check(X4(1,U)),$.max=(U,b)=>$.check(Q1(U,b)),$.length=(U,b)=>$.check(G1(U,b)),$.unwrap=()=>$.element});function A0($,I){return N5(_J,$,I)}function jM($){let I=$._zod.def.shape;return ZD(Object.keys(I))}var O0=z("ZodObject",($,I)=>{AN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>r5($,U,b,w),E.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>ZD(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Y1()}),$.loose=()=>$.clone({...$._zod.def,catchall:Y1()}),$.strict=()=>$.clone({...$._zod.def,catchall:TD()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return E.extend($,U)},$.safeExtend=(U)=>{return E.safeExtend($,U)},$.merge=(U)=>E.merge($,U),$.pick=(U)=>E.pick($,U),$.omit=(U)=>E.omit($,U),$.partial=(...U)=>E.partial(gD,$,U[0]),$.required=(...U)=>E.required(xD,$,U[0])});function EM($,I){let U={type:"object",shape:$??{},...E.normalizeParams(I)};return new O0(U)}function SM($,I){return new O0({type:"object",shape:$,catchall:TD(),...E.normalizeParams(I)})}function PM($,I){return new O0({type:"object",shape:$,catchall:Y1(),...E.normalizeParams(I)})}var z0=z("ZodUnion",($,I)=>{eU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function _D($,I){return new z0({type:"union",options:$,...E.normalizeParams(I)})}var ZJ=z("ZodXor",($,I)=>{z0.init($,I),ON.init($,I),$._zod.processJSONSchema=(U,b,w)=>bD($,U,b,w),$.options=I.options});function kM($,I){return new ZJ({type:"union",options:$,inclusive:!1,...E.normalizeParams(I)})}var CJ=z("ZodDiscriminatedUnion",($,I)=>{z0.init($,I),zN.init($,I)});function RM($,I,U){return new CJ({type:"union",options:I,discriminator:$,...E.normalizeParams(U)})}var gJ=z("ZodIntersection",($,I)=>{LN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>n5($,U,b,w)});function xJ($,I){return new gJ({type:"intersection",left:$,right:I})}var hJ=z("ZodTuple",($,I)=>{RX.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>i5($,U,b,w),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function fJ($,I,U){let b=I instanceof o,w=b?U:I;return new hJ({type:"tuple",items:$,rest:b?I:null,...E.normalizeParams(w)})}var L0=z("ZodRecord",($,I)=>{KN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>o5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function yJ($,I,U){return new L0({type:"record",keyType:$,valueType:I,...E.normalizeParams(U)})}function TM($,I,U){let b=o$($);return b._zod.values=void 0,new L0({type:"record",keyType:b,valueType:I,...E.normalizeParams(U)})}function _M($,I,U){return new L0({type:"record",keyType:$,valueType:I,mode:"loose",...E.normalizeParams(U)})}var uJ=z("ZodMap",($,I)=>{vN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>l5($,U,b,w),$.keyType=I.keyType,$.valueType=I.valueType});function ZM($,I,U){return new uJ({type:"map",keyType:$,valueType:I,...E.normalizeParams(U)})}var lJ=z("ZodSet",($,I)=>{VN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>c5($,U,b,w),$.min=(...U)=>$.check(g4(...U)),$.nonempty=(U)=>$.check(g4(1,U)),$.max=(...U)=>$.check(W1(...U)),$.size=(...U)=>$.check($I(...U))});function CM($,I){return new lJ({type:"set",valueType:$,...E.normalizeParams(I)})}var OI=z("ZodEnum",($,I)=>{qN.init($,I),t.init($,I),$._zod.processJSONSchema=(b,w,X)=>_5($,b,w,X),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(b,w)=>{let X={};for(let D of b)if(U.has(D))X[D]=I.entries[D];else throw new Error(`Key ${D} not found in enum`);return new OI({...I,checks:[],...E.normalizeParams(w),entries:X})},$.exclude=(b,w)=>{let X={...I.entries};for(let D of b)if(U.has(D))delete X[D];else throw new Error(`Key ${D} not found in enum`);return new OI({...I,checks:[],...E.normalizeParams(w),entries:X})}});function ZD($,I){let U=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new OI({type:"enum",entries:U,...E.normalizeParams(I)})}function gM($,I){return new OI({type:"enum",entries:$,...E.normalizeParams(I)})}var cJ=z("ZodLiteral",($,I)=>{MN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>Z5($,U,b,w),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function xM($,I){return new cJ({type:"literal",values:Array.isArray($)?$:[$],...E.normalizeParams(I)})}var mJ=z("ZodFile",($,I)=>{FN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>x5($,U,b,w),$.min=(U,b)=>$.check(g4(U,b)),$.max=(U,b)=>$.check(W1(U,b)),$.mime=(U,b)=>$.check(WI(Array.isArray(U)?U:[U],b))});function hM($){return J5(mJ,$)}var rJ=z("ZodTransform",($,I)=>{jN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>u5($,U,b,w),$._zod.parse=(U,b)=>{if(b.direction==="backward")throw new w1($.constructor.name);U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(E.issue(X,U.value,I));else{let D=X;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=U.value),D.inst??(D.inst=$),U.issues.push(E.issue(D))}};let w=I.transform(U.value,U);if(w instanceof Promise)return w.then((X)=>{return U.value=X,U});return U.value=w,U}});function CD($){return new rJ({type:"transform",transform:$})}var gD=z("ZodOptional",($,I)=>{EN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>UJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function Y0($){return new gD({type:"optional",innerType:$})}var nJ=z("ZodNullable",($,I)=>{SN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>d5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function N0($){return new nJ({type:"nullable",innerType:$})}function fM($){return Y0(N0($))}var iJ=z("ZodDefault",($,I)=>{PN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>t5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function oJ($,I){return new iJ({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var dJ=z("ZodPrefault",($,I)=>{kN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>a5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function pJ($,I){return new dJ({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():E.shallowClone(I)}})}var xD=z("ZodNonOptional",($,I)=>{RN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>p5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function tJ($,I){return new xD({type:"nonoptional",innerType:$,...E.normalizeParams(I)})}var aJ=z("ZodSuccess",($,I)=>{TN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>h5($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function yM($){return new aJ({type:"success",innerType:$})}var eJ=z("ZodCatch",($,I)=>{_N.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>e5($,U,b,w),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function sJ($,I){return new eJ({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var $B=z("ZodNaN",($,I)=>{ZN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>C5($,U,b,w)});function uM($){return Y5($B,$)}var hD=z("ZodPipe",($,I)=>{CN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>s5($,U,b,w),$.in=I.in,$.out=I.out});function J0($,I){return new hD({type:"pipe",in:$,out:I})}var fD=z("ZodCodec",($,I)=>{hD.init($,I),sU.init($,I)});function lM($,I,U){return new fD({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var IB=z("ZodReadonly",($,I)=>{gN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>$J($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function UB($){return new IB({type:"readonly",innerType:$})}var wB=z("ZodTemplateLiteral",($,I)=>{xN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>g5($,U,b,w)});function cM($,I){return new wB({type:"template_literal",parts:$,...E.normalizeParams(I)})}var bB=z("ZodLazy",($,I)=>{yN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>wJ($,U,b,w),$.unwrap=()=>$._zod.def.getter()});function XB($){return new bB({type:"lazy",getter:$})}var DB=z("ZodPromise",($,I)=>{fN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>IJ($,U,b,w),$.unwrap=()=>$._zod.def.innerType});function mM($){return new DB({type:"promise",innerType:$})}var WB=z("ZodFunction",($,I)=>{hN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>y5($,U,b,w)});function rM($){return new WB({type:"function",input:Array.isArray($?.input)?fJ($?.input):$?.input??A0(Y1()),output:$?.output??Y1()})}var K0=z("ZodCustom",($,I)=>{uN.init($,I),t.init($,I),$._zod.processJSONSchema=(U,b,w)=>f5($,U,b,w)});function nM($){let I=new A$({check:"custom"});return I._zod.check=$,I}function iM($,I){return B5(K0,$??(()=>!0),I)}function QB($,I={}){return H5(K0,$,I)}function GB($){return A5($)}var oM=O5,dM=z5;function pM($,I={error:`Input not instance of ${$.name}`}){let U=new K0({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...E.normalizeParams(I)});return U._zod.bag.Class=$,U}var tM=(...$)=>L5({Codec:fD,Boolean:vI,String:zI},...$);function aM($){let I=XB(()=>{return _D([ND($),qJ(),MJ(),SJ(),A0(I),yJ(ND(),I)])});return I}function eM($,I){return J0(CD($),I)}var Ou={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function zu($){P$({customError:$})}function Lu(){return P$().customError}var YB;(function($){})(YB||(YB={}));var _={...Q0,...DD,iso:AI};function Ku($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function vu($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let b=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===b){let w=U[1];if(!w||!I.defs[w])throw new Error(`Reference not found: ${$}`);return I.defs[w]}throw new Error(`Reference not found: ${$}`)}function sM($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let w=$.$ref;if(I.refs.has(w))return I.refs.get(w);if(I.processing.has(w))return _.lazy(()=>{if(!I.refs.has(w))throw new Error(`Circular reference not resolved: ${w}`);return I.refs.get(w)});I.processing.add(w);let X=vu(w,I),D=u$(X,I);return I.refs.set(w,D),I.processing.delete(w),D}if($.enum!==void 0){let w=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&w.length===1&&w[0]===null)return _.null();if(w.length===0)return _.never();if(w.length===1)return _.literal(w[0]);if(w.every((D)=>typeof D==="string"))return _.enum(w);let X=w.map((D)=>_.literal(D));if(X.length<2)return X[0];return _.union([X[0],X[1],...X.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let w=U.map((X)=>{let D={...$,type:X};return sM(D,I)});if(w.length===0)return _.never();if(w.length===1)return w[0];return _.union(w)}if(!U)return _.any();let b;switch(U){case"string":{let w=_.string();if($.format){let X=$.format;if(X==="email")w=w.check(_.email());else if(X==="uri"||X==="uri-reference")w=w.check(_.url());else if(X==="uuid"||X==="guid")w=w.check(_.uuid());else if(X==="date-time")w=w.check(_.iso.datetime());else if(X==="date")w=w.check(_.iso.date());else if(X==="time")w=w.check(_.iso.time());else if(X==="duration")w=w.check(_.iso.duration());else if(X==="ipv4")w=w.check(_.ipv4());else if(X==="ipv6")w=w.check(_.ipv6());else if(X==="mac")w=w.check(_.mac());else if(X==="cidr")w=w.check(_.cidrv4());else if(X==="cidr-v6")w=w.check(_.cidrv6());else if(X==="base64")w=w.check(_.base64());else if(X==="base64url")w=w.check(_.base64url());else if(X==="e164")w=w.check(_.e164());else if(X==="jwt")w=w.check(_.jwt());else if(X==="emoji")w=w.check(_.emoji());else if(X==="nanoid")w=w.check(_.nanoid());else if(X==="cuid")w=w.check(_.cuid());else if(X==="cuid2")w=w.check(_.cuid2());else if(X==="ulid")w=w.check(_.ulid());else if(X==="xid")w=w.check(_.xid());else if(X==="ksuid")w=w.check(_.ksuid())}if(typeof $.minLength==="number")w=w.min($.minLength);if(typeof $.maxLength==="number")w=w.max($.maxLength);if($.pattern)w=w.regex(new RegExp($.pattern));b=w;break}case"number":case"integer":{let w=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")w=w.min($.minimum);if(typeof $.maximum==="number")w=w.max($.maximum);if(typeof $.exclusiveMinimum==="number")w=w.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")w=w.gt($.minimum);if(typeof $.exclusiveMaximum==="number")w=w.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")w=w.lt($.maximum);if(typeof $.multipleOf==="number")w=w.multipleOf($.multipleOf);b=w;break}case"boolean":{b=_.boolean();break}case"null":{b=_.null();break}case"object":{let w={},X=$.properties||{},D=new Set($.required||[]);for(let[Q,G]of Object.entries(X)){let Y=u$(G,I);w[Q]=D.has(Q)?Y:Y.optional()}if($.propertyNames){let Q=u$($.propertyNames,I),G=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(w).length===0){b=_.record(Q,G);break}let Y=_.object(w).passthrough(),J=_.looseRecord(Q,G);b=_.intersection(Y,J);break}if($.patternProperties){let Q=$.patternProperties,G=Object.keys(Q),Y=[];for(let H of G){let B=u$(Q[H],I),A=_.string().regex(new RegExp(H));Y.push(_.looseRecord(A,B))}let J=[];if(Object.keys(w).length>0)J.push(_.object(w).passthrough());if(J.push(...Y),J.length===0)b=_.object({}).passthrough();else if(J.length===1)b=J[0];else{let H=_.intersection(J[0],J[1]);for(let B=2;B<J.length;B++)H=_.intersection(H,J[B]);b=H}break}let W=_.object(w);if($.additionalProperties===!1)b=W.strict();else if(typeof $.additionalProperties==="object")b=W.catchall(u$($.additionalProperties,I));else b=W.passthrough();break}case"array":{let{prefixItems:w,items:X}=$;if(w&&Array.isArray(w)){let D=w.map((Q)=>u$(Q,I)),W=X&&typeof X==="object"&&!Array.isArray(X)?u$(X,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(Array.isArray(X)){let D=X.map((Q)=>u$(Q,I)),W=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(W)b=_.tuple(D).rest(W);else b=_.tuple(D);if(typeof $.minItems==="number")b=b.check(_.minLength($.minItems));if(typeof $.maxItems==="number")b=b.check(_.maxLength($.maxItems))}else if(X!==void 0){let D=u$(X,I),W=_.array(D);if(typeof $.minItems==="number")W=W.min($.minItems);if(typeof $.maxItems==="number")W=W.max($.maxItems);b=W}else b=_.array(_.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)b=b.describe($.description);if($.default!==void 0)b=b.default($.default);return b}function u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=sM($,I),b=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((D)=>u$(D,I)),X=_.union(w);U=b?_.intersection(U,X):X}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((D)=>u$(D,I)),X=_.xor(w);U=b?_.intersection(U,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=b?U:_.any();else{let w=b?U:u$($.allOf[0],I),X=b?0:1;for(let D=X;D<$.allOf.length;D++)w=_.intersection(w,u$($.allOf[D],I));U=w}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function $F($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Ku($,I?.defaultTarget),b=$.$defs||$.definitions||{};return u$($,{version:U,defs:b,refs:new Map,processing:new Set,rootSchema:$})}var NB={};v6(NB,{string:()=>Vu,number:()=>qu,date:()=>ju,boolean:()=>Mu,bigint:()=>Fu});function Vu($){return g7(zI,$)}function qu($){return m7(KI,$)}function Mu($){return t7(vI,$)}function Fu($){return e7(VI,$)}function ju($){return G5(H0,$)}P$($0());var W4=N.enum(["document","record"]),yD=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],uD=["literature","document","record","annotation","artifact"],lD=["molecule","reaction"],qI=50,cD=50;var JB=N.object({blockType:N.enum(yD).default("paragraph").describe("Type of block to create. Default: paragraph"),content:N.string().describe("Text content for the block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:N.enum(lD).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:N.string().optional().describe("Optional description or notes for the molecule block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var Eu=N.enum(["text","number","unit","select","boolean"]),Su=N.enum(["mandatory","recommended","optional"]),IF=N.object({key:N.string().min(1).describe("Stable column key"),label:N.string().min(1).describe("Human-readable column label"),type:Eu.describe("Column type"),unit:N.string().optional().describe("Optional display unit"),mandation:Su.describe("Field importance level"),description:N.string().optional().describe("Optional field description"),standardRef:N.string().optional().describe("Optional ontology reference"),options:N.array(N.string()).optional().describe("Allowed values for select columns"),hidden:N.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),MI=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])),UF=N.enum(["generic","stoichiometry"]),BB=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),kind:UF.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:N.string().min(1).describe("Matrix label shown in the editor"),columns:N.array(IF).max(qI).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:N.array(MI).optional().describe("Matrix rows"),nodeRef:N.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:N.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),v0={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var HB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rows:N.array(MI).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),V0={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var AB=N.object({matrixId:N.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:N.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:N.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:N.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),q0={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var FI=N.enum(["procedure","characterization","observation","step"]),jI=N.object({type:N.literal("file"),target:N.enum(["local","server","url"]),path:N.string().min(1),format:N.string().min(1),label:N.string().min(1),instrument:N.string().optional(),metadata:N.record(N.string(),N.union([N.string(),N.number(),N.boolean()])).optional()}),wF=N.object({artifactId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.unknown()).optional()}),bF=N.object({matrixId:N.string().uuid()}),M0=N.object({tempId:N.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:N.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:N.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:N.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:N.array(jI).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:N.array(wF).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:N.array(bF).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var XF=N.enum(["replace","append"]),OB=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:N.array(M0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:XF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:N.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:N.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),F0={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var DF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Pu=["molecule","material","mixture","biomacromolecule"],G6$=N.enum(Pu),WF=["active","depleted","archived","draft"],mD=N.enum(DF),EI=N.enum(WF),ku=N.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),zB=N.object({id:N.string().uuid().describe("UUID of the artifact to update."),name:N.string().min(1).optional().describe("Display name (skip to keep existing)."),description:N.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:N.array(N.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:N.record(N.string(),N.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:ku.optional(),artifactType:mD.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:EI.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:N.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId)."}),j0={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var QF=N.object({cid:N.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:N.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:N.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:N.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),LB=N.object({name:N.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:mD.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:N.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:N.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:N.string().optional().describe("Plain-text description."),tags:N.array(N.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:N.record(N.string(),N.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → transformation_class (required: molecular | sol_gel | polymerization | crystallization | self_assembly | mechanochemistry | biological | other), transformation_summary (free-text for non-molecular), rxn_smiles (molecular only), precursor_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:EI.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:N.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:N.string().optional().describe("Free-form physical/logical location."),parentId:N.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:N.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:N.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:QF.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:N.object({nodeId:N.string().uuid(),role:N.enum(["input","output","derived_from","referenced"]),context:N.record(N.string(),N.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),E0={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.transformation_class` — one of: molecular, sol_gel, polymerization, crystallization, self_assembly, mechanochemistry, biological, other. For `molecular` reactions also supply `rxn_smiles`. For everything else write a short `transformation_summary` describing what is actually happening. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var KB=N.object({title:N.string().min(1).max(500).describe("Title for the new document"),content:N.string().optional().describe("Optional initial content in markdown format"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:N.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:N.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document.")}),S0={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format."};var vB=N.object({title:N.string().min(1).max(500).describe("Paper title"),doi:N.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:N.array(N.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:N.string().optional().describe("Journal name"),year:N.number().int().positive().optional().describe("Publication year"),sourceUrl:N.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:N.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:N.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:N.string().uuid().optional().describe("Space within workspace"),fetchFullText:N.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation.")}),P0={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library."};var VB=N.object({reactionArtifactId:N.string().uuid().describe('UUID of the reaction artifact to derive the stoichiometry matrix from. Must be `artifactType: "reaction"` — other types return an error.'),workspaceId:N.string().uuid().describe("Workspace scope. Must match the reaction artifact and (if provided) the target entity."),entityType:N.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:N.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:N.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"`, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),label:N.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>".')}),k0={name:"create_matrix_from_reaction_artifact",description:["Derive a stoichiometry matrix from a saved reaction artifact. Walks the artifact's `linkSlots` (typed component slots: reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one matrix row per bound slot using the slot's stoichCoefficient. Stamps `derivedFromArtifactId` on the matrix for provenance.","Frozen invariant: edits to the artifact never propagate forward to the spawned matrix; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Slots without a `defaultArtifactId` are skipped (no row emitted). The user can fill in those rows by hand on the derived matrix.","Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var qB=N.object({title:N.string().min(1).max(500).describe("Title for the new record."),organizationId:N.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:N.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:N.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:N.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:N.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:N.array(N.string().uuid()).optional().describe("User ids participating in this research activity."),initialTree:N.array(M0).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),R0={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page."].join(" ")};var rD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),blockId:N.string().optional().describe("Block ID to delete (for single delete)"),blockIds:N.array(N.string()).max(cD).optional().describe(`Array of block IDs to delete (batch mode, max ${cD})`)}),Ru=rD.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),T0={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var MB=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to delete."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:N.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),_0={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var Tu=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),FB=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),rowIndices:N.array(N.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:Tu.optional(),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),Z0={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var jB=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:N.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),C0={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function k$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let b=String(U);return b.includes(",")?`"${b}"`:b}).join(",")}`}function nD($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function YF($,I,U=150){let b=0,w=Math.min($.length,I.length);while(b<w&&$[b]===I[b])b++;let X=0;while(X<w-b&&$.at(1+X)===I.at(1+X))X++;let D=Math.floor(U/2),W=Math.max(0,b-D),Q=Math.min($.length,$.length-X+D),G=Math.min(I.length,I.length-X+D),Y=W>0?"...":"",J=Q<$.length?"...":"",H=G<I.length?"...":"",B=`${Y}${$.slice(W,Q)}${J}`,A=`${Y}${I.slice(W,G)}${H}`;return`--- before
65
+ ${B}
66
66
  +++ after
67
- ${A}`}function EJ($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,b=[];for(let w of $.orgs)for(let X of w.workspaces)if(X.spaces.length===0)b.push(k$([w.name,w.id,X.name,X.id,X.type,"","",""])),U++;else for(let D of X.spaces)b.push(k$([w.name,w.id,X.name,X.id,X.type,D.name,D.id,D.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...b),I.join(`
68
- `)}function SJ($){let{mode:I,found:U,hasMore:b}=$;if(U===0)return`[results:0 found, ${I}]
69
- No results.`;let w=[I,...b?["hasMore"]:[]].join(", "),X=[`[results:${U} found, ${w}]`];if(I==="library"){let D=$.results,W=D.some((B)=>B.literatureMetadata),Q=D.some((B)=>B.creatorName),G=W?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",N=Q?`${G},creator,snippet}`:`${G},snippet}`;X.push(`${N}[${D.length}]:`);for(let B of D){let H=B.bestSnippet??B.snippet??"",J=H.length>120?`${H.slice(0,117)}...`:H,A=B.tags?.join(" | ")??"",O=B.creatorName??"";if(W){let V=B.literatureMetadata,q=[B.entityType,B.entityTitle,B.entityId,B.relevance,A,V?.doi??"",V?.firstAuthor??"",V?.year??"",V?.journal??""];if(Q)q.push(O);q.push(J),X.push(k$(q))}else{let V=[B.entityType,B.entityTitle,B.entityId,B.relevance,A];if(Q)V.push(O);V.push(J),X.push(k$(V))}}}else{let D=$.results,W=D.some((G)=>G.creatorName),Q=W?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";X.push(`${Q}[${D.length}]:`);for(let G of D){let N=G.bestSnippet??G.snippet??"",B=N.length>120?`${N.slice(0,117)}...`:N,H=[G.entityType,G.entityTitle,G.entityId,G.blockId];if(W)H.push(G.creatorName??"");H.push(B),X.push(k$(H))}}return X.join(`
70
- `)}function aF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
71
- `)}function Ou($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
- `)}function dF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function PJ($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.bibliographic){let U=$.bibliographic,b=[];if(U.authors?.length)b.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)b.push(U.journal);if(U.volume){let w=U.volume;if(U.issue)w+=`(${U.issue})`;if(U.pages)w+=`, ${U.pages}`;b.push(w)}if(U.year)b.push(String(U.year));if(b.length>0)I.push(b.join(", "));if(U.doi)I.push(`DOI: ${U.doi}`);if(U.pmid)I.push(`PMID: ${U.pmid}`);if(U.arxivId)I.push(`arXiv: ${U.arxivId}`);if(U.tags&&U.tags.length>0)I.push(`Tags: ${U.tags.join(", ")}`)}if($.error)return I.push(""),I.push(`**Error:** ${$.error}`),I.join(`
73
- `);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(aF($.overview.toc));if($.overview.regions&&$.overview.regions.length>0){if($.overview.toc&&$.overview.toc.length>0)I.push("");I.push("**Additional Retrievable Regions:**"),I.push(Ou($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if($.connections&&$.connections.total>0){if(I.push(""),I.push(`**Connections** (${$.connections.total} edges):`),$.connections.outgoing.length>0){I.push(""),I.push("*Outgoing (this entity → others):*");for(let U of $.connections.outgoing){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↗",w=U.entityTitle||U.entityId.slice(0,8),X=dF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} → ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} → ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}if($.connections.incoming.length>0){I.push(""),I.push("*Incoming (others → this entity):*");for(let U of $.connections.incoming){let b=U.referenceType==="annotation"?"\uD83D\uDCDD":U.referenceType==="citation"?"\uD83D\uDCD6":"↙",w=U.entityTitle||U.entityId.slice(0,8),X=dF(U.entityType,U.entityId);if(U.edgeText)I.push(` ${b} ${U.entityType}: ${w} (${X})`),I.push(` "${U.edgeText}"`);else I.push(` ${b} ${U.entityType}: ${w} (${X}, ${U.referenceType})`)}}}if($.markdown){if(I.push(""),$.format==="interleaved")I.push("**Content (with block IDs for editing):**");else I.push("**Markdown Content:**");I.push(""),I.push($.markdown)}if($.sectionInfo){if(I.push(""),I.push(`*Section: ${$.sectionInfo.blockCount} blocks, ${$.sectionInfo.wordCount} words*`),$.sectionInfo.warning)I.push(`*Warning: ${$.sectionInfo.warning}*`)}if($.refs&&$.refs.length>0)I.push(""),I.push("**References:**"),I.push("```json"),I.push(JSON.stringify($.refs,null,2)),I.push("```");return I.join(`
74
- `)}function kJ($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
67
+ ${A}`}function SB($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,b=[];for(let w of $.orgs)for(let X of w.workspaces)if(X.spaces.length===0)b.push(k$([w.name,w.id,X.name,X.id,X.type,"","",""])),U++;else for(let D of X.spaces)b.push(k$([w.name,w.id,X.name,X.id,X.type,D.name,D.id,D.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...b),I.join(`
68
+ `)}function PB($){let{mode:I,found:U,hasMore:b}=$;if(U===0)return`[results:0 found, ${I}]
69
+ No results.`;let w=[I,...b?["hasMore"]:[]].join(", "),X=[`[results:${U} found, ${w}]`];if(I==="library"){let D=$.results,W=D.some((J)=>J.literatureMetadata),Q=D.some((J)=>J.creatorName),G=W?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",Y=Q?`${G},creator,snippet}`:`${G},snippet}`;X.push(`${Y}[${D.length}]:`);for(let J of D){let H=J.bestSnippet??J.snippet??"",B=H.length>120?`${H.slice(0,117)}...`:H,A=J.tags?.join(" | ")??"",O=J.creatorName??"";if(W){let V=J.literatureMetadata,q=[J.entityType,J.entityTitle,J.entityId,J.relevance,A,V?.doi??"",V?.firstAuthor??"",V?.year??"",V?.journal??""];if(Q)q.push(O);q.push(B),X.push(k$(q))}else{let V=[J.entityType,J.entityTitle,J.entityId,J.relevance,A];if(Q)V.push(O);V.push(B),X.push(k$(V))}}}else{let D=$.results,W=D.some((G)=>G.creatorName),Q=W?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";X.push(`${Q}[${D.length}]:`);for(let G of D){let Y=G.bestSnippet??G.snippet??"",J=Y.length>120?`${Y.slice(0,117)}...`:Y,H=[G.entityType,G.entityTitle,G.entityId,G.blockId];if(W)H.push(G.creatorName??"");H.push(J),X.push(k$(H))}}return X.join(`
70
+ `)}function NF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
71
+ `)}function _u($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(k$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
+ `)}function JF($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function EB($){let I=[],U=$.direction==="forward"?"→":"←",b=$.direction==="forward"?"↗":"↙";if($.type==="annotation")b="\uD83D\uDCDD";else if($.type==="citation")b="\uD83D\uDCD6";let w=$.dstEntityType??$.dstScope,X=$.dstTitle||$.dstId.slice(0,8),D=JF(w,$.dstId),W=[$.type,$.direction,`via ${$.provenance}`];if(typeof $.weight==="number"&&$.weight>1)W.push(`shared by ${$.weight} records`);if(I.push(` ${b} ${U} ${w}: ${X} (${D}, ${W.join(" · ")})`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` ${$.snippet}`);return I}function kB($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});let I=[],U=$.root,b=U?JF(U.type,U.id):"unknown";I.push(`**Situated:** ${U?.type??"entity"} "${U?.title??""}" (${b})`);let w=[`depth ${$.depth??0}`,`${$.nodes?.length??0} nodes`,`${$.edges?.length??0} edges`];if($.truncated)w.push("truncated (busy hop — re-situate a specific node for more)");I.push(`*${w.join(" · ")}*`);let X=$.edges??[];if(X.length===0)return I.push(""),I.push("*No connections within the traversed depth.*"),I.join(`
73
+ `);let D=X.reduce((W,Q)=>Math.max(W,Q.hop),0);for(let W=1;W<=D;W++){let Q=X.filter((G)=>G.hop===W);if(Q.length===0)continue;I.push(""),I.push(`*Hop ${W}* (${Q.length} edges):`);for(let G of Q)for(let Y of EB(G))I.push(Y)}return I.join(`
74
+ `)}function RB($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.recordStatus)I.push(`*status: ${$.recordStatus}*`);if($.bibliographic){let U=$.bibliographic,b=[];if(U.authors?.length)b.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)b.push(U.journal);if(U.volume){let w=U.volume;if(U.issue)w+=`(${U.issue})`;if(U.pages)w+=`, ${U.pages}`;b.push(w)}if(U.year)b.push(String(U.year));if(b.length>0)I.push(b.join(", "));if(U.doi)I.push(`DOI: ${U.doi}`);if(U.pmid)I.push(`PMID: ${U.pmid}`);if(U.arxivId)I.push(`arXiv: ${U.arxivId}`);if(U.tags&&U.tags.length>0)I.push(`Tags: ${U.tags.join(", ")}`)}if($.error)return I.push(""),I.push(`**Error:** ${$.error}`),I.join(`
75
+ `);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(NF($.overview.toc));if($.overview.regions&&$.overview.regions.length>0){if($.overview.toc&&$.overview.toc.length>0)I.push("");I.push("**Additional Retrievable Regions:**"),I.push(_u($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if($.edges&&$.edges.length>0){let U=$.edges.filter((w)=>w.direction==="forward"),b=$.edges.filter((w)=>w.direction==="inverse");if(I.push(""),I.push(`**Connections** (${$.edges.length} edges):`),U.length>0){I.push(""),I.push("*Outgoing (this entity → others):*");for(let w of U)for(let X of EB(w))I.push(X)}if(b.length>0){I.push(""),I.push("*Incoming (others → this entity):*");for(let w of b)for(let X of EB(w))I.push(X)}}if($.markdown){if(I.push(""),$.format==="interleaved")I.push("**Content (with block IDs for editing):**");else I.push("**Markdown Content:**");I.push(""),I.push($.markdown)}if($.sectionInfo){if(I.push(""),I.push(`*Section: ${$.sectionInfo.blockCount} blocks, ${$.sectionInfo.wordCount} words*`),$.sectionInfo.warning)I.push(`*Warning: ${$.sectionInfo.warning}*`)}if($.refs&&$.refs.length>0)I.push(""),I.push("**References:**"),I.push("```json"),I.push(JSON.stringify($.refs,null,2)),I.push("```");return I.join(`
76
+ `)}function TB($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
75
77
  Title: ${$.title}
76
- ID: ${$.documentId}`}function RJ($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
78
+ ID: ${$.documentId}`}function _B($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
77
79
  Triggered CORE enrichment for missing content.`;return U}let I=`Literature imported successfully.
78
80
  Title: ${$.title}
79
81
  ID: ${$.literatureId}`;if($.coreEnriched){let U=[];if($.charCount)U.push(`${$.charCount.toLocaleString()} chars`);if($.sectionCount)U.push(`${$.sectionCount} sections`);if($.referenceCount)U.push(`${$.referenceCount} references`);return`${I}
80
82
  Full text: imported from CORE (${U.join(", ")})`}if($.error?.includes("CORE enrichment in progress"))return`${I}
81
- Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function TJ($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
83
+ Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function ZB($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
82
84
  Label: ${$.label}
83
85
  Matrix ID: ${$.matrixId}
84
- Block ID: ${$.blockId}`}function _J($){if(!$.success)return`Failed to create matrix from reaction: ${$.error}`;let I=$.rowsCreated??0,U=["Stoichiometry matrix derived from reaction artifact.",`Label: ${$.label}`,`Matrix ID: ${$.matrixId}`,`Reaction artifact ID: ${$.reactionArtifactId}`,`Rows created: ${I}`];if(I===0)U.push("Note: the reaction artifact has no bound linkSlots — the matrix has the stoichiometry columns but no rows. Use append_matrix_rows to add components, or bind defaultArtifactId on the slots first.");return U.join(`
85
- `)}function ZJ($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(tF($.originalText,$.updatedText));let U=fD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
86
-
87
- `)}function CJ($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let b=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success&&w.newBlockId){let X=w.blockType??"paragraph",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.newBlockId}]${D}`)}}return b.join(`
88
- `)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:b,content:w}=$.insertedBlock,X=w.length>200?`${w.slice(0,200)}...`:w;if(I.push(`Type: ${b}`),X)I.push(`Content: ${X}`)}let U=fD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
89
- `)}function gJ($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let b=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success){let X=w.blockType??"?",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.blockId}]${D}`)}}return b.join(`
90
- `)}let I=[];if($.deletedBlock){let{blockType:b,contentPreview:w}=$.deletedBlock;if(I.push(`Deleted [${b} | ${$.deletedBlock.blockId}]`),w)I.push(`Was: ${w}`)}else I.push("Block deleted");let U=fD($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
91
- `)}function xJ($){if(!$.success)return $.error??"create_record failed";let I=[`[record created | id=${$.recordId??""}]`,$.title?`title: ${$.title}`:"",$.workspaceId?`workspace: ${$.workspaceId}`:"",$.spaceId?`space: ${$.spaceId}`:"space: —"].filter(Boolean).join(`
86
+ Block ID: ${$.blockId}`}function CB($){if(!$.success)return`Failed to create matrix from reaction: ${$.error}`;let I=$.rowsCreated??0,U=["Stoichiometry matrix derived from reaction artifact.",`Label: ${$.label}`,`Matrix ID: ${$.matrixId}`,`Reaction artifact ID: ${$.reactionArtifactId}`,`Rows created: ${I}`];if(I===0)U.push("Note: the reaction artifact has no bound linkSlots — the matrix has the stoichiometry columns but no rows. Use append_matrix_rows to add components, or bind defaultArtifactId on the slots first.");return U.join(`
87
+ `)}function gB($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(YF($.originalText,$.updatedText));let U=nD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
88
+
89
+ `)}function xB($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let b=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success&&w.newBlockId){let X=w.blockType??"paragraph",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.newBlockId}]${D}`)}}return b.join(`
90
+ `)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:b,content:w}=$.insertedBlock,X=w.length>200?`${w.slice(0,200)}...`:w;if(I.push(`Type: ${b}`),X)I.push(`Content: ${X}`)}let U=nD($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
91
+ `)}function hB($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let b=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let w of $.results)if(w.success){let X=w.blockType??"?",D=w.contentPreview?`: ${w.contentPreview.slice(0,60)}${w.contentPreview.length>60?"...":""}`:"";b.push(` [${X} | ${w.blockId}]${D}`)}}return b.join(`
92
+ `)}let I=[];if($.deletedBlock){let{blockType:b,contentPreview:w}=$.deletedBlock;if(I.push(`Deleted [${b} | ${$.deletedBlock.blockId}]`),w)I.push(`Was: ${w}`)}else I.push("Block deleted");let U=nD($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
93
+ `)}function fB($){if(!$.success)return $.error??"create_record failed";let I=[`[record created | id=${$.recordId??""}]`,$.title?`title: ${$.title}`:"",$.workspaceId?`workspace: ${$.workspaceId}`:"",$.spaceId?`space: ${$.spaceId}`:"space: —"].filter(Boolean).join(`
92
94
  `),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let b=U.map(([w,X])=>k$([w,X]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...b].join(`
93
- `)}function hJ($){if(!$.success)return $.error??"insert_procedure_node failed";let I=$.parentId??"(root)";return`[procedure_node inserted | id=${$.nodeId??""}, parent=${I}, order=${$.order??0}, record=${$.recordId??""}]`}function fJ($){if(!$.success)return $.error??"update_procedure_node failed";let I=$.updatedFields?.join(", ")??"no changes";return`[procedure_node updated | id=${$.nodeId??""}, record=${$.recordId??""}, fields=${I}]`}function yJ($){if(!$.success)return $.error??"create_artifact failed";let U=[`[artifact created | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, workspace=${$.workspaceId??""}, status=${$.status??""}]`];if($.enrichment)if($.enrichment.source==="pubchem"){let b=$.enrichment.populatedKeys,w=b.length===0?"no fields filled (all already present)":`${b.length} field${b.length===1?"":"s"} filled: ${b.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${w}]`)}else{let b=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${b}]`)}if($.linkToNode)if($.linkToNode.success)U.push(`[link_to_node | linkId=${$.linkToNode.linkId}, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}]`);else U.push(`[link_to_node | failed, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}, error=${$.linkToNode.error}]`);if($.warnings&&$.warnings.length>0){let b=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${b}]`)}if($.schema)U.push(uJ($.schema));return U.join(`
94
- `)}function uJ($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((b)=>{let w=b.unit?`[${b.unit}]`:"",X=b.options&&b.options.length>0?`=${b.options.join("|")}`:"",D=b.auto?"*":"";return`${b.key}:${b.type}${w}${X}${D}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function lJ($){if(!$.success)return $.error??"instantiate_artifact_template failed";let I=[`[artifact instantiated | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, template=${$.templateId??""}]`],U=$.links?.length??0;if(U>0){let w=($.links??[]).map((X)=>X.label?`${X.role}/${X.label}=${X.artifactId}`:`${X.role}=${X.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${w}]`)}let b=$.pendingSlots?.length??0;if(b>0){let w=($.pendingSlots??[]).map((X)=>{let D=X.filter?.artifactType?`:${X.filter.artifactType}${X.filter.structureClass?`/${X.filter.structureClass}`:""}`:"",W=X.label?`(${X.label})`:"";return`${X.role}${W}${D}`}).join(", ");I.push(`[pending_slots | ${b} slot${b===1?"":"s"} need binding: ${w}]`)}return I.join(`
95
- `)}function cJ($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"",b=[`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`];if($.warnings&&$.warnings.length>0){let w=$.warnings.map((X)=>X.class?`${X.key}→${X.suggestion} (${X.class})`:`${X.key}→${X.suggestion}`).join(", ");b.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${w}]`)}if($.schema)b.push(uJ($.schema));return b.join(`
96
- `)}function mJ($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function rJ($){if(!$.success)return $.error??"delete_procedure_node failed";let I=$.orphanedMatrixIds??[],U=`[procedure_node deleted | id=${$.nodeId??""}, record=${$.recordId??""}, deletedNodes=${$.deletedNodeCount??1}, orphanedMatrices=${I.length}]`;if(I.length===0)return U;let b=I.map((w)=>k$([w]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...b].join(`
97
- `)}function nJ($){if(!$.success)return $.error??"build_procedure_tree failed";let I=$.nodeIdMap?Object.entries($.nodeIdMap):[],U=[`[procedure_tree ${$.mode??"built"} | record=${$.recordId??""}, inserted=${I.length}`];if($.mode==="replace")U.push(`, deleted=${$.deletedNodeCount??0}`),U.push(`, orphanedMatrices=${$.orphanedMatrixIds?.length??0}`);U.push("]");let b=U.join("");if(I.length===0)return b;let w=I.map(([D,W])=>k$([D,W])),X=[b,`{tempId,nodeId}[${I.length}]:`,...w];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){X.push(""),X.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),X.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let D of $.orphanedMatrixIds)X.push(k$([D]))}return X.join(`
98
- `)}function iJ($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function oJ($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],U=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
99
- `)}function dJ($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],U=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
100
- `)}function pJ($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",U=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${U}, version=${$.newVersion??0}]`}function tJ($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function aJ($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,U=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${U}, version=${$.newVersion??0}]`}function eJ($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let U=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],b=I.map((w)=>k$([w.sourceType,w.sourceId,w.sourceTitle??""]));return[...U,...b].join(`
101
- `)}function sJ($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function $H($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function IH($){if(!$.success)return $.error??"list_node_artifact_links failed";let I=$.links??[];if(I.length===0)return`[node_artifact_links: node=${$.nodeId??""}, count=0] no artifact links.`;let U=[`[node_artifact_links: node=${$.nodeId??""}, count=${I.length}]`,`{linkId,artifactId,artifactName,artifactType,role,context}[${I.length}]:`],b=I.map((w)=>k$([w.linkId,w.artifactId,w.artifactName??"",w.artifactType??"",w.role,w.context&&Object.keys(w.context).length>0?JSON.stringify(w.context):""]));return[...U,...b].join(`
102
- `)}function pF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function UH($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],b=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],w=[];if(I.length>0){w.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let Q of I)w.push(k$([Q.id,Q.parentId??"",Q.order,Q.type,Q.label,Q.copyable?"true":"false",Q.matrixCount,Q.artifactCount,Q.fileCount,Q.proseBlockCount]))}else w.push("No procedure nodes.");let X=[];for(let Q of I){if(!Q.matrices||Q.matrices.length===0)continue;for(let G of Q.matrices)X.push({nodeId:Q.id,matrix:G})}let D=[];if(X.length>0){D.push(""),D.push("[attachedMatrices]"),D.push(`{nodeId,matrixId,label,version,rows,cols}[${X.length}]:`);for(let{nodeId:Q,matrix:G}of X)D.push(k$([Q,G.id,G.label,G.version,G.rowCount,pF(G.columns)]))}let W=[];if(U.length>0)if(W.push(""),W.push("[orphanedMatrices]"),U.some((G)=>G.version!==void 0&&G.columns!==void 0)){W.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?pF(G.columns):"",G.updatedAt]))}else{W.push(`{id,label,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.updatedAt]))}return[...b,...w,...D,...W].join(`
103
- `)}var zu=Y.enum(["preamble","full"]),wH=Y.object({entityId:Y.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:Y.array(Y.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:zu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:Y.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:Y.array(Y.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:Y.array(Y.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:Y.array(Y.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:Y.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:Y.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:Y.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:Y.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:Y.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},Y.boolean()).optional().describe("Return entity connections (graph edges). Shows which entities mention, cite, or annotate this entity and vice versa. Included automatically as a summary in overview mode.")}),r0={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n11. **Connections**: Pass `connections=true` to get all entity connections (mentions, citations, annotation edges). Included automatically in overview mode as a summary. Annotation edges include edge text explaining the relationship.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var bH=Y.object({forceRefresh:Y.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),n0={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var yD=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),afterBlockId:Y.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:Y.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:Y.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:Y.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:Y.enum(_D).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:Y.string().optional().describe("Text content for the new block"),headingLevel:Y.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:Y.boolean().optional().describe("Checked state for checkListItem"),title:Y.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:Y.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:Y.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:Y.enum(ZD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:Y.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:Y.string().optional().describe("Cached title of the linked entity"),doi:Y.string().optional().describe("DOI for literature references"),smiles:Y.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:Y.enum(CD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:Y.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:Y.string().optional().describe("Optional description or notes for the structure block"),matrixId:Y.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:Y.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:Y.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:Y.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:Y.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:Y.array(UJ).max(vI).optional().describe(`Array of blocks to insert in sequence. Max ${vI} blocks. Use this for inserting multiple blocks in one call.`)}),Lu=yD.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),i0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
95
+ `)}function yB($){if(!$.success)return $.error??"insert_procedure_node failed";let I=$.parentId??"(root)";return`[procedure_node inserted | id=${$.nodeId??""}, parent=${I}, order=${$.order??0}, record=${$.recordId??""}]`}function uB($){if(!$.success)return $.error??"update_procedure_node failed";let I=$.updatedFields?.join(", ")??"no changes";return`[procedure_node updated | id=${$.nodeId??""}, record=${$.recordId??""}, fields=${I}]`}function lB($){if(!$.success)return $.error??"create_artifact failed";let U=[`[artifact created | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, workspace=${$.workspaceId??""}, status=${$.status??""}]`];if($.enrichment)if($.enrichment.source==="pubchem"){let b=$.enrichment.populatedKeys,w=b.length===0?"no fields filled (all already present)":`${b.length} field${b.length===1?"":"s"} filled: ${b.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${w}]`)}else{let b=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${b}]`)}if($.linkToNode)if($.linkToNode.success)U.push(`[link_to_node | linkId=${$.linkToNode.linkId}, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}]`);else U.push(`[link_to_node | failed, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}, error=${$.linkToNode.error}]`);if($.warnings&&$.warnings.length>0){let b=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${b}]`)}if($.schema)U.push(cB($.schema));return U.join(`
96
+ `)}function cB($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((b)=>{let w=b.unit?`[${b.unit}]`:"",X=b.options&&b.options.length>0?`=${b.options.join("|")}`:"",D=b.auto?"*":"";return`${b.key}:${b.type}${w}${X}${D}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function mB($){if(!$.success)return $.error??"instantiate_artifact_template failed";let I=[`[artifact instantiated | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, template=${$.templateId??""}]`],U=$.links?.length??0;if(U>0){let w=($.links??[]).map((X)=>X.label?`${X.role}/${X.label}=${X.artifactId}`:`${X.role}=${X.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${w}]`)}let b=$.pendingSlots?.length??0;if(b>0){let w=($.pendingSlots??[]).map((X)=>{let D=X.filter?.artifactType?`:${X.filter.artifactType}${X.filter.structureClass?`/${X.filter.structureClass}`:""}`:"",W=X.label?`(${X.label})`:"";return`${X.role}${W}${D}`}).join(", ");I.push(`[pending_slots | ${b} slot${b===1?"":"s"} need binding: ${w}]`)}return I.join(`
97
+ `)}function rB($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"",b=[`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`];if($.warnings&&$.warnings.length>0){let w=$.warnings.map((X)=>X.class?`${X.key}→${X.suggestion} (${X.class})`:`${X.key}→${X.suggestion}`).join(", ");b.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${w}]`)}if($.schema)b.push(cB($.schema));return b.join(`
98
+ `)}function nB($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function iB($){if(!$.success)return $.error??"delete_procedure_node failed";let I=$.orphanedMatrixIds??[],U=`[procedure_node deleted | id=${$.nodeId??""}, record=${$.recordId??""}, deletedNodes=${$.deletedNodeCount??1}, orphanedMatrices=${I.length}]`;if(I.length===0)return U;let b=I.map((w)=>k$([w]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...b].join(`
99
+ `)}function oB($){if(!$.success)return $.error??"build_procedure_tree failed";let I=$.nodeIdMap?Object.entries($.nodeIdMap):[],U=[`[procedure_tree ${$.mode??"built"} | record=${$.recordId??""}, inserted=${I.length}`];if($.mode==="replace")U.push(`, deleted=${$.deletedNodeCount??0}`),U.push(`, orphanedMatrices=${$.orphanedMatrixIds?.length??0}`);U.push("]");let b=U.join("");if(I.length===0)return b;let w=I.map(([D,W])=>k$([D,W])),X=[b,`{tempId,nodeId}[${I.length}]:`,...w];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){X.push(""),X.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),X.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let D of $.orphanedMatrixIds)X.push(k$([D]))}return X.join(`
100
+ `)}function dB($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function pB($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],U=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
101
+ `)}function tB($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],U=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((b)=>k$([b]))].join(`
102
+ `)}function aB($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",U=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${U}, version=${$.newVersion??0}]`}function eB($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function sB($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,U=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${U}, version=${$.newVersion??0}]`}function $H($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let U=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],b=I.map((w)=>k$([w.sourceType,w.sourceId,w.sourceTitle??""]));return[...U,...b].join(`
103
+ `)}function IH($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function UH($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function wH($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function bH($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function XH($){if(!$.success)return $.error??"list_node_artifact_links failed";let I=$.links??[];if(I.length===0)return`[node_artifact_links: node=${$.nodeId??""}, count=0] no artifact links.`;let U=[`[node_artifact_links: node=${$.nodeId??""}, count=${I.length}]`,`{linkId,artifactId,artifactName,artifactType,role,context}[${I.length}]:`],b=I.map((w)=>k$([w.linkId,w.artifactId,w.artifactName??"",w.artifactType??"",w.role,w.context&&Object.keys(w.context).length>0?JSON.stringify(w.context):""]));return[...U,...b].join(`
104
+ `)}function GF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function DH($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],b=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],w=[];if(I.length>0){w.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let Q of I)w.push(k$([Q.id,Q.parentId??"",Q.order,Q.type,Q.label,Q.copyable?"true":"false",Q.matrixCount,Q.artifactCount,Q.fileCount,Q.proseBlockCount]))}else w.push("No procedure nodes.");let X=[];for(let Q of I){if(!Q.matrices||Q.matrices.length===0)continue;for(let G of Q.matrices)X.push({nodeId:Q.id,matrix:G})}let D=[];if(X.length>0){D.push(""),D.push("[attachedMatrices]"),D.push(`{nodeId,matrixId,label,version,rows,cols}[${X.length}]:`);for(let{nodeId:Q,matrix:G}of X)D.push(k$([Q,G.id,G.label,G.version,G.rowCount,GF(G.columns)]))}let W=[];if(U.length>0)if(W.push(""),W.push("[orphanedMatrices]"),U.some((G)=>G.version!==void 0&&G.columns!==void 0)){W.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.version??"",G.rowCount??"",G.columns?GF(G.columns):"",G.updatedAt]))}else{W.push(`{id,label,updatedAt}[${U.length}]:`);for(let G of U)W.push(k$([G.id,G.label,G.updatedAt]))}return[...b,...w,...D,...W].join(`
105
+ `)}var Zu=N.object({cid:N.number().int().positive().describe("PubChem Compound ID (CID).")}),WH={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var Cu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,gu=N.object({inchi_key:N.string().regex(Cu,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),QH={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var BF=N.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),xu=N.object({cid:N.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:N.array(BF).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:N.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),GH={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var hu=N.enum(["preamble","full"]),YH=N.object({entityId:N.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:N.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},N.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:N.array(N.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:hu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:N.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:N.array(N.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:N.array(N.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:N.array(N.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:N.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:N.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:N.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:N.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.'),connections:N.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},N.boolean()).optional().describe("Return entity connections (graph edges), unioned across all relationship subsystems: content-derived links (mentions, citations, annotation edges, matrix/artifact embeds) AND "+"transactional artifact links (record/procedure-node → "+'artifact, with role input|output|derived_from|referenced) AND matrix provenance (matrices this entity owns or that were derived from it). Inbound artifact links carry a reuse-degree ("shared by N records"). Both directions. Included automatically as a summary in overview mode.')}),g0={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n11. **Connections**: Pass `connections=true` to get all entity connections (mentions, citations, annotation edges). Included automatically in overview mode as a summary. Annotation edges include edge text explaining the relationship.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var NH=N.object({forceRefresh:N.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),x0={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var iD=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),afterBlockId:N.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:N.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:N.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:N.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:N.enum(yD).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:N.string().optional().describe("Text content for the new block"),headingLevel:N.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:N.boolean().optional().describe("Checked state for checkListItem"),title:N.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:N.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:N.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:N.enum(uD).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:N.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:N.string().optional().describe("Cached title of the linked entity"),doi:N.string().optional().describe("DOI for literature references"),smiles:N.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:N.enum(lD).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:N.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:N.string().optional().describe("Optional description or notes for the structure block"),matrixId:N.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:N.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:N.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:N.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:N.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:N.array(JB).max(qI).optional().describe(`Array of blocks to insert in sequence. Max ${qI} blocks. Use this for inserting multiple blocks in one call.`)}),fu=iD.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),h0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
104
106
  1. afterBlockId: Insert as SIBLING after the specified block
105
107
  2. beforeBlockId: Insert as SIBLING before the specified block
106
108
  3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
@@ -171,7 +173,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
171
173
 
172
174
  The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
173
175
 
174
- **Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var XH=Y.object({templateId:Y.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:Y.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:Y.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:Y.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:Y.string().optional(),tags:Y.array(Y.string()).optional(),properties:Y.record(Y.string(),Y.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:MI.optional(),storageRef:Y.string().optional(),location:Y.string().optional(),parentId:Y.string().uuid().optional(),sourceRecordId:Y.string().uuid().optional(),slotBindings:Y.array(Y.object({role:Y.string().describe('Slot role from the template (e.g. "reactant").'),label:Y.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:Y.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),o0={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var Ku=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID).")}),DH={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var vu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,Vu=Y.object({inchi_key:Y.string().regex(vu,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),WH={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var eF=Y.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),qu=Y.object({cid:Y.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:Y.array(eF).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:Y.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),QH={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var Fu=Y.object({cas:Y.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),GH={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var Mu=Y.object({name:Y.string().optional().describe("Compound name, trade name, or systematic name."),cas:Y.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:Y.number().int().positive().optional().describe("PubChem CID."),inchi_key:Y.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:Y.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),NH={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var YH=Y.object({query:Y.string().min(1).optional().describe("Search query keywords"),mode:Y.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:Y.object({type:Y.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:Y.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:Y.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:Y.string().uuid().optional().describe("Filter by workspace ID"),spaceId:Y.string().uuid().optional().describe("Filter by space ID"),limit:Y.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:Y.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:Y.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:Y.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:Y.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),tags:Y.array(Y.string()).optional().describe("Filter by tags. Matches entities that have all of the provided tags by default."),artifactType:Y.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:Y.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),d0={name:"search",description:`Search across literature, documents, records, and artifacts.
176
+ **Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var JH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:N.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:N.string().min(1).describe("Human-readable node label."),type:FI.describe("Node type."),afterNodeId:N.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:N.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:N.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:N.array(jI).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),f0={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var BH=N.object({templateId:N.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:N.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:N.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:N.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:N.string().optional(),tags:N.array(N.string()).optional(),properties:N.record(N.string(),N.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:EI.optional(),storageRef:N.string().optional(),location:N.string().optional(),parentId:N.string().uuid().optional(),sourceRecordId:N.string().uuid().optional(),slotBindings:N.array(N.object({role:N.string().describe('Slot role from the template (e.g. "reactant").'),label:N.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:N.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),y0={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var HH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:N.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:N.enum(["input","output","derived_from","referenced"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). `derived_from` = this step's design/procedure was adapted from the artifact (e.g., reaction artifact serving as the recipe template). `referenced` = the step references the artifact without consuming or producing it (e.g., a reaction artifact, equipment manual, or literature item it documents). Pick by direction of flow / nature of the relationship."),context:N.record(N.string(),N.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),u0={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step), `output` (produced/generated), `derived_from` (this step adapts another artifact as its recipe — e.g., a reaction artifact serving as the procedure template), `referenced` (the step references the artifact without consuming/producing — e.g., equipment manuals, literature, reaction artifacts). Pick by direction of flow / nature of the relationship.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var AH=N.object({matrixId:N.string().uuid().describe("UUID of the matrix to inspect.")}),l0={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var OH=N.object({nodeId:N.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),c0={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var zH=N.object({recordId:N.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),m0={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var LH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),nodeRef:N.union([N.string().uuid(),N.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),r0={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var HF=N.object({nodeId:N.string().uuid().describe("UUID of the node to move/reorder."),parentId:N.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:N.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),KH=N.object({recordId:N.string().uuid().describe("Target record UUID. Must be in draft status."),moves:N.array(HF).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),n0={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var yu=N.object({cas:N.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),vH={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var VH=N.object({query:N.string().min(1).optional().describe("Search query keywords"),mode:N.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:N.object({type:N.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:N.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:N.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:N.string().uuid().optional().describe("Filter by workspace ID"),spaceId:N.string().uuid().optional().describe("Filter by space ID"),limit:N.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:N.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:N.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:N.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:N.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),tags:N.array(N.string()).optional().describe("Filter by tags. Matches entities that have all of the provided tags by default."),artifactType:N.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:N.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),i0={name:"search",description:`Search across literature, documents, records, and artifacts.
175
177
 
176
178
  **Modes:**
177
179
  - \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
@@ -223,4 +225,9 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
223
225
  **Retrieval Hints:**
224
226
  Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
225
227
  - High relevance: Jump directly to the best block via \`blockIds=['bestBlockId']\`
226
- - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var BH=Y.object({entityType:D4.describe('Entity type: "document" or "record"'),entityId:Y.string().uuid().describe("Document or record ID"),blockId:Y.string().describe("Block ID to edit"),oldText:Y.string().describe("Exact text to find and replace (must match exactly)"),newText:Y.string().describe("Text to replace with")}),p0={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var JH=[d0,r0,p0,i0,K0,T0,_0,j0,E0,k0,P0,o0,n0,R0,M0,x0,m0,l0,g0,v0,c0,S0,C0,h0,V0,q0,Z0,f0,y0,u0,NH,DH,WH,GH,QH],ju=JH.map(($)=>$.name),Eu=Object.fromEntries(JH.map(($)=>[$.name,$]));function HH($){return{content:[{type:"text",text:$}]}}function AH($){return{content:[{type:"text",text:$}],isError:!0}}function u($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(B)=>B.message,getLogMessage:Q=(B)=>JSON.stringify(B).slice(0,100)}=U,G=X(I),N=w.shape;$.tool(b.name,b.description,N,async(B)=>{let H=B,J=Q(H);I.log.info(`${b.name}: ${J}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),HH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),AH(`${b.name} error: ${O}`)}})}function sF($,I,U){let{definition:b,schema:w,createExecutor:X,formatSuccess:D,formatNotFound:W=(H)=>JSON.stringify({found:!1,error:H.error??"Not found"}),formatError:Q=(H)=>H.message,getLogMessage:G=(H)=>JSON.stringify(H).slice(0,100)}=U,N=X(I),B=w.shape;$.tool(b.name,b.description,B,async(H)=>{let J=H,A=G(J);I.log.info(`${b.name}: ${A}`);try{let O=await N(J);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,J)}],isError:!0};return I.log.info(`${b.name}: found`),HH(D(O,J))}catch(O){let V=O instanceof Error?Q(O,J):"Unknown error";return I.log.error(`${b.name} failed:`,O),AH(`${b.name} error: ${V}`)}})}function $M($,I){u($,I,{definition:v0,schema:bJ,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:iJ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function IM($,I){u($,I,{definition:V0,schema:XJ,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:aJ,getLogMessage:(U)=>{let b=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${b}`}})}function UM($,I){u($,I,{definition:M0,schema:WJ,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:nJ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function wM($,I){u($,I,{definition:P0,schema:YJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:yJ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function bM($,I){u($,I,{definition:T0,schema:HJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:_J,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function XM($,I){u($,I,{definition:j0,schema:QJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:kJ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function DM($,I){u($,I,{definition:E0,schema:GJ,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:RJ,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function WM($,I){u($,I,{definition:k0,schema:BJ,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:xJ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function QM($,I){u($,I,{definition:_0,schema:hD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:gJ,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function GM($,I){u($,I,{definition:Z0,schema:AJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:tJ,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function NM($,I){u($,I,{definition:C0,schema:OJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:dJ,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function YM($,I){u($,I,{definition:g0,schema:zJ,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:rJ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function BM($,I){sF($,I,{definition:r0,schema:wH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:PJ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let b=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${b})`}})}function JM($,I){u($,I,{definition:n0,schema:bH,createExecutor:(U)=>{return async(b)=>{if(U.workspaceContext&&!b.forceRefresh)return U.workspaceContext;let w=await U.client.getWorkspaceContext();return U.workspaceContext=w,w}},formatOutput:EJ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function HM($,I){u($,I,{definition:i0,schema:yD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:CJ,getLogMessage:(U)=>{let b;if(U.parentBlockId)b=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)b=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)b=`after:${U.afterBlockId.slice(0,8)}`;else b="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (${U.blockType??"paragraph"})`}})}function AM($,I){u($,I,{definition:K0,schema:wJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>TJ(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function OM($,I){u($,I,{definition:x0,schema:LJ,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:hJ,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function zM($,I){u($,I,{definition:o0,schema:XH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:lJ,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function LM($,I){u($,I,{definition:f0,schema:vJ,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:sJ,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function KM($,I){u($,I,{definition:q0,schema:DJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:eJ,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function vM($,I){u($,I,{definition:u0,schema:qJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:IH,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function VM($,I){u($,I,{definition:R0,schema:JJ,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:UH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function qM($,I){u($,I,{definition:h0,schema:KJ,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:pJ,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function FM($,I){u($,I,{definition:l0,schema:FJ,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:mJ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function Su($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function MM($,I){u($,I,{definition:d0,schema:YH,createExecutor:(U)=>{return async(b)=>{let w=b.mode??"library",X=b.limit??10;if(b.scope?.type==="artifact"&&w==="library"&&b.workspaceId){let G=await U.client.searchArtifacts({workspaceId:b.workspaceId,query:b.query,artifactType:b.artifactType,artifactStatus:b.artifactStatus,limit:X}),N=G.results.map((B)=>{let H=B.description?B.description.length>100?`${B.description.slice(0,97)}...`:B.description:`${B.artifactType}, ${B.status}`;return{entityType:"artifact",entityId:B.id,entityTitle:B.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${B.id}")`}}});return{mode:"library",found:N.length,results:N,hasMore:G.hasMore}}let D=await U.client.search({query:b.query,mode:w,entityType:b.scope?.type,entityId:b.scope?.entityId,orgId:b.orgId,workspaceId:b.workspaceId,spaceId:b.spaceId,limit:X,offset:0,authorName:b.authorName,yearMin:b.yearMin,yearMax:b.yearMax,journalName:b.journalName,tags:b.tags}),W=D.results??[];if(w==="library"){let G=W.map((N)=>{let{bestMatch:B}=N,H=Su(B.rank,N.matchCount),J={entityType:N.entityType,entityId:N.entityId,entityTitle:N.entityTitle,matchCount:N.matchCount,bestBlockId:B.blockId,snippet:B.snippet,relevance:H,tags:N.tags,retrievalHint:B.blockId?{recommended:"blockIds",usage:`blockIds=['${B.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(N.literatureMetadata)J.literatureMetadata=N.literatureMetadata;if(N.creatorId)J.creatorId=N.creatorId;if(N.creatorName)J.creatorName=N.creatorName;return J});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let N={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,blockId:"blockId"in G?G.blockId:"",snippet:"snippet"in G?G.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in G?G.blockId:""}']`}},B=G.creatorId,H=G.creatorName;if(B)N.creatorId=B;if(H)N.creatorName=H;return N});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>SJ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function jM($,I){u($,I,{definition:p0,schema:BH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:ZJ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function EM($,I){u($,I,{definition:y0,schema:VJ,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:$H,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function SM($,I){u($,I,{definition:S0,schema:NJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:cJ,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function PM($,I){u($,I,{definition:c0,schema:MJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:oJ,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function kM($,I){u($,I,{definition:m0,schema:jJ,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:fJ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function RM($,I){I.log.info("Registering tools..."),MM($,I),BM($,I),jM($,I),HM($,I),AM($,I),bM($,I),QM($,I),XM($,I),DM($,I),WM($,I),JM($,I),VM($,I),UM($,I),OM($,I),kM($,I),FM($,I),YM($,I),$M($,I),PM($,I),NM($,I),qM($,I),GM($,I),IM($,I),KM($,I),wM($,I),SM($,I),zM($,I),LM($,I),EM($,I),vM($,I),I.log.info("All tools registered")}function Pu(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let b=$[U],w=$[U+1];if((b==="--api-key"||b==="-k")&&w)I.apiKey=w,U++;else if((b==="--api-url"||b==="-u")&&w)I.apiUrl=w,U++;else if(b==="--help"||b==="-h")process.exit(0)}return I}w4.info("Starting SURA MCP Server...");var TM=Pu(),_M=TM.apiKey??process.env.SURA_API_KEY,ku=TM.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!_M)w4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),w4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var Ru=await lV({apiUrl:ku,apiKey:_M}),ZM=new yQ({name:"sura",version:"0.1.0"});RM(ZM,Ru);var CM=new lQ,gM=async($)=>{w4.info(`Received ${$}, shutting down...`),await CM.close(),process.exit(0)};process.on("SIGTERM",()=>gM("SIGTERM"));process.on("SIGINT",()=>gM("SIGINT"));process.on("uncaughtException",($)=>{w4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{w4.error("Unhandled rejection:",$)});w4.info("Connecting stdio transport...");await ZM.connect(CM);w4.info("SURA MCP Server ready");
228
+ - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var uu=N.object({name:N.string().optional().describe("Compound name, trade name, or systematic name."),cas:N.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:N.number().int().positive().optional().describe("PubChem CID."),inchi_key:N.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:N.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),qH={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var MH=N.object({entityId:N.string().describe('Entity ID (UUID or short ref like "rec-a3f7e2b9") to situate — the root of the bounded subgraph.'),depth:N.union([N.literal(1),N.literal(2),N.literal(3)]).optional().describe("Traversal depth (1–3, default 2). Bounded BFS over the unified edge model; matrix/node endpoints are terminal leaves.")}),o0={name:"situate",description:["Get the bounded k-hop relationship subgraph around an entity in ONE call — instead of 4–6 manual get_content follow-ups.","Bounded BFS over the unified edge model (the same edges get_content surfaces): mentions, citations, annotation edges, matrix/artifact embeds, transactional artifact links (record/procedure-node → artifact, role input|output|derived_from|referenced), matrix provenance, and promoted typed relation predicates.","Returns the root, hop-annotated nodes, and canonical hop-annotated edges grouped by depth. `matrix`/`node` endpoints are terminal leaves (included, not expanded). Per-hop ranking keeps typed/promoted + high-reuse + structural edges; `truncated:true` means a busy hop dropped low-signal edges (raise nothing — re-`situate` a specific node instead).","Use this to map how a record/document/literature/artifact connects across the workspace before deep-reading; follow interesting nodes with get_content."].join(" ")};var FH=N.object({entityType:W4.describe('Entity type: "document" or "record"'),entityId:N.string().uuid().describe("Document or record ID"),blockId:N.string().describe("Block ID to edit"),oldText:N.string().describe("Exact text to find and replace (must match exactly)"),newText:N.string().describe("Text to replace with")}),d0={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var jH=N.object({linkId:N.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),p0={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var t0={tests:{gloss:"experiment/run → hypothesis/claim/method/prediction: the subject is an empirical test of the object.",reading:"[subject] tests [object]",example:"This run tests the biphasic-DMSN nucleation hypothesis.",symmetric:!1},supports:{gloss:"evidence/result → claim: the subject is evidence in favour of the object (positive pole).",reading:"[subject] supports [object]",example:"The DLS size distribution supports the monodispersity claim.",symmetric:!1},refutes:{gloss:"evidence/result → claim: the subject is evidence against the object (negative pole).",reading:"[subject] refutes [object]",example:"The blank control refutes the catalyst-free pathway claim.",symmetric:!1},replicates:{gloss:"run → prior run: the subject independently reproduces the object under matching conditions.",reading:"[subject] replicates [object]",example:"This batch replicates the 2026-03 reference synthesis.",symmetric:!1},supersedes:{gloss:"newer → older: the subject wholesale replaces the object (the object no longer stands).",reading:"[subject] supersedes [object]",example:"The v2 protocol supersedes the original procedure.",symmetric:!1},corrects:{gloss:"erratum/fix → flawed entity: the subject fixes a specific error in the object (object otherwise stands).",reading:"[subject] corrects [object]",example:"This erratum corrects the yield reported in the prior record.",symmetric:!1},uses:{gloss:"run/analysis → protocol/method/instrument/dataset: the subject employs the object as an input or tool.",reading:"[subject] uses [object]",example:"This characterization uses the standard DLS SOP.",symmetric:!1},characterizes:{gloss:"analysis/measurement → sample/material: the subject measures or describes properties of the object.",reading:"[subject] characterizes [object]",example:"This TEM analysis characterizes the silica nanoparticle sample.",symmetric:!1}},EH=Object.keys(t0),a0=N.enum(EH);function J1(){return EH.map(($)=>`- \`${$}\` — ${t0[$].gloss} Reading: "${t0[$].reading}". e.g. ${t0[$].example}`).join(`
229
+ `)}var oD=N.object({artifactLinkId:N.string().uuid().describe("The `artifact_links` row's `id` (the join-row uuid). Returned by `link_artifact_to_node` and `list_node_artifact_links`. This is the JOIN-ROW id, NOT the artifact id or node id."),relationType:a0.describe(`The relation predicate. One of the eight ratified predicates — DISJOINT from the structural roles (input/output/derived_from/referenced). NEVER pass a structural role here:
230
+ ${J1()}`),note:N.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed relation. Domain specificity lives here; the predicate stays universal. Stored in `relation_note`; the structural `role` is left untouched.")}),lu=oD.extend({note:N.string().optional()}),e0={name:"update_artifact_link_relation",description:["Set the TYPED, queryable SEMANTIC relation on an existing artifact ↔ source link (an `artifact_links` row) — the epistemic/methodological layer the structural roles (input/output/derived_from/referenced) cannot express.","Use this to record what a node/record actually *does* relative to a linked artifact: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","This is SEPARATE from `link_artifact_to_node` (which creates the row + sets the structural `role`). It keys on the join-row `artifactLinkId` and writes ONLY `relation_type`/`relation_note`; the structural `role` is never changed.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",J1(),"Re-calling with the same `artifactLinkId` re-types the relation in place."].join(`
231
+ `)};var dD=N.object({edgeId:N.string().uuid().optional().describe("OPTIONAL. Present → RE-TYPE mode: the mention already carries this `edgeId` prop (an already-promoted edge); the tool re-edits the typed metadata in place (DB-only, no document write). Absent → PROMOTION mode: the mention is currently untyped; the tool locates the mention inline in the source entity, mints a fresh `edgeId` into it (the durable anchor), then writes the typed edge. Promotion needs WebSocket config; re-type does not."),sourceEntityId:N.string().uuid().describe("UUID of the document/record the mention lives in (the edge subject)."),sourceEntityType:N.enum(["document","record"]).describe("Type of the source entity (document or record)."),targetEntityId:N.string().uuid().describe("UUID of the mentioned entity (the edge object)."),targetEntityType:N.enum(["literature","document","record","artifact","matrix"]).describe("Type of the mentioned (target) entity."),blockId:N.string().optional().describe("PROMOTION mode only. Optional block scope: when set, only that block is searched for the target mention; when omitted, the whole source entity body is searched. Pass this to disambiguate when the same entity is mentioned in multiple blocks (the tool returns an `ambiguous_mention` error telling you to.) Ignored in re-type mode."),occurrence:N.number().int().min(0).optional().describe("PROMOTION mode only. 0-based index among matching mentions within the search scope (default 0 = first match). Pass this to disambiguate when a single block contains multiple mentions of the same target entity (the tool returns an `ambiguous_mention` error telling you to). Ignored in re-type mode."),relationType:a0.describe(`The relation predicate. One of the eight ratified, disjoint-from-structural predicates:
232
+ ${J1()}`),note:N.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed edge. Domain specificity lives here; the predicate stays universal."),direction:N.enum(["forward","inverse"]).describe("Reading orientation (§6.2). `forward` = subject → object (the source entity tests/uses/etc. the mentioned entity — the usual case). `inverse` = object → subject (e.g. the mentioned reviewer note *refutes* this document). Storage always keeps source = subject; this only flips the reading.")}),cu=dD.extend({edgeId:N.string().uuid(),note:N.string().optional()}),s0={name:"update_edge",description:["Promote a plain @mention into a TYPED, queryable, convergence-preserved relationship edge — the epistemic/methodological layer the structural links (input/output/derived_from/referenced) cannot express.","Use this to record what a run/analysis/result actually *does* relative to another entity: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",J1(),"Two modes: (a) PROMOTION — omit `edgeId`; the tool finds the @mention of `targetEntity` inside `sourceEntity`, writes a durable edge anchor into the document, then types the edge. Disambiguate with `blockId` and/or `occurrence` if the tool reports `ambiguous_mention`. (b) RE-TYPE — pass the existing `edgeId` (an already-promoted mention) to re-edit the typed metadata in place. Either way, the metadata survives every document convergence."].join(`
233
+ `)};var mu=N.record(N.string(),N.union([N.string(),N.number(),N.boolean(),N.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),ru=N.object({rowIndex:N.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:mu.optional(),values:MI.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),SH=N.object({matrixId:N.string().uuid().describe("UUID of the target data_matrix."),updates:N.array(ru).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:N.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),$w={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var PH=N.object({nodeId:N.string().uuid().describe("UUID of the existing procedure node to update."),label:N.string().min(1).optional().describe("New label (skip to keep existing)."),type:FI.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:N.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:N.array(jI).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),Iw={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var kH=[i0,g0,o0,d0,h0,v0,k0,T0,S0,P0,R0,E0,y0,x0,m0,F0,f0,Iw,n0,C0,V0,$w,j0,Z0,r0,q0,l0,_0,u0,p0,c0,e0,s0,qH,WH,QH,vH,GH],nu=kH.map(($)=>$.name),iu=Object.fromEntries(kH.map(($)=>[$.name,$]));function RH($){return{content:[{type:"text",text:$}]}}function TH($){return{content:[{type:"text",text:$}],isError:!0}}function g($,I,U){let{definition:b,schema:w,createExecutor:X,formatOutput:D,formatError:W=(J)=>J.message,getLogMessage:Q=(J)=>JSON.stringify(J).slice(0,100)}=U,G=X(I),Y=w.shape;$.tool(b.name,b.description,Y,async(J)=>{let H=J,B=Q(H);I.log.info(`${b.name}: ${B}`);try{let A=await G(H),O=D(A,H);return I.log.info(`${b.name}: completed`),RH(O)}catch(A){let O=A instanceof Error?W(A,H):"Unknown error";return I.log.error(`${b.name} failed:`,A),TH(`${b.name} error: ${O}`)}})}function pD($,I,U){let{definition:b,schema:w,createExecutor:X,formatSuccess:D,formatNotFound:W=(H)=>JSON.stringify({found:!1,error:H.error??"Not found"}),formatError:Q=(H)=>H.message,getLogMessage:G=(H)=>JSON.stringify(H).slice(0,100)}=U,Y=X(I),J=w.shape;$.tool(b.name,b.description,J,async(H)=>{let B=H,A=G(B);I.log.info(`${b.name}: ${A}`);try{let O=await Y(B);if(!O.found)return I.log.info(`${b.name}: not found`),{content:[{type:"text",text:W(O,B)}],isError:!0};return I.log.info(`${b.name}: found`),RH(D(O,B))}catch(O){let V=O instanceof Error?Q(O,B):"Unknown error";return I.log.error(`${b.name} failed:`,O),TH(`${b.name} error: ${V}`)}})}function AF($,I){g($,I,{definition:V0,schema:HB,createExecutor:(U)=>{return async(b)=>{return await U.client.appendMatrixRows(b)}},formatOutput:dB,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function OF($,I){g($,I,{definition:q0,schema:AB,createExecutor:(U)=>{return async(b)=>{return await U.client.attachMatrix(b)}},formatOutput:sB,getLogMessage:(U)=>{let b=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${b}`}})}function zF($,I){g($,I,{definition:F0,schema:OB,createExecutor:(U)=>{return async(b)=>{return await U.client.buildProcedureTree(b)}},formatOutput:oB,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function LF($,I){g($,I,{definition:E0,schema:LB,createExecutor:(U)=>{return async(b)=>{return await U.client.createArtifact(b)}},formatOutput:lB,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function KF($,I){g($,I,{definition:S0,schema:KB,createExecutor:(U)=>{return async(b)=>{return await U.client.createDocument(b)}},formatOutput:TB,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function vF($,I){g($,I,{definition:P0,schema:vB,createExecutor:(U)=>{return async(b)=>{return U.client.createLiterature(b)}},formatOutput:_B,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function VF($,I){g($,I,{definition:k0,schema:VB,createExecutor:(U)=>{return async(b)=>{return await U.client.createMatrixFromReactionArtifact(b)}},formatOutput:CB,getLogMessage:(U)=>`Deriving matrix from reaction ${U.reactionArtifactId.slice(0,8)}`})}function qF($,I){g($,I,{definition:R0,schema:qB,createExecutor:(U)=>{return async(b)=>{return await U.client.createRecord(b)}},formatOutput:fB,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function MF($,I){g($,I,{definition:T0,schema:rD,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteBlock(b)}},formatOutput:hB,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function FF($,I){g($,I,{definition:_0,schema:MB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrix(b)}},formatOutput:eB,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function jF($,I){g($,I,{definition:Z0,schema:FB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteMatrixRows(b)}},formatOutput:tB,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function EF($,I){g($,I,{definition:C0,schema:jB,createExecutor:(U)=>{return async(b)=>{return await U.client.deleteProcedureNode(b)}},formatOutput:iB,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function SF($,I){pD($,I,{definition:g0,schema:YH,createExecutor:(U)=>{return async(b)=>{return U.client.getContent(b)}},formatSuccess:RB,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let b=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${b})`}})}function PF($,I){g($,I,{definition:x0,schema:NH,createExecutor:(U)=>{return async(b)=>{if(U.workspaceContext&&!b.forceRefresh)return U.workspaceContext;let w=await U.client.getWorkspaceContext();return U.workspaceContext=w,w}},formatOutput:SB,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function kF($,I){g($,I,{definition:h0,schema:iD,createExecutor:(U)=>{return async(b)=>{return await U.client.insertBlock(b)}},formatOutput:xB,getLogMessage:(U)=>{let b;if(U.parentBlockId)b=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)b=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)b=`after:${U.afterBlockId.slice(0,8)}`;else b="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${b} (${U.blockType??"paragraph"})`}})}function RF($,I){g($,I,{definition:v0,schema:BB,createExecutor:(U)=>{return async(b)=>{return await U.client.insertMatrix(b)}},formatOutput:(U)=>ZB(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function TF($,I){g($,I,{definition:f0,schema:JH,createExecutor:(U)=>{return async(b)=>{return await U.client.insertProcedureNode(b)}},formatOutput:yB,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function _F($,I){g($,I,{definition:y0,schema:BH,createExecutor:(U)=>{return async(b)=>{return await U.client.instantiateArtifactTemplate(b)}},formatOutput:mB,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function ZF($,I){g($,I,{definition:u0,schema:HH,createExecutor:(U)=>{return async(b)=>{return await U.client.linkArtifactToNode(b)}},formatOutput:IH,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function CF($,I){g($,I,{definition:l0,schema:AH,createExecutor:(U)=>{return async(b)=>{return await U.client.listMatrixReferences(b)}},formatOutput:$H,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function gF($,I){g($,I,{definition:c0,schema:OH,createExecutor:(U)=>{return async(b)=>{return await U.client.listNodeArtifactLinks(b)}},formatOutput:XH,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function xF($,I){g($,I,{definition:m0,schema:zH,createExecutor:(U)=>{return async(b)=>{return await U.client.listProcedureNodes(b)}},formatOutput:DH,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function hF($,I){g($,I,{definition:r0,schema:LH,createExecutor:(U)=>{return async(b)=>{return await U.client.rebindMatrixToNode(b)}},formatOutput:aB,getLogMessage:(U)=>{let b=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${b}`}})}function fF($,I){g($,I,{definition:n0,schema:KH,createExecutor:(U)=>{return async(b)=>{return await U.client.reorderProcedureNodes(b)}},formatOutput:nB,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function ou($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function yF($,I){g($,I,{definition:i0,schema:VH,createExecutor:(U)=>{return async(b)=>{let w=b.mode??"library",X=b.limit??10;if(b.scope?.type==="artifact"&&w==="library"&&b.workspaceId){let G=await U.client.searchArtifacts({workspaceId:b.workspaceId,query:b.query,artifactType:b.artifactType,artifactStatus:b.artifactStatus,limit:X}),Y=G.results.map((J)=>{let H=J.description?J.description.length>100?`${J.description.slice(0,97)}...`:J.description:`${J.artifactType}, ${J.status}`;return{entityType:"artifact",entityId:J.id,entityTitle:J.name,matchCount:1,bestBlockId:"",snippet:H,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${J.id}")`}}});return{mode:"library",found:Y.length,results:Y,hasMore:G.hasMore}}let D=await U.client.search({query:b.query,mode:w,entityType:b.scope?.type,entityId:b.scope?.entityId,orgId:b.orgId,workspaceId:b.workspaceId,spaceId:b.spaceId,limit:X,offset:0,authorName:b.authorName,yearMin:b.yearMin,yearMax:b.yearMax,journalName:b.journalName,tags:b.tags}),W=D.results??[];if(w==="library"){let G=W.map((Y)=>{let{bestMatch:J}=Y,H=ou(J.rank,Y.matchCount),B={entityType:Y.entityType,entityId:Y.entityId,entityTitle:Y.entityTitle,matchCount:Y.matchCount,bestBlockId:J.blockId,snippet:J.snippet,relevance:H,tags:Y.tags,retrievalHint:J.blockId?{recommended:"blockIds",usage:`blockIds=['${J.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(Y.literatureMetadata)B.literatureMetadata=Y.literatureMetadata;if(Y.creatorId)B.creatorId=Y.creatorId;if(Y.creatorName)B.creatorName=Y.creatorName;return B});return{mode:"library",found:G.length,results:G,hasMore:D.hasMore}}let Q=W.map((G)=>{let Y={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,blockId:"blockId"in G?G.blockId:"",snippet:"snippet"in G?G.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in G?G.blockId:""}']`}},J=G.creatorId,H=G.creatorName;if(J)Y.creatorId=J;if(H)Y.creatorName=H;return Y});return{mode:"blocks",found:Q.length,results:Q,hasMore:D.hasMore}}},formatOutput:(U)=>PB(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function uF($,I){pD($,I,{definition:o0,schema:MH,createExecutor:(U)=>{return async(b)=>{return U.client.situate(b)}},formatSuccess:kB,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>`${U.entityId.slice(0,8)}... (depth ${U.depth??2})`})}function lF($,I){g($,I,{definition:d0,schema:FH,createExecutor:(U)=>{return async(b)=>{return await U.client.strReplaceBlock(b)}},formatOutput:gB,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function cF($,I){g($,I,{definition:p0,schema:jH,createExecutor:(U)=>{return async(b)=>{return await U.client.unlinkArtifactFromNode(b)}},formatOutput:bH,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function mF($,I){g($,I,{definition:j0,schema:zB,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifact(b)}},formatOutput:rB,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function rF($,I){g($,I,{definition:e0,schema:oD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateArtifactLinkRelation(b)}},formatOutput:wH,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function nF($,I){g($,I,{definition:s0,schema:dD,createExecutor:(U)=>{return async(b)=>{return await U.client.updateEdge(b)}},formatOutput:UH,getLogMessage:(U)=>U.edgeId?`Re-typing edge ${U.edgeId.slice(0,8)} as "${U.relationType}" (${U.direction})`:`Promoting @mention → "${U.relationType}" edge (${U.direction})`})}function iF($,I){g($,I,{definition:$w,schema:SH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateMatrixRows(b)}},formatOutput:pB,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function oF($,I){g($,I,{definition:Iw,schema:PH,createExecutor:(U)=>{return async(b)=>{return await U.client.updateProcedureNode(b)}},formatOutput:uB,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function dF($,I){I.log.info("Registering tools..."),yF($,I),SF($,I),uF($,I),lF($,I),kF($,I),RF($,I),VF($,I),MF($,I),KF($,I),vF($,I),qF($,I),PF($,I),xF($,I),zF($,I),TF($,I),oF($,I),fF($,I),EF($,I),AF($,I),iF($,I),jF($,I),hF($,I),FF($,I),OF($,I),CF($,I),LF($,I),mF($,I),_F($,I),ZF($,I),cF($,I),gF($,I),rF($,I),nF($,I),I.log.info("All tools registered")}function du(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let b=$[U],w=$[U+1];if((b==="--api-key"||b==="-k")&&w)I.apiKey=w,U++;else if((b==="--api-url"||b==="-u")&&w)I.apiUrl=w,U++;else if(b==="--help"||b==="-h")process.exit(0)}return I}b4.info("Starting SURA MCP Server...");var pF=du(),tF=pF.apiKey??process.env.SURA_API_KEY,pu=pF.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!tF)b4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),b4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var tu=await wq({apiUrl:pu,apiKey:tF}),aF=new pQ({name:"sura",version:"0.1.0"});dF(aF,tu);var eF=new aQ,sF=async($)=>{b4.info(`Received ${$}, shutting down...`),await eF.close(),process.exit(0)};process.on("SIGTERM",()=>sF("SIGTERM"));process.on("SIGINT",()=>sF("SIGINT"));process.on("uncaughtException",($)=>{b4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{b4.error("Unhandled rejection:",$)});b4.info("Connecting stdio transport...");await aF.connect(eF);b4.info("SURA MCP Server ready");